use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.
the class DataNodeVolumeMetrics method create.
public static DataNodeVolumeMetrics create(final Configuration conf, final String volumeName) {
MetricsSystem ms = DefaultMetricsSystem.instance();
String name = "DataNodeVolume-" + (volumeName.isEmpty() ? "UndefinedDataNodeVolume" + ThreadLocalRandom.current().nextInt() : volumeName.replace(':', '-'));
// Percentile measurement is off by default, by watching no intervals
int[] intervals = conf.getInts(DFSConfigKeys.DFS_METRICS_PERCENTILES_INTERVALS_KEY);
return ms.register(name, null, new DataNodeVolumeMetrics(ms, name, intervals));
}
use of org.apache.hadoop.metrics2.MetricsSystem in project hadoop by apache.
the class ReadWriteDiskValidatorMetrics method getMetric.
/**
* Get a metric by given directory name.
*
* @param dirName directory name
* @return the metric
*/
public static synchronized ReadWriteDiskValidatorMetrics getMetric(String dirName) {
MetricsSystem ms = DefaultMetricsSystem.instance();
ReadWriteDiskValidatorMetrics metrics = DIR_METRICS.get(dirName);
if (metrics == null) {
metrics = new ReadWriteDiskValidatorMetrics();
// Register with the MetricsSystems
if (ms != null) {
metrics = ms.register(sourceName(dirName), "Metrics for directory: " + dirName, metrics);
}
DIR_METRICS.put(dirName, metrics);
}
return metrics;
}
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();
}
}
Aggregations