Class RatioGauge.Ratio

java.lang.Object
com.codahale.metrics.RatioGauge.Ratio
Enclosing class:
RatioGauge

public static class RatioGauge.Ratio extends Object
A ratio of one quantity to another.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final double
     
    private final double
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Ratio(double numerator, double denominator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the ratio, which is either a double between 0 and 1 (inclusive) or NaN.
    of(double numerator, double denominator)
    Creates a new ratio with the given numerator and denominator.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • numerator

      private final double numerator
    • denominator

      private final double denominator
  • Constructor Details

    • Ratio

      private Ratio(double numerator, double denominator)
  • Method Details

    • 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 ratio
      denominator - the denominator of the ratio
      Returns:
      numerator:denominator
    • getValue

      public double getValue()
      Returns the ratio, which is either a double between 0 and 1 (inclusive) or NaN.
      Returns:
      the ratio
    • toString

      public String toString()
      Overrides:
      toString in class Object