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 aCounterused to track a mutable number.Returns previously registered metric with the name if any.Return the MetricRegistryInfo object for this registry.Get or construct aHistogramused to measure a distribution of values.<T> Gauge<T>Register aGauge.Registers theMetricwith the given name if there does not exist one with the same name.voidregisterAll(MetricSet metricSet) Registers theMetrics in the given MetricSet.booleanRemoves the metric with the given name.booleanRemoves the metric with the given name only if it is registered to the provided metric.Get or construct aTimerused to measure durations and report rates.Methods inherited from interface org.apache.hadoop.hbase.metrics.MetricSet
getMetrics
-
Method Details
-
timer
Get or construct aTimerused to measure durations and report rates.- Parameters:
name- the name of the timer.- Returns:
- An instance of
Timer.
-
histogram
Get or construct aHistogramused to measure a distribution of values.- Parameters:
name- The name of the Histogram.- Returns:
- An instance of
Histogram.
-
meter
Get or construct aMeterused to measure durations and report distributions (a combination of aTimerand aHistogram.- Parameters:
name- The name of the Meter.- Returns:
- An instance of
Meter.
-
counter
Get or construct aCounterused 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 theMetricwith 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 theMetrics 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.
-