Search in sources :

Example 1 with MetricsSystem

use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.

the class ClientSCMMetrics method create.

static ClientSCMMetrics create() {
    MetricsSystem ms = DefaultMetricsSystem.instance();
    ClientSCMMetrics metrics = new ClientSCMMetrics();
    ms.register("clientRequests", null, metrics);
    return metrics;
}
Also used : MetricsSystem(org.apache.hadoop.metrics2.MetricsSystem) DefaultMetricsSystem(org.apache.hadoop.metrics2.lib.DefaultMetricsSystem)

Example 2 with MetricsSystem

use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.

the class EntityGroupFSTimelineStoreMetrics method create.

public static synchronized EntityGroupFSTimelineStoreMetrics create() {
    if (instance == null) {
        MetricsSystem ms = DefaultMetricsSystem.instance();
        instance = ms.register(new EntityGroupFSTimelineStoreMetrics());
    }
    return instance;
}
Also used : MetricsSystem(org.apache.hadoop.metrics2.MetricsSystem) DefaultMetricsSystem(org.apache.hadoop.metrics2.lib.DefaultMetricsSystem)

Example 3 with MetricsSystem

use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.

the class TestClusterMetrics method tearDown.

@After
public void tearDown() {
    ClusterMetrics.destroy();
    MetricsSystem ms = DefaultMetricsSystem.instance();
    if (ms.getSource("ClusterMetrics") != null) {
        DefaultMetricsSystem.shutdown();
    }
}
Also used : MetricsSystem(org.apache.hadoop.metrics2.MetricsSystem) DefaultMetricsSystem(org.apache.hadoop.metrics2.lib.DefaultMetricsSystem) After(org.junit.After)

Example 4 with MetricsSystem

use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.

the class TestShuffleHandler method checkShuffleMetrics.

static void checkShuffleMetrics(MetricsSystem ms, long bytes, int failed, int succeeded, int connections) {
    MetricsSource source = ms.getSource("ShuffleMetrics");
    MetricsRecordBuilder rb = getMetrics(source);
    assertCounter("ShuffleOutputBytes", bytes, rb);
    assertCounter("ShuffleOutputsFailed", failed, rb);
    assertCounter("ShuffleOutputsOK", succeeded, rb);
    assertGauge("ShuffleConnections", connections, rb);
}
Also used : MetricsSource(org.apache.hadoop.metrics2.MetricsSource) MetricsRecordBuilder(org.apache.hadoop.metrics2.MetricsRecordBuilder)

Example 5 with MetricsSystem

use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.

the class TestShuffleHandler method testShuffleMetrics.

/**
   * Validate shuffle connection and input/output metrics.
   *
   * @throws Exception exception
   */
@Test(timeout = 10000)
public void testShuffleMetrics() throws Exception {
    MetricsSystem ms = new MetricsSystemImpl();
    ShuffleHandler sh = new ShuffleHandler(ms);
    ChannelFuture cf = make(stub(ChannelFuture.class).returning(true, false).from.isSuccess());
    sh.metrics.shuffleConnections.incr();
    sh.metrics.shuffleOutputBytes.incr(1 * MiB);
    sh.metrics.shuffleConnections.incr();
    sh.metrics.shuffleOutputBytes.incr(2 * MiB);
    checkShuffleMetrics(ms, 3 * MiB, 0, 0, 2);
    sh.metrics.operationComplete(cf);
    sh.metrics.operationComplete(cf);
    checkShuffleMetrics(ms, 3 * MiB, 1, 1, 0);
}
Also used : ChannelFuture(org.jboss.netty.channel.ChannelFuture) MetricsSystem(org.apache.hadoop.metrics2.MetricsSystem) MetricsSystemImpl(org.apache.hadoop.metrics2.impl.MetricsSystemImpl) Test(org.junit.Test)

Aggregations

MetricsSystem (org.apache.hadoop.metrics2.MetricsSystem)40 Test (org.junit.Test)21 DefaultMetricsSystem (org.apache.hadoop.metrics2.lib.DefaultMetricsSystem)20 MyMetrics1 (org.apache.hadoop.metrics2.sink.RollingFileSystemSinkTestBase.MyMetrics1)5 MetricsSource (org.apache.hadoop.metrics2.MetricsSource)4 MetricsSystemImpl (org.apache.hadoop.metrics2.impl.MetricsSystemImpl)4 JvmMetrics (org.apache.hadoop.hive.common.JvmMetrics)3 JvmMetrics (org.apache.hadoop.metrics2.source.JvmMetrics)3 After (org.junit.After)3 Path (org.apache.hadoop.fs.Path)2 LlapMetricsSystem (org.apache.hadoop.hive.llap.metrics.LlapMetricsSystem)2 ChannelFuture (org.jboss.netty.channel.ChannelFuture)2 URI (java.net.URI)1 PrivilegedExceptionAction (java.security.PrivilegedExceptionAction)1 Calendar (java.util.Calendar)1 Master (org.apache.accumulo.master.Master)1 VolumeManager (org.apache.accumulo.server.fs.VolumeManager)1 ReplicationUtil (org.apache.accumulo.server.replication.ReplicationUtil)1 Configuration (org.apache.hadoop.conf.Configuration)1 FileStatus (org.apache.hadoop.fs.FileStatus)1