com.netflix.servo.monitor
Class ContextualCounter
java.lang.Object
com.netflix.servo.monitor.AbstractContextualMonitor<java.lang.Number,Counter>
com.netflix.servo.monitor.ContextualCounter
- All Implemented Interfaces:
- CompositeMonitor<java.lang.Number>, Counter, Monitor<java.lang.Number>, NumericMonitor<java.lang.Number>
public class ContextualCounter
- extends AbstractContextualMonitor<java.lang.Number,Counter>
- implements Counter
Composite that maintains separate simple counters for each distinct set of tags returned by the
tagging context.
|
Method Summary |
java.lang.Number |
getValue()
Returns the current value for the monitor. |
void |
increment()
Update the count by one. |
void |
increment(long amount)
Update the count by the specified amount. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ContextualCounter
public ContextualCounter(MonitorConfig config,
TaggingContext context,
com.google.common.base.Function<MonitorConfig,Counter> newMonitor)
- Create a new instance of the counter.
- Parameters:
config - shared configurationcontext - provider for context specific tagsnewMonitor - function to create new counters
increment
public void increment()
- Update the count by one.
- Specified by:
increment in interface Counter
increment
public void increment(long amount)
- Update the count by the specified amount.
- Specified by:
increment in interface Counter
getValue
public java.lang.Number getValue()
- Returns the current value for the monitor.
- Specified by:
getValue in interface Monitor<java.lang.Number>