Package org.apache.hadoop.metrics2.lib

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


  @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


  @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

   * @param extended produce extended stat (stdev, min/max etc.) if true.
   * @return a new metric object
   */
  public MetricMutableStat newStat(String name, String description,
      String sampleName, String valueName, boolean extended) {
    MetricMutableStat ret = mf.newStat(name, description, sampleName,
        valueName, extended);
    return addNewMetricIfAbsent(name, ret, MetricMutableStat.class);
  }
View Full Code Here

    @Metric("YYY desc") MutableGaugeLong yyy;
    @Metric MutableRate s1;
    final MetricsRegistry registry;

    TestSource(String recName) {
      registry = new MetricsRegistry(recName);
    }
View Full Code Here

    @Metric("YYY desc") MutableGaugeLong yyy;
    @Metric MutableRate s1;
    final MetricsRegistry registry;

    TestSource(String recName) {
      registry = new MetricsRegistry(recName);
    }
View Full Code Here

    for (Callback cb : callbacks) cb.postStop();
  }

  @Override public synchronized <T>
  T register(String name, String desc, T source) {
    MetricsSourceBuilder sb = MetricsAnnotations.newSourceBuilder(source);
    final MetricsSource s = sb.build();
    MetricsInfo si = sb.info();
    String name2 = name == null ? si.name() : name;
    final String finalDesc = desc == null ? si.description() : desc;
    final String finalName = // be friendly to non-metrics tests
        DefaultMetricsSystem.sourceName(name2, !monitoring);
    allSources.put(finalName, s);
View Full Code Here

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

  }
View Full Code Here

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

  }
View Full Code Here

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

  }
View Full Code Here

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

  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.metrics2.lib.MutableCounterLong

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.