com.twitter.common.stats
Class Elapsed

java.lang.Object
  extended by com.twitter.common.stats.Elapsed

public class Elapsed
extends Object

A stat that exports the amount of time since it was last reset.


Constructor Summary
Elapsed(String name)
          Calls Elapsed(String, Time) using a default granularity of nanoseconds.
Elapsed(String name, Time granularity)
          Creates and exports a new stat that maintains the difference between the system clock time and the time since it was last reset.
 
Method Summary
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Elapsed

public Elapsed(String name)
Calls Elapsed(String, Time) using a default granularity of nanoseconds.

Parameters:
name - Name of the stat to export.

Elapsed

public Elapsed(String name,
               Time granularity)
Creates and exports a new stat that maintains the difference between the system clock time and the time since it was last reset. Upon export, the counter will act as though it were just reset.

Parameters:
name - Name of the stat to export.
granularity - Time unit granularity to export.
Method Detail

reset

public void reset()