Package org.apache.hadoop.metrics2

Examples of org.apache.hadoop.metrics2.MetricsTag


   * @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


  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

   * Construct the registry with a record name
   * @param name of the record of the metrics
   */
  public DynamicMetricsRegistry(String name) {
    this.name = name;
    this.mf = new MetricMutableFactory();
  }
View Full Code Here

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

   *
   * @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

   *
   * @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

   *
   * @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

   * @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

    @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

TOP

Related Classes of org.apache.hadoop.metrics2.MetricsTag

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.