com.yammer.metrics.util
Class RatioGauge
java.lang.Object
com.yammer.metrics.core.Gauge<Double>
com.yammer.metrics.util.RatioGauge
- All Implemented Interfaces:
- Metric
- Direct Known Subclasses:
- PercentGauge
public abstract class RatioGauge
- extends Gauge<Double>
A gauge which measures the ratio of one value to another.
If the denominator is zero, not a number, or infinite, the resulting ratio is not a number.
Method Summary |
protected abstract double |
getDenominator()
Returns the denominator (the value on the bottom half of the fraction or the right-hand side
of the ratio). |
protected abstract double |
getNumerator()
Returns the numerator (the value on the top half of the fraction or the left-hand side of the
ratio). |
Double |
value()
Returns the metric's current value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RatioGauge
public RatioGauge()
getNumerator
protected abstract double getNumerator()
- Returns the numerator (the value on the top half of the fraction or the left-hand side of the
ratio).
- Returns:
- the numerator
getDenominator
protected abstract double getDenominator()
- Returns the denominator (the value on the bottom half of the fraction or the right-hand side
of the ratio).
- Returns:
- the denominator
value
public Double value()
- Description copied from class:
Gauge
- Returns the metric's current value.
- Specified by:
value
in class Gauge<Double>
- Returns:
- the metric's current value
Copyright © 2012. All Rights Reserved.