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);
}
use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.
the class CSQueueMetrics method forQueue.
public static synchronized CSQueueMetrics forQueue(String queueName, Queue parent, boolean enableUserMetrics, Configuration conf) {
MetricsSystem ms = DefaultMetricsSystem.instance();
QueueMetrics metrics = queueMetrics.get(queueName);
if (metrics == null) {
metrics = new CSQueueMetrics(ms, queueName, parent, enableUserMetrics, conf).tag(QUEUE_INFO, queueName);
// Register with the MetricsSystems
if (ms != null) {
metrics = ms.register(sourceName(queueName).toString(), "Metrics for queue: " + queueName, metrics);
}
queueMetrics.put(queueName, metrics);
}
return (CSQueueMetrics) metrics;
}
use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.
the class TestResourceTrackerService method tearDown.
@After
public void tearDown() {
if (hostFile != null && hostFile.exists()) {
hostFile.delete();
}
ClusterMetrics.destroy();
if (rm != null) {
rm.stop();
}
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 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;
}
Aggregations