public abstract class ScheduledReporter extends Object implements Closeable, Reporter
ConsoleReporter
,
CsvReporter
,
Slf4jReporter
Modifier | Constructor and Description |
---|---|
protected |
ScheduledReporter(MetricRegistry registry,
String name,
MetricFilter filter,
TimeUnit rateUnit,
TimeUnit durationUnit)
Creates a new
ScheduledReporter instance. |
protected |
ScheduledReporter(MetricRegistry registry,
String name,
MetricFilter filter,
TimeUnit rateUnit,
TimeUnit durationUnit,
ScheduledExecutorService executor)
Creates a new
ScheduledReporter instance. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Stops the reporter and shuts down its thread of execution.
|
protected double |
convertDuration(double duration) |
protected double |
convertRate(double rate) |
protected String |
getDurationUnit() |
protected String |
getRateUnit() |
void |
report()
Report the current values of all metrics in the registry.
|
abstract void |
report(SortedMap<String,Gauge> gauges,
SortedMap<String,Counter> counters,
SortedMap<String,Histogram> histograms,
SortedMap<String,Meter> meters,
SortedMap<String,Timer> timers)
Called periodically by the polling thread.
|
void |
start(long period,
TimeUnit unit)
Starts the reporter polling at the given period.
|
void |
stop()
Stops the reporter and shuts down its thread of execution.
|
protected ScheduledReporter(MetricRegistry registry, String name, MetricFilter filter, TimeUnit rateUnit, TimeUnit durationUnit)
ScheduledReporter
instance.registry
- the MetricRegistry
containing the metrics this
reporter will reportname
- the reporter's namefilter
- the filter for which metrics to reportrateUnit
- a unit of timedurationUnit
- a unit of timeprotected ScheduledReporter(MetricRegistry registry, String name, MetricFilter filter, TimeUnit rateUnit, TimeUnit durationUnit, ScheduledExecutorService executor)
ScheduledReporter
instance.registry
- the MetricRegistry
containing the metrics this
reporter will reportname
- the reporter's namefilter
- the filter for which metrics to reportexecutor
- the executor to use while scheduling reporting of metrics.public void start(long period, TimeUnit unit)
period
- the amount of time between pollsunit
- the unit for period
public void stop()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void report()
public abstract void report(SortedMap<String,Gauge> gauges, SortedMap<String,Counter> counters, SortedMap<String,Histogram> histograms, SortedMap<String,Meter> meters, SortedMap<String,Timer> timers)
gauges
- all of the gauges in the registrycounters
- all of the counters in the registryhistograms
- all of the histograms in the registrymeters
- all of the meters in the registrytimers
- all of the timers in the registryprotected String getRateUnit()
protected String getDurationUnit()
protected double convertDuration(double duration)
protected double convertRate(double rate)
Copyright © 2014. All Rights Reserved.