Package org.apache.hadoop.metrics

Examples of org.apache.hadoop.metrics.MetricsContext


               .createRecord(ThriftMetrics.CONTEXT_NAME).remove();
  }

  private static void verifyMetrics(ThriftMetrics metrics, String name, int expectValue)
      throws Exception {
    MetricsContext context = MetricsUtil.getContext(
        ThriftMetrics.CONTEXT_NAME);
    metrics.doUpdates(context);
    OutputRecord record = context.getAllRecords().get(
        ThriftMetrics.CONTEXT_NAME).iterator().next();
    assertEquals(expectValue, record.getMetric(name).intValue());
  }
View Full Code Here


               .createRecord(ThriftMetrics.CONTEXT_NAME).remove();
  }

  private static void verifyMetrics(ThriftMetrics metrics, String name, int expectValue)
      throws Exception {
    MetricsContext context = MetricsUtil.getContext(
        ThriftMetrics.CONTEXT_NAME);
    metrics.doUpdates(context);
    OutputRecord record = context.getAllRecords().get(
        ThriftMetrics.CONTEXT_NAME).iterator().next();
    assertEquals(expectValue, record.getMetric(name).intValue());
  }
View Full Code Here

   */
  public final MetricsLongValue updatesBlockedSecondsHighWater = new MetricsLongValue(
      "updatesBlockedSecondsHighWater",registry);

  public RegionServerMetrics() {
    MetricsContext context = MetricsUtil.getContext("hbase");
    metricsRecord = MetricsUtil.createRecord(context, "regionserver");
    String name = Thread.currentThread().getName();
    metricsRecord.setTag("RegionServer", name);
    context.registerUpdater(this);
    // Add jvmmetrics.
    JvmMetrics.init("RegionServer", name);
    // Add Hbase Info metrics
    HBaseInfo.init();

View Full Code Here

   
  private class TaskTrackerMetrics {
    private MetricsRecord metricsRecord = null;
     
    TaskTrackerMetrics() {
      MetricsContext context = MetricsUtil.getContext("mapred");
      metricsRecord = MetricsUtil.createRecord(context, "tasktracker");
    }
View Full Code Here

        // Report back any failures, for diagnostic purposes
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        throwable.printStackTrace(new PrintStream(baos));
        umbilical.reportDiagnosticInfo(taskid, baos.toString());
      } finally {
        MetricsContext metricsContext = MetricsUtil.getContext("mapred");
        metricsContext.close();
        // Shutting down log4j of the child-vm...
        // This assumes that on return from Task.run()
        // there is no more logging done.
        LogManager.shutdown();
      }
View Full Code Here

    private int numReduceTasksCompleted = 0;
    private int numJobsSubmitted = 0;
    private int numJobsCompleted = 0;
     
    JobTrackerMetrics() {
      MetricsContext context = MetricsUtil.getContext("mapred");
      metricsRecord = MetricsUtil.createRecord(context, "jobtracker");
      context.registerUpdater(this);
    }
View Full Code Here

    namesystem = ns;
    initialize();
  }
   
  private void initialize() {
    MetricsContext metricsContext = MetricsUtil.getContext("dfs");
    directoryMetrics = MetricsUtil.createRecord(metricsContext, "FSDirectory");
  }
View Full Code Here

    private int numFilesOpened = 0;
    private int numFilesRenamed = 0;
    private int numFilesListed = 0;
     
    NameNodeMetrics() {
      MetricsContext metricsContext = MetricsUtil.getContext("dfs");
      metricsRecord = MetricsUtil.createRecord(metricsContext, "namenode");
      metricsContext.registerUpdater(this);
    }
View Full Code Here

    private int blocksRead = 0;
    private int blocksReplicated = 0;
    private int blocksRemoved = 0;
     
    DataNodeMetrics() {
      MetricsContext context = MetricsUtil.getContext("dfs");
      metricsRecord = MetricsUtil.createRecord(context, "datanode");
      context.registerUpdater(this);
    }
View Full Code Here

  private static void logMetrics(ThriftMetrics metrics) throws Exception {
    if (LOG.isDebugEnabled()) {
      return;
    }
    MetricsContext context = MetricsUtil.getContext(
        ThriftMetrics.CONTEXT_NAME);
    metrics.doUpdates(context);
    for (String key : context.getAllRecords().keySet()) {
      for (OutputRecord record : context.getAllRecords().get(key)) {
        for (String name : record.getMetricNames()) {
          LOG.debug("metrics:" + name + " value:" +
              record.getMetric(name).intValue());
        }
      }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.metrics.MetricsContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.