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);
}
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);
}
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);
}
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();
}
Aggregations