public interface Counter extends Metric
Gauge
Gauge to track a value that goes up and down.Modifier and Type | Interface and Description |
---|---|
static class |
Counter.Builder
Builder for
Counter s. |
Modifier and Type | Method and Description |
---|---|
static Counter.Builder |
builder(String name)
Create new builder for
Counter . |
long |
getValue()
Returns the counter's current value.
|
default void |
increment()
Increment the counter by one.
|
void |
increment(long amount)
Increment the counter by
amount . |
default Counter |
register()
Register the Metric to the registry.
|
void |
reset()
Reset to the counter's current value to zero.
|
default void |
unregister()
Unregisters the metric to the registry.
|
static Counter.Builder builder(String name)
Counter
.name
- The name of the metric.Counter
.default Counter register()
default void unregister()
unregister
in interface Metric
default void increment()
void reset()
void increment(long amount)
amount
.amount
- Amount to add to the counter.long getValue()
Copyright © 2018 WSO2. All rights reserved.