@InternalExtensionOnly public class DropwizardMetricRegistry extends Object implements MetricRegistry
MetricRegistry
that wraps a Dropwizard Metrics MetricRegistry
.NULL_METRICS_REGISTRY
Constructor and Description |
---|
DropwizardMetricRegistry() |
DropwizardMetricRegistry(com.codahale.metrics.MetricRegistry registry) |
Modifier and Type | Method and Description |
---|---|
Counter |
counter(String name)
Creates a named
Counter that wraps a Dropwizard Metrics Counter . |
static void |
createSlf4jReporter(DropwizardMetricRegistry registry,
org.slf4j.Logger logger,
long period,
TimeUnit unit)
Creates a
DropwizardMetricRegistry with an Slf4jReporter . |
com.codahale.metrics.MetricRegistry |
getRegistry() |
Meter |
meter(String name)
Creates a named
Meter that wraps a Dropwizard Metrics Meter . |
Timer |
timer(String name)
Creates a named
Timer that wraps a Dropwizard Metrics Timer . |
public DropwizardMetricRegistry()
public DropwizardMetricRegistry(com.codahale.metrics.MetricRegistry registry)
public static void createSlf4jReporter(DropwizardMetricRegistry registry, org.slf4j.Logger logger, long period, TimeUnit unit)
DropwizardMetricRegistry
with an Slf4jReporter
. Only non-zero metrics
will be logged to the Slf4jReporter
.registry
- The registry on which to add the reporter.logger
- The Logger
to report toperiod
- the amount of time between pollsunit
- the unit for period
public Counter counter(String name)
Counter
that wraps a Dropwizard Metrics Counter
.counter
in interface MetricRegistry
name
- Counter
that wraps a Dropwizard Metrics Counter
public Timer timer(String name)
Timer
that wraps a Dropwizard Metrics Timer
.timer
in interface MetricRegistry
name
- Timer
that wraps a Dropwizard Metrics Timer
public Meter meter(String name)
Meter
that wraps a Dropwizard Metrics Meter
.meter
in interface MetricRegistry
name
- Meter
that wraps a Dropwizard Metrics Meter
public com.codahale.metrics.MetricRegistry getRegistry()
MetricRegistry