com.netflix.servo.monitor
Class DynamicCounter

java.lang.Object
  extended by com.netflix.servo.monitor.DynamicCounter
All Implemented Interfaces:
CompositeMonitor<java.lang.Long>, Monitor<java.lang.Long>

public class DynamicCounter
extends java.lang.Object
implements CompositeMonitor<java.lang.Long>

Utility class that dynamically creates counters based on an arbitrary (name, tagList), or MonitorConfig Counters are automatically expired after 15 minutes of inactivity.


Method Summary
 MonitorConfig getConfig()
          Configuration used to identify a monitor and provide metadata used in aggregations.
 java.util.List<Monitor<?>> getMonitors()
          
 java.lang.Long getValue()
          Returns the current value for the monitor.
static void increment(MonitorConfig config)
          Increment a counter based on a given MonitorConfig.
static void increment(MonitorConfig config, long delta)
          Increment a counter based on a given MonitorConfig by a given delta.
static void increment(java.lang.String name, java.lang.String... tags)
          Increment a counter specified by a name, and a sequence of (key, value) pairs
static void increment(java.lang.String name, TagList list)
          Increment the counter for a given name, tagList
static void increment(java.lang.String name, TagList list, long delta)
          Increment the counter for a given name, tagList by a given delta.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

increment

public static void increment(MonitorConfig config)
Increment a counter based on a given MonitorConfig.


increment

public static void increment(java.lang.String name,
                             java.lang.String... tags)
Increment a counter specified by a name, and a sequence of (key, value) pairs


increment

public static void increment(MonitorConfig config,
                             long delta)
Increment a counter based on a given MonitorConfig by a given delta.

Parameters:
config - The monitoring config
delta - The amount added to the current value

increment

public static void increment(java.lang.String name,
                             TagList list)
Increment the counter for a given name, tagList


increment

public static void increment(java.lang.String name,
                             TagList list,
                             long delta)
Increment the counter for a given name, tagList by a given delta.


getMonitors

public java.util.List<Monitor<?>> getMonitors()

Specified by:
getMonitors in interface CompositeMonitor<java.lang.Long>

getValue

public java.lang.Long getValue()
Returns the current value for the monitor.

Specified by:
getValue in interface Monitor<java.lang.Long>

getConfig

public MonitorConfig getConfig()
Configuration used to identify a monitor and provide metadata used in aggregations.

Specified by:
getConfig in interface Monitor<java.lang.Long>

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object