Search in sources :

Example 1 with MutableGaugeLong

use of org.apache.hadoop.metrics2.lib.MutableGaugeLong in project hbase by apache.

the class BaseSourceImpl method setGauge.

/**
   * Set a single gauge to a value.
   *
   * @param gaugeName gauge name
   * @param value     the new value of the gauge.
   */
public void setGauge(String gaugeName, long value) {
    MutableGaugeLong gaugeInt = metricsRegistry.getGauge(gaugeName, value);
    gaugeInt.set(value);
}
Also used : MutableGaugeLong(org.apache.hadoop.metrics2.lib.MutableGaugeLong)

Example 2 with MutableGaugeLong

use of org.apache.hadoop.metrics2.lib.MutableGaugeLong in project hbase by apache.

the class BaseSourceImpl method incGauge.

/**
   * Add some amount to a gauge.
   *
   * @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) {
    MutableGaugeLong gaugeInt = metricsRegistry.getGauge(gaugeName, 0l);
    gaugeInt.incr(delta);
}
Also used : MutableGaugeLong(org.apache.hadoop.metrics2.lib.MutableGaugeLong)

Example 3 with MutableGaugeLong

use of org.apache.hadoop.metrics2.lib.MutableGaugeLong in project hbase by apache.

the class BaseSourceImpl method decGauge.

/**
   * Decrease the value of a named gauge.
   *
   * @param gaugeName The name of the gauge.
   * @param delta     the ammount to subtract from a gauge value.
   */
public void decGauge(String gaugeName, long delta) {
    MutableGaugeLong gaugeInt = metricsRegistry.getGauge(gaugeName, 0l);
    gaugeInt.decr(delta);
}
Also used : MutableGaugeLong(org.apache.hadoop.metrics2.lib.MutableGaugeLong)

Example 4 with MutableGaugeLong

use of org.apache.hadoop.metrics2.lib.MutableGaugeLong in project hadoop by apache.

the class S3AScaleTestBase method gaugeValue.

/**
   * Get the gauge value of a statistic. Raises an assertion if
   * there is no such gauge.
   * @param statistic statistic to look up
   * @return the value.
   */
public long gaugeValue(Statistic statistic) {
    S3AInstrumentation instrumentation = getFileSystem().getInstrumentation();
    MutableGaugeLong gauge = instrumentation.lookupGauge(statistic.getSymbol());
    assertNotNull("No gauge " + statistic + " in " + instrumentation.dump("", " = ", "\n", true), gauge);
    return gauge.value();
}
Also used : MutableGaugeLong(org.apache.hadoop.metrics2.lib.MutableGaugeLong) S3AInstrumentation(org.apache.hadoop.fs.s3a.S3AInstrumentation)

Aggregations

MutableGaugeLong (org.apache.hadoop.metrics2.lib.MutableGaugeLong)4 S3AInstrumentation (org.apache.hadoop.fs.s3a.S3AInstrumentation)1