Package org.apache.hadoop.metrics

Examples of org.apache.hadoop.metrics.ContextFactory


    return new ThriftMetrics(
        ThriftServerRunner.DEFAULT_LISTEN_PORT, conf, Hbase.Iface.class);
  }

  private static void setupMetricsContext() throws Exception {
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute(ThriftMetrics.CONTEXT_NAME + ".class",
        NoEmitMetricsContext.class.getName());
    MetricsUtil.getContext(ThriftMetrics.CONTEXT_NAME)
               .createRecord(ThriftMetrics.CONTEXT_NAME).remove();
  }
View Full Code Here


    setupMetricsContext();
    return new ThriftMetrics(ThriftServerRunner.DEFAULT_LISTEN_PORT, conf, Hbase.Iface.class);
  }

  private static void setupMetricsContext() throws IOException {
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute(ThriftMetrics.CONTEXT_NAME + ".class",
        NoEmitMetricsContext.class.getName());
    MetricsUtil.getContext(ThriftMetrics.CONTEXT_NAME)
               .createRecord(ThriftMetrics.CONTEXT_NAME).remove();
  }
View Full Code Here

    return new ThriftMetrics(Integer.parseInt(ThriftServer.DEFAULT_LISTEN_PORT),
        conf, THBaseService.Iface.class);
  }
  private static void setupMetricsContext() throws IOException {
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute(ThriftMetrics.CONTEXT_NAME + ".class",
        NoEmitMetricsContext.class.getName());
    MetricsUtil.getContext(ThriftMetrics.CONTEXT_NAME)
               .createRecord(ThriftMetrics.CONTEXT_NAME).remove();
  }
View Full Code Here

  private static Log LOG = LogFactory.getLog(TestRpcMetrics.class);

  @BeforeClass
  public static void setupBeforeClass() throws Exception {
    // set custom metrics context
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute("rpc.class", MockMetricsContext.class.getName());
    // make sure metrics context is setup, otherwise updating won't start
    MetricsContext ctx = MetricsUtil.getContext("rpc");
    assertTrue("Wrong MetricContext implementation class",
        (ctx instanceof MockMetricsContext));
View Full Code Here

    }
    waitTaskTrackers();
  }

  private void setNoEmitMetricsContext() throws IOException {
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute(ClusterManagerMetrics.CONTEXT_NAME + ".class",
        NoEmitMetricsContext.class.getName());
  }
View Full Code Here

    setupMetricsContext();
    return new ThriftMetrics(ThriftServerRunner.DEFAULT_LISTEN_PORT, conf, Hbase.Iface.class);
  }

  private static void setupMetricsContext() throws IOException {
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute(ThriftMetrics.CONTEXT_NAME + ".class",
        NoEmitMetricsContext.class.getName());
    MetricsUtil.getContext(ThriftMetrics.CONTEXT_NAME)
               .createRecord(ThriftMetrics.CONTEXT_NAME).remove();
  }
View Full Code Here

  private static Log LOG = LogFactory.getLog(TestRpcMetrics.class);

  @BeforeClass
  public static void setupBeforeClass() throws Exception {
    // set custom metrics context
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute("rpc.class", MockMetricsContext.class.getName());
    // make sure metrics context is setup, otherwise updating won't start
    MetricsContext ctx = MetricsUtil.getContext("rpc");
    assertTrue("Wrong MetricContext implementation class",
        (ctx instanceof MockMetricsContext));
View Full Code Here

   * Set up a metrics context that doesn't emit anywhere but stores the data
   * so we can verify it. Also clears it of any data so that different test
   * cases don't pollute each other.
   */
  private void resetMetrics() throws IOException {
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute("fairscheduler.class",
        NoEmitMetricsContext.class.getName());
   
    MetricsUtil.getContext("fairscheduler").createRecord("jobs").remove();
    MetricsUtil.getContext("fairscheduler").createRecord("pools").remove();
  }
View Full Code Here

import org.apache.hadoop.metrics.jvm.JvmMetrics;
import org.lilyproject.runtime.conf.Conf;

public class Metrics {
    public Metrics(Conf conf) throws IOException {
        ContextFactory contextFactory = ContextFactory.getFactory();

        for (Conf attr : conf.getChild("hadoopMetricsAttributes").getChildren("attribute")) {
            contextFactory.setAttribute(attr.getAttribute("name"), attr.getAttribute(("value")));
        }

        boolean enableJvmMetrics = conf.getChild("enableJvmMetrics").getValueAsBoolean();
        if (enableJvmMetrics) {
            JvmMetrics.init("lily", "aLilySession");
View Full Code Here

   * Set up a metrics context that doesn't emit anywhere but stores the data
   * so we can verify it. Also clears it of any data so that different test
   * cases don't pollute each other.
   */
  private void resetMetrics() throws IOException {
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute("fairscheduler.class",
        NoEmitMetricsContext.class.getName());
   
    MetricsUtil.getContext("fairscheduler").createRecord("jobs").remove();
    MetricsUtil.getContext("fairscheduler").createRecord("pools").remove();
  }
View Full Code Here

TOP

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

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.