com.twitter.common.stats
Class Ratio

java.lang.Object
  extended by com.twitter.common.stats.StatImpl<T>
      extended by com.twitter.common.stats.SampledStat<Double>
          extended by com.twitter.common.stats.Ratio
All Implemented Interfaces:
Stat<Double>

public class Ratio
extends SampledStat<Double>

Function to compute the ratio of two time series. The first argument is the numerator, and the second is the denominator. Assumes that the timestamps of the two arguments are suitably synchronized (i.e. the ith point in the numerator time series corresponds with the ith point of the denominator time series).


Method Summary
 Double doSample()
           
static
<T extends Number>
Ratio
of(Stat<T> numerator, Stat<T> denominator)
           
static Ratio of(String name, Number numerator, Number denominator)
           
static
<T extends Number>
Ratio
of(String name, Stat<T> numerator, Stat<T> denominator)
           
 
Methods inherited from class com.twitter.common.stats.SampledStat
read, sample
 
Methods inherited from class com.twitter.common.stats.StatImpl
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.twitter.common.stats.Stat
getName
 

Method Detail

of

public static <T extends Number> Ratio of(Stat<T> numerator,
                                          Stat<T> denominator)

of

public static <T extends Number> Ratio of(String name,
                                          Stat<T> numerator,
                                          Stat<T> denominator)

of

public static Ratio of(String name,
                       Number numerator,
                       Number denominator)

doSample

public Double doSample()
Specified by:
doSample in class SampledStat<Double>