public interface DistributionSummary extends Meter
The precise set of information maintained depends on the implementation. Most should try to
provide a consistent implementation of count() and totalAmount(),
but some implementations may not. In particular, the implementation from NoopRegistry
will always return 0.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
DistributionSummary.BatchUpdater
See
batchUpdater(int). |
| Modifier and Type | Method and Description |
|---|---|
default DistributionSummary.BatchUpdater |
batchUpdater(int batchSize)
Returns a helper that can be used to more efficiently update the distribution summary
within a single thread.
|
long |
count()
The number of times that record has been called since this timer was last reset.
|
void |
record(long amount)
Updates the statistics kept by the summary with the specified amount.
|
default void |
record(long[] amounts,
int n)
Updates the statistics kept by the summary with the specified amounts as a batch.
|
long |
totalAmount()
The total amount of all recorded events since this summary was last reset.
|
hasExpired, id, measurevoid record(long amount)
amount - Amount for an event being measured. For example, if the size in bytes of responses
from a server. If the amount is less than 0 the value will be dropped.default void record(long[] amounts,
int n)
amounts - Amounts for an event being measured. For example, if the size in bytes of responses
from a server. If the amount is less than 0 the value will be dropped.n - The number of elements to write from the amounts array (starting from 0). If n is
<= 0 no entries will be recorded. If n is greater than amounts.length, all amounts
will be recorded.record(long)long count()
long totalAmount()
default DistributionSummary.BatchUpdater batchUpdater(int batchSize)
batchSize - Number of updates to batch before forcing a flush to the meter.