com.twitter.common.stats
Class Rate<T extends Number>

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.Rate<T>
All Implemented Interfaces:
Stat<Double>

public class Rate<T extends Number>
extends SampledStat<Double>

Function to compute a windowed per-second rate of a value.


Nested Class Summary
static class Rate.Builder<T extends Number>
           
 
Method Summary
 Double doSample()
           
static
<T extends Number>
Rate.Builder<T>
of(Stat<T> input)
           
static Rate.Builder<AtomicInteger> of(String name, AtomicInteger input)
           
static Rate.Builder<AtomicLong> of(String name, AtomicLong input)
           
 
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> Rate.Builder<T> of(Stat<T> input)

of

public static Rate.Builder<AtomicInteger> of(String name,
                                             AtomicInteger input)

of

public static Rate.Builder<AtomicLong> of(String name,
                                          AtomicLong input)

doSample

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