Class HBaseMetrics2HadoopMetricsAdapter
java.lang.Object
org.apache.hadoop.hbase.metrics.impl.HBaseMetrics2HadoopMetricsAdapter
This is the adapter from "HBase Metrics Framework", implemented in hbase-metrics-api and
hbase-metrics modules to the Hadoop Metrics2 framework. This adapter is not a metric source, but
a helper to be able to collect all of the Metric's in the MetricRegistry using the
MetricsCollector and MetricsRecordBuilder. Some of the code is forked from
https://github.com/joshelser/dropwizard-hadoop-metrics2.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
private static final org.slf4j.Logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
addCounter
(String name, Counter counter, org.apache.hadoop.metrics2.MetricsRecordBuilder builder) private void
private void
addHistogram
(String name, Histogram histogram, org.apache.hadoop.metrics2.MetricsRecordBuilder builder) Add Histogram value-distribution data to a Hadoop-Metrics2 record building.private void
Add Dropwizard-Metrics rate information to a Hadoop-Metrics2 record builder, converting the rates to the appropriate unit.private void
void
snapshotAllMetrics
(MetricRegistry metricRegistry, org.apache.hadoop.metrics2.MetricsCollector collector) Iterates over the MetricRegistry and adds them to thecollector
.void
snapshotAllMetrics
(MetricRegistry metricRegistry, org.apache.hadoop.metrics2.MetricsRecordBuilder builder) Iterates over the MetricRegistry and adds them to thebuilder
.
-
Field Details
-
LOG
-
EMPTY_STRING
- See Also:
-
-
Constructor Details
-
HBaseMetrics2HadoopMetricsAdapter
public HBaseMetrics2HadoopMetricsAdapter()
-
-
Method Details
-
snapshotAllMetrics
public void snapshotAllMetrics(MetricRegistry metricRegistry, org.apache.hadoop.metrics2.MetricsCollector collector) Iterates over the MetricRegistry and adds them to thecollector
.- Parameters:
collector
- A metrics collector
-
snapshotAllMetrics
public void snapshotAllMetrics(MetricRegistry metricRegistry, org.apache.hadoop.metrics2.MetricsRecordBuilder builder) Iterates over the MetricRegistry and adds them to thebuilder
.- Parameters:
builder
- A record builder
-
addGauge
-
addCounter
private void addCounter(String name, Counter counter, org.apache.hadoop.metrics2.MetricsRecordBuilder builder) -
addHistogram
private void addHistogram(String name, Histogram histogram, org.apache.hadoop.metrics2.MetricsRecordBuilder builder) Add Histogram value-distribution data to a Hadoop-Metrics2 record building.- Parameters:
name
- A base name for this record.histogram
- A histogram to measure distribution of values.builder
- A Hadoop-Metrics2 record builder.
-
addMeter
private void addMeter(String name, Meter meter, org.apache.hadoop.metrics2.MetricsRecordBuilder builder) Add Dropwizard-Metrics rate information to a Hadoop-Metrics2 record builder, converting the rates to the appropriate unit.- Parameters:
builder
- A Hadoop-Metrics2 record builder.name
- A base name for this record.
-
addTimer
-