Class MetricRegistryImpl
java.lang.Object
org.apache.hadoop.hbase.metrics.impl.MetricRegistryImpl
- All Implemented Interfaces:
Metric,MetricRegistry,MetricSet
Custom implementation of
MetricRegistry.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MetricRegistryInfoprivate final ConcurrentMap<String,Metric> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet or construct aCounterused to track a mutable number.protected Counterprotected Histogramprotected Meterprotected TimerReturns 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 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.
-
Field Details
-
info
-
metrics
-
-
Constructor Details
-
MetricRegistryImpl
-
-
Method Details
-
timer
Description copied from interface:MetricRegistryGet or construct aTimerused to measure durations and report rates.- Specified by:
timerin interfaceMetricRegistry- Parameters:
name- the name of the timer.- Returns:
- An instance of
Timer.
-
createTimer
-
histogram
Description copied from interface:MetricRegistryGet or construct aHistogramused to measure a distribution of values.- Specified by:
histogramin interfaceMetricRegistry- Parameters:
name- The name of the Histogram.- Returns:
- An instance of
Histogram.
-
createHistogram
-
meter
Description copied from interface:MetricRegistryGet or construct aMeterused to measure durations and report distributions (a combination of aTimerand aHistogram.- Specified by:
meterin interfaceMetricRegistry- Parameters:
name- The name of the Meter.- Returns:
- An instance of
Meter.
-
createMeter
-
counter
Description copied from interface:MetricRegistryGet or construct aCounterused to track a mutable number.- Specified by:
counterin interfaceMetricRegistry- Parameters:
name- The name of the Counter- Returns:
- An instance of
Counter.
-
createCounter
-
get
Description copied from interface:MetricRegistryReturns previously registered metric with the name if any.- Specified by:
getin interfaceMetricRegistry- Parameters:
name- the name of the metric- Returns:
- previously registered metric
-
register
Description copied from interface:MetricRegistryRegisters theMetricwith the given name if there does not exist one with the same name. Returns the newly registered or existing Metric.- Specified by:
registerin 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:MetricRegistryRegister aGauge. The Gauge will be invoked at a period defined by the implementation ofMetricRegistry.- Specified by:
registerin 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:MetricRegistryRegisters theMetrics in the given MetricSet.- Specified by:
registerAllin interfaceMetricRegistry- Parameters:
metricSet- set of metrics to register.
-
getMetrics
Description copied from interface:MetricSetA map of metric names to metrics.- Specified by:
getMetricsin interfaceMetricSet- Returns:
- the metrics
-
remove
Description copied from interface:MetricRegistryRemoves the metric with the given name.- Specified by:
removein interfaceMetricRegistry- Parameters:
name- the name of the metric- Returns:
- true if the metric is removed.
-
remove
Description copied from interface:MetricRegistryRemoves the metric with the given name only if it is registered to the provided metric.- Specified by:
removein 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:MetricRegistryReturn the MetricRegistryInfo object for this registry.- Specified by:
getMetricRegistryInfoin interfaceMetricRegistry- Returns:
- MetricRegistryInfo describing the registry.
-