public class ContextualCounter extends AbstractContextualMonitor<java.lang.Number,Counter> implements Counter
baseConfig, context, monitors, newMonitor
Constructor and Description |
---|
ContextualCounter(MonitorConfig config,
TaggingContext context,
com.google.common.base.Function<MonitorConfig,Counter> newMonitor)
Create a new instance of the counter.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Number |
getValue(int pollerIndex)
Returns the current value for the monitor for the nth poller.
|
void |
increment()
Update the count by one.
|
void |
increment(long amount)
Update the count by the specified amount.
|
getConfig, getMonitorForCurrentContext, getMonitors, getValue
public ContextualCounter(MonitorConfig config, TaggingContext context, com.google.common.base.Function<MonitorConfig,Counter> newMonitor)
config
- shared configurationcontext
- provider for context specific tagsnewMonitor
- function to create new counters