Search in sources :

Example 21 with MetricsSystem

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();
    }
}
Also used : MetricsSystem(org.apache.hadoop.metrics2.MetricsSystem) MetricsSystemImpl(org.apache.hadoop.metrics2.impl.MetricsSystemImpl) Test(org.junit.Test)

Example 22 with MetricsSystem

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));
}
Also used : JvmMetrics(org.apache.hadoop.metrics2.source.JvmMetrics) MetricsSystem(org.apache.hadoop.metrics2.MetricsSystem)

Example 23 with MetricsSystem

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;
}
Also used : MetricsSystem(org.apache.hadoop.metrics2.MetricsSystem) DefaultMetricsSystem(org.apache.hadoop.metrics2.lib.DefaultMetricsSystem)

Example 24 with MetricsSystem

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;
}
Also used : MetricsSource(org.apache.hadoop.metrics2.MetricsSource) MetricsSourceBuilder(org.apache.hadoop.metrics2.lib.MetricsSourceBuilder) MetricsSystem(org.apache.hadoop.metrics2.MetricsSystem) DefaultMetricsSystem(org.apache.hadoop.metrics2.lib.DefaultMetricsSystem)

Example 25 with MetricsSystem

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));
}
Also used : JvmMetrics(org.apache.hadoop.metrics2.source.JvmMetrics) MetricsSystem(org.apache.hadoop.metrics2.MetricsSystem) LlapMetricsSystem(org.apache.hadoop.hive.llap.metrics.LlapMetricsSystem)

Aggregations

MetricsSystem (org.apache.hadoop.metrics2.MetricsSystem)36 DefaultMetricsSystem (org.apache.hadoop.metrics2.lib.DefaultMetricsSystem)19 Test (org.junit.Test)19 MyMetrics1 (org.apache.hadoop.metrics2.sink.RollingFileSystemSinkTestBase.MyMetrics1)5 JvmMetrics (org.apache.hadoop.metrics2.source.JvmMetrics)5 MetricsSource (org.apache.hadoop.metrics2.MetricsSource)4 MetricsSystemImpl (org.apache.hadoop.metrics2.impl.MetricsSystemImpl)3 After (org.junit.After)2 URI (java.net.URI)1 PrivilegedExceptionAction (java.security.PrivilegedExceptionAction)1 Calendar (java.util.Calendar)1 Configuration (org.apache.hadoop.conf.Configuration)1 FileStatus (org.apache.hadoop.fs.FileStatus)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 Path (org.apache.hadoop.fs.Path)1 LlapMetricsSystem (org.apache.hadoop.hive.llap.metrics.LlapMetricsSystem)1 MetricsException (org.apache.hadoop.metrics2.MetricsException)1 MetricsRecordBuilder (org.apache.hadoop.metrics2.MetricsRecordBuilder)1 ConfigBuilder (org.apache.hadoop.metrics2.impl.ConfigBuilder)1 MetricsRegistry (org.apache.hadoop.metrics2.lib.MetricsRegistry)1