public final class PercentileDistributionSummary extends Object implements DistributionSummary
Percentile distribution summaries are expensive compared to basic distribution summaries
from the registry. In particular they have a higher storage cost, worst case ~300x, to
maintain the data distribution. Be diligent about any additional dimensions added to percentile
distribution summaries and ensure they have a small bounded cardinality. In addition it is
highly recommended to set a threshold (see PercentileDistributionSummary.Builder.withRange(long, long)) whenever
possible to greatly restrict the worst case overhead.
| Modifier and Type | Class and Description |
|---|---|
static class |
PercentileDistributionSummary.Builder
Helper for getting instances of a PercentileDistributionSummary.
|
| Modifier and Type | Method and Description |
|---|---|
static IdBuilder<PercentileDistributionSummary.Builder> |
builder(Registry registry)
Return a builder for configuring and retrieving and instance of a percentile distribution
summary.
|
long |
count()
The number of times that record has been called since this timer was last reset.
|
static PercentileDistributionSummary |
get(Registry registry,
Id id)
Creates a distribution summary object that can be used for estimating percentiles.
|
boolean |
hasExpired()
Indicates whether the meter is expired.
|
Id |
id()
Identifier used to lookup this meter in the registry.
|
Iterable<Measurement> |
measure()
Get the set of measurements for this meter.
|
double |
percentile(double p)
Computes the specified percentile for this distribution summary.
|
void |
record(long amount)
Updates the statistics kept by the summary with the specified amount.
|
long |
totalAmount()
The total amount of all recorded events since this summary was last reset.
|
public static PercentileDistributionSummary get(Registry registry, Id id)
PercentileDistributionSummary.Builder.withRange(long, long)) whenever possible.registry - Registry to use.id - Identifier for the metric being registered.public static IdBuilder<PercentileDistributionSummary.Builder> builder(Registry registry)
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 double percentile(double p)
p - Percentile to compute, value must be 0.0 <= p <= 100.0.p`th percentile in seconds.public long count()
DistributionSummarycount in interface DistributionSummarypublic long totalAmount()
DistributionSummarytotalAmount in interface DistributionSummary