org.apache.hadoop.hbase.metrics
Interface BaseSource

All Known Subinterfaces:
MetricsHBaseServerSource, MetricsMasterSource, MetricsRegionAggregateSource, MetricsRegionServerSource, MetricsReplicationSource, MetricsRESTSource, MetricsThriftServerSource, MetricsWALSource
All Known Implementing Classes:
BaseSourceImpl, MetricsHBaseServerSourceImpl, MetricsMasterSourceImpl, MetricsRegionAggregateSourceImpl, MetricsRegionServerSourceImpl, MetricsReplicationSourceImpl, MetricsRESTSourceImpl, MetricsThriftServerSourceImpl, MetricsWALSourceImpl

public interface BaseSource

BaseSource for dynamic metrics to announce to Metrics2. In hbase-hadoop{1|2}-compat there is an implementation of this interface.


Field Summary
static String HBASE_METRICS_SYSTEM_NAME
           
 
Method Summary
 void decGauge(String gaugeName, long delta)
          Subtract some amount from a gauge.
 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.
 void incCounters(String counterName, long delta)
          Add some amount to a counter.
 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 metric and no longer announce it.
 void setGauge(String gaugeName, long value)
          Set a gauge to a specific 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).
 

Field Detail

HBASE_METRICS_SYSTEM_NAME

static final String HBASE_METRICS_SYSTEM_NAME
See Also:
Constant Field Values
Method Detail

init

void init()
Clear out the metrics and re-prepare the source.


setGauge

void setGauge(String gaugeName,
              long value)
Set a gauge to a specific value.

Parameters:
gaugeName - the name of the gauge
value - the value

incGauge

void incGauge(String gaugeName,
              long delta)
Add some amount to a gauge.

Parameters:
gaugeName - the name of the gauge
delta - the amount to change the gauge by.

decGauge

void decGauge(String gaugeName,
              long delta)
Subtract some amount from a gauge.

Parameters:
gaugeName - the name of the gauge
delta - the amount to change the gauge by.

removeMetric

void removeMetric(String key)
Remove a metric and no longer announce it.

Parameters:
key - Name of the gauge to remove.

incCounters

void incCounters(String counterName,
                 long delta)
Add some amount to a counter.

Parameters:
counterName - the name of the counter
delta - the amount to change the counter by.

updateHistogram

void updateHistogram(String name,
                     long value)
Add some value to a histogram.

Parameters:
name - the name of the histogram
value - the value to add to the histogram

updateQuantile

void updateQuantile(String name,
                    long value)
Add some value to a Quantile (An accurate histogram).

Parameters:
name - the name of the quantile
value - the value to add to the quantile

getMetricsContext

String getMetricsContext()
Get the metrics context. For hadoop metrics2 system this is usually an all lowercased string. eg. regionserver, master, thriftserver

Returns:
The string context used to register this source to hadoop's metrics2 system.

getMetricsDescription

String getMetricsDescription()
Get the description of what this source exposes.


getMetricsJmxContext

String getMetricsJmxContext()
Get the name of the context in JMX that this source will be exposed through. This is in ObjectName format. With the default context being Hadoop -> HBase


getMetricsName

String getMetricsName()
Get the name of the metrics that are being exported by this source. Eg. IPC, GC, WAL



Copyright © 2013 The Apache Software Foundation. All Rights Reserved.