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;
}
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;
}
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();
}
}
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);
}
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);
}
Aggregations