public interface Counter extends Meter
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Counter.BatchUpdater
See
batchUpdater(int). |
| Modifier and Type | Method and Description |
|---|---|
double |
actualCount()
The cumulative count as a floating point value since this counter was last reset.
|
void |
add(double amount)
Update the counter by the specified amount.
|
default Counter.BatchUpdater |
batchUpdater(int batchSize)
Returns a helper that can be used to more efficiently update the counter within a
single thread.
|
default long |
count()
The cumulative count since this counter was last reset.
|
default void |
increment()
Update the counter by one.
|
default void |
increment(long amount)
Update the counter by
amount. |
hasExpired, id, measuredefault void increment()
default void increment(long amount)
amount.amount - Amount to add to the counter.void add(double amount)
default long count()
double actualCount()
default Counter.BatchUpdater batchUpdater(int batchSize)
batchSize - Number of updates to batch before forcing a flush to the meter.