use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.
the class TestQueueMetrics method testMetricsCache.
@Test
public void testMetricsCache() {
MetricsSystem ms = new MetricsSystemImpl("cache");
ms.start();
try {
String p1 = "root1";
String leafQueueName = "root1.leaf";
QueueMetrics p1Metrics = QueueMetrics.forQueue(ms, p1, null, true, conf);
Queue parentQueue1 = make(stub(Queue.class).returning(p1Metrics).from.getMetrics());
QueueMetrics metrics = QueueMetrics.forQueue(ms, leafQueueName, parentQueue1, true, conf);
Assert.assertNotNull("QueueMetrics for A shoudn't be null", metrics);
// Re-register to check for cache hit, shouldn't blow up metrics-system...
// also, verify parent-metrics
QueueMetrics alterMetrics = QueueMetrics.forQueue(ms, leafQueueName, parentQueue1, true, conf);
Assert.assertNotNull("QueueMetrics for alterMetrics shoudn't be null", alterMetrics);
} finally {
ms.shutdown();
}
}
use of org.apache.hadoop.metrics2.MetricsSystem in project hive by apache.
the class LlapDaemonExecutorMetrics method create.
public static LlapDaemonExecutorMetrics create(String displayName, String sessionId, int numExecutors, final int[] intervals) {
MetricsSystem ms = LlapMetricsSystem.instance();
JvmMetrics jm = JvmMetrics.create(MetricsUtils.METRICS_PROCESS_NAME, sessionId, ms);
return ms.register(displayName, "LlapDaemon Executor Metrics", new LlapDaemonExecutorMetrics(displayName, jm, sessionId, numExecutors, intervals));
}
use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.
the class SharedCacheUploaderMetrics method create.
static SharedCacheUploaderMetrics create() {
MetricsSystem ms = DefaultMetricsSystem.instance();
SharedCacheUploaderMetrics metrics = new SharedCacheUploaderMetrics();
ms.register("SharedCacheUploaderRequests", null, metrics);
return metrics;
}
use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.
the class CleanerMetrics method create.
static CleanerMetrics create() {
MetricsSystem ms = DefaultMetricsSystem.instance();
CleanerMetrics metricObject = new CleanerMetrics();
MetricsSourceBuilder sb = MetricsAnnotations.newSourceBuilder(metricObject);
final MetricsSource s = sb.build();
ms.register("cleaner", "The cleaner service of truly shared cache", s);
metricObject.metricSource = s;
return metricObject;
}
use of org.apache.hadoop.metrics2.MetricsSystem in project hive by apache.
the class LlapTaskSchedulerMetrics method create.
public static LlapTaskSchedulerMetrics create(String displayName, String sessionId) {
MetricsSystem ms = LlapMetricsSystem.instance();
JvmMetrics jm = JvmMetrics.create(MetricsUtils.METRICS_PROCESS_NAME, sessionId, ms);
return ms.register(displayName, "Llap Task Scheduler Metrics", new LlapTaskSchedulerMetrics(displayName, jm, sessionId));
}
Aggregations