Package org.apache.hadoop.metrics2.impl

Examples of org.apache.hadoop.metrics2.impl.MetricsSystemImpl


    checkApps(parentUserSource, 1, 0, 0, 1, 0, 0);
  }
 
  @Test
  public void testMetricsCache() {
    MetricsSystem ms = new MetricsSystemImpl("cache");
    ms.start();
   
    try {
      String p1 = "root1";
      String leafQueueName = "root1.leaf";

      QueueMetrics p1Metrics =
          QueueMetrics.forQueue(ms, p1, null, true, conf);
      Queue parentQueue1 = make(stub(Queue.class).returning(p1Metrics).
          from.getMetrics());
      QueueMetrics metrics =
          QueueMetrics.forQueue(ms, leafQueueName, parentQueue1, true, conf);

      Assert.assertNotNull("QueueMetrics for A shoudn't be null", metrics);

      // Re-register to check for cache hit, shouldn't blow up metrics-system...
      // also, verify parent-metrics
      QueueMetrics alterMetrics =
          QueueMetrics.forQueue(ms, leafQueueName, parentQueue1, true, conf);

      Assert.assertNotNull("QueueMetrics for alterMetrics shoudn't be null",
          alterMetrics);
    } finally {
      ms.shutdown();
    }
  }
View Full Code Here


        ShuffleHandler.serializeMetaData(8080)));
  }

  @Test(timeout = 10000)
  public void testShuffleMetrics() throws Exception {
    MetricsSystem ms = new MetricsSystemImpl();
    ShuffleHandler sh = new ShuffleHandler(ms);
    ChannelFuture cf = make(stub(ChannelFuture.class).
        returning(true, false).from.isSuccess());

    sh.metrics.shuffleConnections.incr();
View Full Code Here

        ShuffleHandler.serializeMetaData(8080)));
  }

  @Test (timeout = 10000)
  public void testShuffleMetrics() throws Exception {
    MetricsSystem ms = new MetricsSystemImpl();
    ShuffleHandler sh = new ShuffleHandler(ms);
    ChannelFuture cf = make(stub(ChannelFuture.class).
        returning(true, false).from.isSuccess());

    sh.metrics.shuffleConnections.incr();
View Full Code Here

  private MetricsSystem ms;

  @Before
  public void setUp() {
    ms = new MetricsSystemImpl();
    QueueMetrics.clearQueueMetrics();
  }
View Full Code Here

    checkApps(parentUserSource, 1, 0, 0, 1, 0, 0, true);
  }
 
  @Test
  public void testMetricsCache() {
    MetricsSystem ms = new MetricsSystemImpl("cache");
    ms.start();
   
    try {
      String p1 = "root1";
      String leafQueueName = "root1.leaf";

      QueueMetrics p1Metrics =
          QueueMetrics.forQueue(ms, p1, null, true, conf);
      Queue parentQueue1 = make(stub(Queue.class).returning(p1Metrics).
          from.getMetrics());
      QueueMetrics metrics =
          QueueMetrics.forQueue(ms, leafQueueName, parentQueue1, true, conf);

      Assert.assertNotNull("QueueMetrics for A shoudn't be null", metrics);

      // Re-register to check for cache hit, shouldn't blow up metrics-system...
      // also, verify parent-metrics
      QueueMetrics alterMetrics =
          QueueMetrics.forQueue(ms, leafQueueName, parentQueue1, true, conf);

      Assert.assertNotNull("QueueMetrics for alterMetrics shoudn't be null",
          alterMetrics);
    } finally {
      ms.shutdown();
    }
  }
View Full Code Here

    assertEquals(8080, ShuffleHandler.deserializeMetaData(
        ShuffleHandler.serializeMetaData(8080)));
  }

  @Test public void testShuffleMetrics() throws Exception {
    MetricsSystem ms = new MetricsSystemImpl();
    ShuffleHandler sh = new ShuffleHandler(ms);
    ChannelFuture cf = make(stub(ChannelFuture.class).
        returning(true, false).from.isSuccess());

    sh.metrics.shuffleConnections.incr();
View Full Code Here

   *
   * @throws Exception exception
   */
  @Test (timeout = 10000)
  public void testShuffleMetrics() throws Exception {
    MetricsSystem ms = new MetricsSystemImpl();
    ShuffleHandler sh = new ShuffleHandler(ms);
    ChannelFuture cf = make(stub(ChannelFuture.class).
        returning(true, false).from.isSuccess());

    sh.metrics.shuffleConnections.incr();
View Full Code Here

   * @return a metric object
   */
  public MetricMutableGaugeLong getLongGauge(String gaugeName,
      long potentialStartingValue) {
    // Try and get the guage.
    MetricMutable metric = metricsMap.get(gaugeName);

    // If it's not there then try and put a new one in the storage.
    if (metric == null) {

      // Create the potential new gauge.
View Full Code Here

   * @return a metric object
   */
  public MetricMutableCounterLong getLongCounter(String counterName,
      long potentialStartingValue) {
    // See getLongGauge for description on how this works.
    MetricMutable counter = metricsMap.get(counterName);
    if (counter == null) {
      MetricMutableCounterLong newCounter = mf.newCounter(counterName, "",
          potentialStartingValue);
      counter = metricsMap.putIfAbsent(counterName, newCounter);
      if (counter == null) {
View Full Code Here

    return (MetricMutableCounterLong) counter;
  }

  public MetricMutableHistogram getHistogram(String histoName) {
    // See getLongGauge for description on how this works.
    MetricMutable histo = metricsMap.get(histoName);
    if (histo == null) {
      MetricMutableHistogram newHisto = new MetricMutableHistogram(histoName,
          "");
      histo = metricsMap.putIfAbsent(histoName, newHisto);
      if (histo == null) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.metrics2.impl.MetricsSystemImpl

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.