use of org.apache.hadoop.metrics2.MetricsCollector in project hive by apache.
the class LlapTaskSchedulerMetrics method getMetrics.
@Override
public void getMetrics(MetricsCollector collector, boolean b) {
MetricsRecordBuilder rb = collector.addRecord(SchedulerMetrics).setContext("scheduler").tag(ProcessName, "DAGAppMaster").tag(SessionId, sessionId);
getTaskSchedulerStats(rb);
}
use of org.apache.hadoop.metrics2.MetricsCollector in project hive by apache.
the class LlapDaemonJvmMetrics method getMetrics.
@Override
public void getMetrics(MetricsCollector collector, boolean b) {
MetricsRecordBuilder rb = collector.addRecord(LlapDaemonJVMMetrics).setContext("jvm").tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME).tag(SessionId, sessionId);
getJvmMetrics(rb);
}
use of org.apache.hadoop.metrics2.MetricsCollector in project hive by apache.
the class LlapDaemonCacheMetrics method getMetrics.
@Override
public void getMetrics(MetricsCollector collector, boolean b) {
MetricsRecordBuilder rb = collector.addRecord(CacheMetrics).setContext("cache").tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME).tag(SessionId, sessionId);
getCacheStats(rb);
}
use of org.apache.hadoop.metrics2.MetricsCollector in project hadoop by apache.
the class TestJvmMetrics method testPresence.
@Test
public void testPresence() {
pauseMonitor = new JvmPauseMonitor();
pauseMonitor.init(new Configuration());
pauseMonitor.start();
JvmMetrics jvmMetrics = new JvmMetrics("test", "test");
jvmMetrics.setPauseMonitor(pauseMonitor);
MetricsRecordBuilder rb = getMetrics(jvmMetrics);
MetricsCollector mc = rb.parent();
verify(mc).addRecord(JvmMetrics);
verify(rb).tag(ProcessName, "test");
verify(rb).tag(SessionId, "test");
for (JvmMetricsInfo info : JvmMetricsInfo.values()) {
if (info.name().startsWith("Mem"))
verify(rb).addGauge(eq(info), anyFloat());
else if (info.name().startsWith("Gc"))
verify(rb).addCounter(eq(info), anyLong());
else if (info.name().startsWith("Threads"))
verify(rb).addGauge(eq(info), anyInt());
else if (info.name().startsWith("Log"))
verify(rb).addCounter(eq(info), anyLong());
}
}
use of org.apache.hadoop.metrics2.MetricsCollector in project hadoop by apache.
the class MetricsAsserts method getMetrics.
/**
* Call getMetrics on source and get a record builder mock to verify
* @param source the metrics source
* @param all if true, return all metrics even if not changed
* @return the record builder mock to verifyÏ
*/
public static MetricsRecordBuilder getMetrics(MetricsSource source, boolean all) {
MetricsRecordBuilder rb = mockMetricsRecordBuilder();
MetricsCollector mc = rb.parent();
source.getMetrics(mc, all);
return rb;
}
Aggregations