public class SimpleCounter extends AbstractCounter
long
values.Modifier and Type | Field and Description |
---|---|
protected java.util.function.LongConsumer |
publish
Samples' consumer
|
enabled, enabler
Modifier | Constructor and Description |
---|---|
protected |
SimpleCounter(java.util.function.LongConsumer publish)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static SimpleCounter |
getInstance(OptionalCounter counter)
Create and register instance
|
void |
update(long value)
Update counter
|
getEnabler, isEnabled, setEnabled, setEnabler
protected SimpleCounter(java.util.function.LongConsumer publish)
publish
- samples' consumerpublic static SimpleCounter getInstance(OptionalCounter counter)
counter
- Counter MBeanSimpleCounter
instancepublic void update(long value)
value
- new value