Examples of MetricMutableGaugeLong


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

   *
   * @param gaugeName gauge name
   * @param value the new value of the gauge.
   */
  public void setGauge(String gaugeName, long value) {
    MetricMutableGaugeLong gaugeInt = metricsRegistry.getLongGauge(gaugeName,
        value);
    gaugeInt.set(value);
  }
View Full Code Here

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

   *
   * @param gaugeName The name of the gauge to increment.
   * @param delta The amount to increment the gauge by.
   */
  public void incGauge(String gaugeName, long delta) {
    MetricMutableGaugeLong gaugeInt = metricsRegistry.getLongGauge(gaugeName,
        0l);
    gaugeInt.incr(delta);
  }
View Full Code Here

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

   *
   * @param gaugeName The name of the gauge.
   * @param delta the ammount to subtract from a gauge value.
   */
  public void decGauge(String gaugeName, long delta) {
    MetricMutableGaugeLong gaugeInt = metricsRegistry.getLongGauge(gaugeName,
        0l);
    gaugeInt.decr(delta);
  }
View Full Code Here

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

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

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

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

      // Create the potential new gauge.
      MetricMutableGaugeLong newGauge = mf.newGauge(gaugeName, "",
          potentialStartingValue);

      // Try and put the gauge in. This is atomic.
      metric = metricsMap.putIfAbsent(gaugeName, newGauge);
View Full Code Here

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

  @Test
  public void testSetGauge() throws Exception {
    String key = "testset";
    bmsi.setGauge(key, 100);
    MetricMutableGaugeLong g = (MetricMutableGaugeLong) bmsi.metricsRegistry
        .get(key);
    assertEquals(key, g.name);
    bmsi.setGauge(key, 110);
    assertSame(g, bmsi.metricsRegistry.get(key));
View Full Code Here

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

  @Test
  public void testIncGauge() throws Exception {
    String key = "testincgauge";
    bmsi.incGauge(key, 100);
    MetricMutableGaugeLong g = (MetricMutableGaugeLong) bmsi.metricsRegistry
        .get(key);
    assertEquals(key, g.name);
    bmsi.incGauge(key, 10);
    assertSame(g, bmsi.metricsRegistry.get(key));
  }
View Full Code Here

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

  @Test
  public void testDecGauge() throws Exception {
    String key = "testdec";
    bmsi.decGauge(key, 100);
    MetricMutableGaugeLong g = (MetricMutableGaugeLong) bmsi.metricsRegistry
        .get(key);
    assertEquals(key, g.name);
    bmsi.decGauge(key, 100);
    assertSame(g, bmsi.metricsRegistry.get(key));
  }
View Full Code Here

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

  @Test
  public void testSetGauge() throws Exception {
    String key = "testset";
    bmsi.setGauge(key, 100);
    MetricMutableGaugeLong g = (MetricMutableGaugeLong) bmsi.metricsRegistry.get(key);
    assertEquals(key, g.name);
    bmsi.setGauge(key, 110);
    assertSame(g, bmsi.metricsRegistry.get(key));

  }
View Full Code Here

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

  @Test
  public void testIncGauge() throws Exception {
    String key = "testincgauge";
    bmsi.incGauge(key, 100);
    MetricMutableGaugeLong g = (MetricMutableGaugeLong) bmsi.metricsRegistry.get(key);
    assertEquals(key, g.name);
    bmsi.incGauge(key, 10);
    assertSame(g, 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.