Package org.apache.hadoop.hbase.metrics
Interface MetricRegistry
- All Known Implementing Classes:
MetricRegistryImpl
General purpose factory for creating various metrics.
-
Method Summary
Modifier and TypeMethodDescriptionGet or construct aCounter
used to track a mutable number.Returns previously registered metric with the name if any.Return the MetricRegistryInfo object for this registry.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.Methods inherited from interface org.apache.hadoop.hbase.metrics.MetricSet
getMetrics
-
Method Details
-
timer
Get or construct aTimer
used to measure durations and report rates.- Parameters:
name
- the name of the timer.- Returns:
- An instance of
Timer
.
-
histogram
Get or construct aHistogram
used to measure a distribution of values.- Parameters:
name
- The name of the Histogram.- Returns:
- An instance of
Histogram
.
-
meter
Get or construct aMeter
used to measure durations and report distributions (a combination of aTimer
and aHistogram
.- Parameters:
name
- The name of the Meter.- Returns:
- An instance of
Meter
.
-
counter
Get or construct aCounter
used to track a mutable number.- Parameters:
name
- The name of the Counter- Returns:
- An instance of
Counter
.
-
register
Register aGauge
. The Gauge will be invoked at a period defined by the implementation ofMetricRegistry
.- Parameters:
name
- The name of the Gauge.gauge
- A callback to compute the current value.- Returns:
- the registered gauge, or the existing gauge
-
register
Registers theMetric
with the given name if there does not exist one with the same name. Returns the newly registered or existing Metric.- Parameters:
name
- The name of the Metric.metric
- the metric to register- Returns:
- the registered metric, or the existing metrid
-
registerAll
Registers theMetric
s in the given MetricSet.- Parameters:
metricSet
- set of metrics to register.
-
get
Returns previously registered metric with the name if any.- Parameters:
name
- the name of the metric- Returns:
- previously registered metric
-
remove
Removes the metric with the given name.- Parameters:
name
- the name of the metric- Returns:
- true if the metric is removed.
-
remove
Removes the metric with the given name only if it is registered to the provided metric.- 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
Return the MetricRegistryInfo object for this registry.- Returns:
- MetricRegistryInfo describing the registry.
-