@InterfaceAudience.Private public class BaseSourceImpl extends Object implements BaseSource, org.apache.hadoop.metrics2.MetricsSource
Modifier and Type | Class and Description |
---|---|
private static class |
BaseSourceImpl.DefaultMetricsSystemInitializer |
Modifier and Type | Field and Description |
---|---|
protected String |
metricsContext |
protected String |
metricsDescription |
protected String |
metricsJmxContext |
protected String |
metricsName |
protected DynamicMetricsRegistry |
metricsRegistry |
HBASE_METRICS_SYSTEM_NAME
Constructor and Description |
---|
BaseSourceImpl(String metricsName,
String metricsDescription,
String metricsContext,
String metricsJmxContext) |
Modifier and Type | Method and Description |
---|---|
void |
decGauge(String gaugeName,
long delta)
Decrease the value of a named gauge.
|
void |
getMetrics(org.apache.hadoop.metrics2.MetricsCollector metricsCollector,
boolean all) |
String |
getMetricsContext()
Get the metrics context.
|
String |
getMetricsDescription()
Get the description of what this source exposes.
|
String |
getMetricsJmxContext()
Get the name of the context in JMX that this source will be exposed through.
|
String |
getMetricsName()
Get the name of the metrics that are being exported by this source.
|
DynamicMetricsRegistry |
getMetricsRegistry() |
void |
incCounters(String key,
long delta)
Increment a named counter by some value.
|
void |
incGauge(String gaugeName,
long delta)
Add some amount to a gauge.
|
void |
init()
Clear out the metrics and re-prepare the source.
|
void |
removeMetric(String key)
Remove a named gauge.
|
void |
setGauge(String gaugeName,
long value)
Set a single gauge to a value.
|
void |
updateHistogram(String name,
long value)
Add some value to a histogram.
|
void |
updateQuantile(String name,
long value)
Add some value to a Quantile (An accurate histogram).
|
protected final DynamicMetricsRegistry metricsRegistry
protected final String metricsName
protected final String metricsDescription
protected final String metricsContext
protected final String metricsJmxContext
public void init()
BaseSource
init
in interface BaseSource
public void setGauge(String gaugeName, long value)
setGauge
in interface BaseSource
gaugeName
- gauge namevalue
- the new value of the gauge.public void incGauge(String gaugeName, long delta)
incGauge
in interface BaseSource
gaugeName
- The name of the gauge to increment.delta
- The amount to increment the gauge by.public void decGauge(String gaugeName, long delta)
decGauge
in interface BaseSource
gaugeName
- The name of the gauge.delta
- the ammount to subtract from a gauge value.public void incCounters(String key, long delta)
incCounters
in interface BaseSource
key
- the name of the counterdelta
- the ammount to incrementpublic void updateHistogram(String name, long value)
BaseSource
updateHistogram
in interface BaseSource
name
- the name of the histogramvalue
- the value to add to the histogrampublic void updateQuantile(String name, long value)
BaseSource
updateQuantile
in interface BaseSource
name
- the name of the quantilevalue
- the value to add to the quantilepublic void removeMetric(String key)
removeMetric
in interface BaseSource
key
- public void getMetrics(org.apache.hadoop.metrics2.MetricsCollector metricsCollector, boolean all)
getMetrics
in interface org.apache.hadoop.metrics2.MetricsSource
public DynamicMetricsRegistry getMetricsRegistry()
public String getMetricsContext()
BaseSource
getMetricsContext
in interface BaseSource
public String getMetricsDescription()
BaseSource
getMetricsDescription
in interface BaseSource
public String getMetricsJmxContext()
BaseSource
getMetricsJmxContext
in interface BaseSource
public String getMetricsName()
BaseSource
getMetricsName
in interface BaseSource
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.