Examples of MetricsContext


Examples of org.apache.hadoop.metrics.MetricsContext

  /**
   * Constructor used to register the metrics
   * @param id Name of the source this class is monitoring
   */
  public ReplicationSourceMetrics(String id) {
    MetricsContext context = MetricsUtil.getContext("hbase");
    String name = Thread.currentThread().getName();
    metricsRecord = MetricsUtil.createRecord(context, "replication");
    metricsRecord.setTag("RegionServer", name);
    context.registerUpdater(this);
    try {
      id = URLEncoder.encode(id, "UTF8");
    } catch (UnsupportedEncodingException e) {
      id = "CAN'T ENCODE UTF8";
    }
View Full Code Here

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

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

Examples of org.apache.hadoop.metrics.MetricsContext

   */
  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

Examples of org.apache.hadoop.metrics.MetricsContext

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

Examples of org.apache.hadoop.metrics.MetricsContext

        // 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

Examples of org.apache.hadoop.metrics.MetricsContext

    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

Examples of org.apache.hadoop.metrics.MetricsContext

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

Examples of org.apache.hadoop.metrics.MetricsContext

    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

Examples of org.apache.hadoop.metrics.MetricsContext

    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
TOP
Copyright © 2018 www.massapi.com. 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.