Class HBaseMetrics2HadoopMetricsAdapter

java.lang.Object
org.apache.hadoop.hbase.metrics.impl.HBaseMetrics2HadoopMetricsAdapter

@Private public class HBaseMetrics2HadoopMetricsAdapter extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    private static final String
     
    private static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    addCounter(String name, Counter counter, org.apache.hadoop.metrics2.MetricsRecordBuilder builder)
     
    private void
    addGauge(String name, Gauge<?> gauge, org.apache.hadoop.metrics2.MetricsRecordBuilder builder)
     
    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
    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.
    private void
    addTimer(String name, Timer timer, org.apache.hadoop.metrics2.MetricsRecordBuilder builder)
     
    void
    snapshotAllMetrics(MetricRegistry metricRegistry, org.apache.hadoop.metrics2.MetricsCollector collector)
    Iterates over the MetricRegistry and adds them to the collector.
    void
    snapshotAllMetrics(MetricRegistry metricRegistry, org.apache.hadoop.metrics2.MetricsRecordBuilder builder)
    Iterates over the MetricRegistry and adds them to the builder.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • snapshotAllMetrics

      public void snapshotAllMetrics(MetricRegistry metricRegistry, org.apache.hadoop.metrics2.MetricsCollector collector)
      Iterates over the MetricRegistry and adds them to the collector.
      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 the builder.
      Parameters:
      builder - A record builder
    • addGauge

      private void addGauge(String name, Gauge<?> gauge, org.apache.hadoop.metrics2.MetricsRecordBuilder builder)
    • 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

      private void addTimer(String name, Timer timer, org.apache.hadoop.metrics2.MetricsRecordBuilder builder)