Class MetricRegistryImpl
java.lang.Object
org.apache.hadoop.hbase.metrics.impl.MetricRegistryImpl
- All Implemented Interfaces:
Metric
,MetricRegistry
,MetricSet
Custom implementation of
MetricRegistry
.-
Field Summary
Modifier and TypeFieldDescriptionprivate final MetricRegistryInfo
private final ConcurrentMap<String,
Metric> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet or construct aCounter
used to track a mutable number.protected Counter
protected Histogram
protected Meter
protected Timer
Returns previously registered metric with the name if any.Return the MetricRegistryInfo object for this registry.A map of metric names to metrics.Get or construct aHistogram
used to measure a distribution of values.<T> Gauge<T>
Register aGauge
.Registers theMetric
with the given name if there does not exist one with the same name.void
registerAll
(MetricSet metricSet) Registers theMetric
s in the given MetricSet.boolean
Removes the metric with the given name.boolean
Removes the metric with the given name only if it is registered to the provided metric.Get or construct aTimer
used to measure durations and report rates.
-
Field Details
-
info
-
metrics
-
-
Constructor Details
-
MetricRegistryImpl
-
-
Method Details
-
timer
Description copied from interface:MetricRegistry
Get or construct aTimer
used to measure durations and report rates.- Specified by:
timer
in interfaceMetricRegistry
- Parameters:
name
- the name of the timer.- Returns:
- An instance of
Timer
.
-
createTimer
-
histogram
Description copied from interface:MetricRegistry
Get or construct aHistogram
used to measure a distribution of values.- Specified by:
histogram
in interfaceMetricRegistry
- Parameters:
name
- The name of the Histogram.- Returns:
- An instance of
Histogram
.
-
createHistogram
-
meter
Description copied from interface:MetricRegistry
Get or construct aMeter
used to measure durations and report distributions (a combination of aTimer
and aHistogram
.- Specified by:
meter
in interfaceMetricRegistry
- Parameters:
name
- The name of the Meter.- Returns:
- An instance of
Meter
.
-
createMeter
-
counter
Description copied from interface:MetricRegistry
Get or construct aCounter
used to track a mutable number.- Specified by:
counter
in interfaceMetricRegistry
- Parameters:
name
- The name of the Counter- Returns:
- An instance of
Counter
.
-
createCounter
-
get
Description copied from interface:MetricRegistry
Returns previously registered metric with the name if any.- Specified by:
get
in interfaceMetricRegistry
- Parameters:
name
- the name of the metric- Returns:
- previously registered metric
-
register
Description copied from interface:MetricRegistry
Registers theMetric
with the given name if there does not exist one with the same name. Returns the newly registered or existing Metric.- Specified by:
register
in interfaceMetricRegistry
- Parameters:
name
- The name of the Metric.metric
- the metric to register- Returns:
- the registered metric, or the existing metrid
-
register
Description copied from interface:MetricRegistry
Register aGauge
. The Gauge will be invoked at a period defined by the implementation ofMetricRegistry
.- Specified by:
register
in interfaceMetricRegistry
- Parameters:
name
- The name of the Gauge.gauge
- A callback to compute the current value.- Returns:
- the registered gauge, or the existing gauge
-
registerAll
Description copied from interface:MetricRegistry
Registers theMetric
s in the given MetricSet.- Specified by:
registerAll
in interfaceMetricRegistry
- Parameters:
metricSet
- set of metrics to register.
-
getMetrics
Description copied from interface:MetricSet
A map of metric names to metrics.- Specified by:
getMetrics
in interfaceMetricSet
- Returns:
- the metrics
-
remove
Description copied from interface:MetricRegistry
Removes the metric with the given name.- Specified by:
remove
in interfaceMetricRegistry
- Parameters:
name
- the name of the metric- Returns:
- true if the metric is removed.
-
remove
Description copied from interface:MetricRegistry
Removes the metric with the given name only if it is registered to the provided metric.- Specified by:
remove
in interfaceMetricRegistry
- Parameters:
name
- the name of the metricmetric
- the metric expected to be registered to the given name- Returns:
- true if the metric is removed.
-
getMetricRegistryInfo
Description copied from interface:MetricRegistry
Return the MetricRegistryInfo object for this registry.- Specified by:
getMetricRegistryInfo
in interfaceMetricRegistry
- Returns:
- MetricRegistryInfo describing the registry.
-