Package com.codahale.metrics
Class RatioGauge.Ratio
java.lang.Object
com.codahale.metrics.RatioGauge.Ratio
- Enclosing class:
RatioGauge
A ratio of one quantity to another.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
getValue()
Returns the ratio, which is either adouble
between 0 and 1 (inclusive) orNaN
.static RatioGauge.Ratio
of
(double numerator, double denominator) Creates a new ratio with the given numerator and denominator.toString()
-
Field Details
-
numerator
private final double numerator -
denominator
private final double denominator
-
-
Constructor Details
-
Ratio
private Ratio(double numerator, double denominator)
-
-
Method Details
-
of
Creates a new ratio with the given numerator and denominator.- Parameters:
numerator
- the numerator of the ratiodenominator
- the denominator of the ratio- Returns:
numerator:denominator
-
getValue
public double getValue()Returns the ratio, which is either adouble
between 0 and 1 (inclusive) orNaN
.- Returns:
- the ratio
-
toString
-