com.google.cloud.bigtable.metrics
Class DropwizardMetricRegistry
- java.lang.Object
-
- com.google.cloud.bigtable.metrics.DropwizardMetricRegistry
-
- All Implemented Interfaces:
- MetricRegistry
public class DropwizardMetricRegistry extends Object implements MetricRegistry
AMetricRegistry
that wraps a Dropwizard MetricsMetricRegistry
.
-
-
Field Summary
-
Fields inherited from interface com.google.cloud.bigtable.metrics.MetricRegistry
NULL_METRICS_REGISTRY
-
-
Constructor Summary
Constructors Constructor and Description DropwizardMetricRegistry()
DropwizardMetricRegistry(com.codahale.metrics.MetricRegistry registry)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description Counter
counter(String name)
Creates a namedCounter
that wraps a Dropwizard MetricsCounter
.static void
createSlf4jReporter(DropwizardMetricRegistry registry, org.slf4j.Logger logger, long period, TimeUnit unit)
Creates aDropwizardMetricRegistry
with anSlf4jReporter
.com.codahale.metrics.MetricRegistry
getRegistry()
Meter
meter(String name)
Creates a namedMeter
that wraps a Dropwizard MetricsMeter
.Timer
timer(String name)
Creates a namedTimer
that wraps a Dropwizard MetricsTimer
.
-
-
-
Constructor Detail
-
DropwizardMetricRegistry
public DropwizardMetricRegistry()
-
DropwizardMetricRegistry
public DropwizardMetricRegistry(com.codahale.metrics.MetricRegistry registry)
-
-
Method Detail
-
createSlf4jReporter
public static void createSlf4jReporter(DropwizardMetricRegistry registry, org.slf4j.Logger logger, long period, TimeUnit unit)
Creates aDropwizardMetricRegistry
with anSlf4jReporter
. Only non-zero metrics will be logged to theSlf4jReporter
.- Parameters:
registry
- The registry on which to add the reporter.logger
- TheLogger
to report toperiod
- the amount of time between pollsunit
- the unit forperiod
-
counter
public Counter counter(String name)
Creates a namedCounter
that wraps a Dropwizard MetricsCounter
.- Specified by:
counter
in interfaceMetricRegistry
- Parameters:
name
-- Returns:
- a
Counter
that wraps a Dropwizard MetricsCounter
-
timer
public Timer timer(String name)
Creates a namedTimer
that wraps a Dropwizard MetricsTimer
.- Specified by:
timer
in interfaceMetricRegistry
- Parameters:
name
-- Returns:
- a
Timer
that wraps a Dropwizard MetricsTimer
-
meter
public Meter meter(String name)
Creates a namedMeter
that wraps a Dropwizard MetricsMeter
.- Specified by:
meter
in interfaceMetricRegistry
- Parameters:
name
-- Returns:
- a
Meter
that wraps a Dropwizard MetricsMeter
-
getRegistry
public com.codahale.metrics.MetricRegistry getRegistry()
- Returns:
- the Dropwizard
MetricRegistry
-
-