com.twitter.common.stats
Interface StatsProvider


public interface StatsProvider

A minimal interface to a Stats repository.


Nested Class Summary
static interface StatsProvider.RequestTimer
          A stat for tracking service requests.
 
Method Summary
 AtomicLong makeCounter(String name)
          Creates and exports a counter for tracking.
<T extends Number>
Stat<T>
makeGauge(String name, Supplier<T> gauge)
          Exports a read-only value for tracking.
 StatsProvider.RequestTimer makeRequestTimer(String name)
          Creates and exports a sets of stats that allows for typical rROC request tracking.
 

Method Detail

makeCounter

AtomicLong makeCounter(String name)
Creates and exports a counter for tracking.

Parameters:
name - The name to export the stat with.
Returns:
A reference to counter that will be tracked for incrementing.

makeGauge

<T extends Number> Stat<T> makeGauge(String name,
                                     Supplier<T> gauge)
Exports a read-only value for tracking.

Type Parameters:
T - The type of number exported by the variable.
Parameters:
name - The name of the variable to export.
gauge - The supplier of the instantaneous values to export.
Returns:
A reference to the stat that was stored.

makeRequestTimer

StatsProvider.RequestTimer makeRequestTimer(String name)
Creates and exports a sets of stats that allows for typical rROC request tracking.

Parameters:
name - The name to export the stat with.
Returns:
A reference to the request timer that can be used to track RPCs.