use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.
the class TestRollingFileSystemSinkWithSecureHdfs method testWithSecureHDFS.
/**
* Do a basic write test against an HDFS cluster with Kerberos enabled. We
* assume that if a basic write succeeds, more complex operations will also
* succeed.
*
* @throws Exception thrown if things break
*/
@Test
public void testWithSecureHDFS() throws Exception {
final String path = "hdfs://" + cluster.getNameNode().getHostAndPort() + "/tmp/test";
final MetricsSystem ms = initMetricsSystem(path, true, false, true);
assertMetricsContents(sink.doAs(new PrivilegedExceptionAction<String>() {
@Override
public String run() throws Exception {
return doWriteTest(ms, path, 1);
}
}));
}
use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.
the class TimelineDataManagerMetrics method create.
public static synchronized TimelineDataManagerMetrics create() {
if (instance == null) {
MetricsSystem ms = DefaultMetricsSystem.instance();
instance = ms.register(new TimelineDataManagerMetrics());
}
return instance;
}
use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.
the class ClusterMetrics method registerMetrics.
private static void registerMetrics() {
registry = new MetricsRegistry(RECORD_INFO);
registry.tag(RECORD_INFO, "ResourceManager");
MetricsSystem ms = DefaultMetricsSystem.instance();
if (ms != null) {
ms.register("ClusterMetrics", "Metrics for the Yarn Cluster", INSTANCE);
}
}
Aggregations