public final class BucketCounter extends Object implements DistributionSummary
DistributionSummary.BatchUpdater| Modifier and Type | Method and Description |
|---|---|
long |
count()
Not supported, will always return 0.
|
static BucketCounter |
get(Registry registry,
Id id,
LongFunction<String> f)
Creates a distribution summary object that manages a set of counters based on the bucket
function supplied.
|
boolean |
hasExpired()
Indicates whether the meter is expired.
|
Id |
id()
Identifier used to lookup this meter in the registry.
|
void |
increment(long amount,
int n)
Update the counter associated with the amount by
n. |
Iterable<Measurement> |
measure()
Get the set of measurements for this meter.
|
void |
record(long amount)
Updates the statistics kept by the summary with the specified amount.
|
long |
totalAmount()
Not supported, will always return 0.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbatchUpdater, recordpublic static BucketCounter get(Registry registry, Id id, LongFunction<String> f)
registry - Registry to use.id - Identifier for the metric being registered.f - Function to map values to buckets. See BucketFunctions for more information.public Id id()
Meterpublic Iterable<Measurement> measure()
Meterpublic boolean hasExpired()
MeterhasExpired in interface Meterpublic void record(long amount)
DistributionSummaryrecord in interface DistributionSummaryamount - 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.public void increment(long amount,
int n)
n.amount - Amount to use for determining the bucket.n - The delta to apply to the counter.public long count()
count in interface DistributionSummarypublic long totalAmount()
totalAmount in interface DistributionSummary