public class MetricsFactory extends Object
reporters
with a
default frequency
.
Configuration Parameters:
Name | Default | Description |
frequency | 1 minute | The frequency to report metrics. Overridable per-reporter. |
reporters | No reporters. | A list of reporters to report metrics. |
reportOnStop | false |
To report metrics one last time when stopping Dropwizard. |
Constructor and Description |
---|
MetricsFactory() |
Modifier and Type | Method and Description |
---|---|
void |
configure(LifecycleEnvironment environment,
com.codahale.metrics.MetricRegistry registry)
Configures the given lifecycle with the
reporters configured for the given registry. |
Duration |
getFrequency() |
List<ReporterFactory> |
getReporters() |
boolean |
isReportOnStop() |
void |
setFrequency(Duration frequency) |
void |
setReporters(List<ReporterFactory> reporters) |
void |
setReportOnStop(boolean reportOnStop) |
String |
toString() |
public List<ReporterFactory> getReporters()
public void setReporters(List<ReporterFactory> reporters)
public Duration getFrequency()
public void setFrequency(Duration frequency)
public boolean isReportOnStop()
public void setReportOnStop(boolean reportOnStop)
public void configure(LifecycleEnvironment environment, com.codahale.metrics.MetricRegistry registry)
reporters
configured for the given registry.
The reporters are tied in to the given lifecycle, such that their frequency
for reporting metrics begins when the lifecycle starts
, and stops when the lifecycle
stops
.environment
- the lifecycle to manage the reporters.registry
- the metric registry to report metrics from.Copyright © 2011. All rights reserved.