Package com.codahale.metrics
Class RatioGauge.Ratio
- java.lang.Object
-
- com.codahale.metrics.RatioGauge.Ratio
-
- Enclosing class:
- RatioGauge
public static class RatioGauge.Ratio extends java.lang.Object
A ratio of one quantity to another.
-
-
Field Summary
Fields Modifier and Type Field Description private double
denominator
private double
numerator
-
Constructor Summary
Constructors Modifier Constructor Description private
Ratio(double numerator, double denominator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
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.java.lang.String
toString()
-
-
-
Method Detail
-
of
public static RatioGauge.Ratio of(double numerator, double denominator)
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-