Search in sources :

Example 36 with MetricsCollector

use of org.apache.hadoop.metrics2.MetricsCollector in project hbase by apache.

the class MetricsTableLatenciesImpl method getMetrics.

@Override
public void getMetrics(MetricsCollector metricsCollector, boolean all) {
    MetricsRecordBuilder mrb = metricsCollector.addRecord(metricsName);
    // source is registered in supers constructor, sometimes called before the whole initialization.
    metricsRegistry.snapshot(mrb, all);
    if (metricsAdapter != null) {
        // snapshot MetricRegistry as well
        metricsAdapter.snapshotAllMetrics(registry, mrb);
    }
}
Also used : MetricsRecordBuilder(org.apache.hadoop.metrics2.MetricsRecordBuilder)

Example 37 with MetricsCollector

use of org.apache.hadoop.metrics2.MetricsCollector in project hbase by apache.

the class MetricsIOSourceImpl method getMetrics.

@Override
public void getMetrics(MetricsCollector metricsCollector, boolean all) {
    MetricsRecordBuilder mrb = metricsCollector.addRecord(metricsName);
    // wrapper can be null because this function is called inside of init.
    if (wrapper != null) {
        mrb.addCounter(Interns.info(CHECKSUM_FAILURES_KEY, CHECKSUM_FAILURES_DESC), wrapper.getChecksumFailures());
    }
    metricsRegistry.snapshot(mrb, all);
}
Also used : MetricsRecordBuilder(org.apache.hadoop.metrics2.MetricsRecordBuilder)

Aggregations

MetricsRecordBuilder (org.apache.hadoop.metrics2.MetricsRecordBuilder)36 MetricsCollector (org.apache.hadoop.metrics2.MetricsCollector)6 Test (org.junit.Test)4 Configuration (org.apache.hadoop.conf.Configuration)2 IOException (java.io.IOException)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 MetricRegistryInfo (org.apache.hadoop.hbase.metrics.MetricRegistryInfo)1 Phase (org.apache.hadoop.hdfs.server.namenode.startupprogress.Phase)1 StartupProgressView (org.apache.hadoop.hdfs.server.namenode.startupprogress.StartupProgressView)1 TopConf (org.apache.hadoop.hdfs.server.namenode.top.TopConf)1 TopMetrics (org.apache.hadoop.hdfs.server.namenode.top.metrics.TopMetrics)1 MetricsSource (org.apache.hadoop.metrics2.MetricsSource)1 MetricsTag (org.apache.hadoop.metrics2.MetricsTag)1 JvmMetricsInfo (org.apache.hadoop.metrics2.source.JvmMetricsInfo)1 JvmPauseMonitor (org.apache.hadoop.util.JvmPauseMonitor)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1