Examples of MetricMutableCounterLong


Examples of org.apache.hadoop.metrics2.lib.MetricMutableCounterLong

   *
   * @param key the name of the counter
   * @param delta the ammount to increment
   */
  public void incCounters(String key, long delta) {
    MetricMutableCounterLong counter = metricsRegistry.getLongCounter(key, 0l);
    counter.incr(delta);

  }
View Full Code Here

Examples of org.apache.hadoop.metrics2.lib.MetricMutableCounterLong

   * @param initValue of the metric
   * @return a new counter object
   */
  public MetricMutableCounterLong newCounter(String name, String description,
      long initValue) {
    MetricMutableCounterLong ret = mf.newCounter(name, description, initValue);
    return addNewMetricIfAbsent(name, ret, MetricMutableCounterLong.class);
  }
View Full Code Here

Examples of org.apache.hadoop.metrics2.lib.MetricMutableCounterLong

  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) {
        return newCounter;
      }
View Full Code Here

Examples of org.apache.hadoop.metrics2.lib.MetricMutableCounterLong

  @Test
  public void testIncCounters() throws Exception {
    String key = "testinccounter";
    bmsi.incCounters(key, 100);
    MetricMutableCounterLong c = (MetricMutableCounterLong) bmsi.metricsRegistry
        .get(key);
    assertEquals(key, c.name);
    bmsi.incCounters(key, 100);
    assertSame(c, bmsi.metricsRegistry.get(key));
  }
View Full Code Here

Examples of org.apache.hadoop.metrics2.lib.MetricMutableCounterLong

  @Test
  public void testIncCounters() throws Exception {
    String key = "testinccounter";
    bmsi.incCounters(key, 100);
    MetricMutableCounterLong c = (MetricMutableCounterLong) bmsi.metricsRegistry.get(key);
    assertEquals(key, c.name);
    bmsi.incCounters(key, 100);
    assertSame(c, bmsi.metricsRegistry.get(key));
  }
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.