Search in sources :

Example 6 with MetricsSystem

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));
}
Also used : MetricsSystem(org.apache.hadoop.metrics2.MetricsSystem) DefaultMetricsSystem(org.apache.hadoop.metrics2.lib.DefaultMetricsSystem)

Example 7 with MetricsSystem

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;
}
Also used : MetricsSystem(org.apache.hadoop.metrics2.MetricsSystem)

Example 8 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 9 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 10 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)

Aggregations

MetricsSystem (org.apache.hadoop.metrics2.MetricsSystem)36 DefaultMetricsSystem (org.apache.hadoop.metrics2.lib.DefaultMetricsSystem)19 Test (org.junit.Test)19 MyMetrics1 (org.apache.hadoop.metrics2.sink.RollingFileSystemSinkTestBase.MyMetrics1)5 MetricsSource (org.apache.hadoop.metrics2.MetricsSource)4 MetricsSystemImpl (org.apache.hadoop.metrics2.impl.MetricsSystemImpl)3 JvmMetrics (org.apache.hadoop.metrics2.source.JvmMetrics)3 JvmMetrics (org.apache.hadoop.hive.common.JvmMetrics)2 After (org.junit.After)2 URI (java.net.URI)1 PrivilegedExceptionAction (java.security.PrivilegedExceptionAction)1 Calendar (java.util.Calendar)1 Configuration (org.apache.hadoop.conf.Configuration)1 FileStatus (org.apache.hadoop.fs.FileStatus)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 Path (org.apache.hadoop.fs.Path)1 LlapMetricsSystem (org.apache.hadoop.hive.llap.metrics.LlapMetricsSystem)1 MetricsException (org.apache.hadoop.metrics2.MetricsException)1 MetricsRecordBuilder (org.apache.hadoop.metrics2.MetricsRecordBuilder)1 ConfigBuilder (org.apache.hadoop.metrics2.impl.ConfigBuilder)1