Class DistributionStatisticConfig
java.lang.Object
io.micrometer.core.instrument.distribution.DistributionStatisticConfig
- All Implemented Interfaces:
Mergeable<DistributionStatisticConfig>
public class DistributionStatisticConfig
extends Object
implements Mergeable<DistributionStatisticConfig>
Configures the distribution statistics that emanate from meters like
Timer
and DistributionSummary
.
These statistics include max, percentiles, percentile histograms, and SLA violations.
Many distribution statistics are decayed to give greater weight to recent samples.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final DistributionStatisticConfig
static final DistributionStatisticConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Statistics like max, percentiles, and histogram counts decay over time to give greater weight to recent samples (exception: histogram counts are cumulative for those systems that expect cumulative histogram buckets).Statistics like max, percentiles, and histogram counts decay over time to give greater weight to recent samples (exception: histogram counts are cumulative for those systems that expect cumulative histogram buckets).getHistogramBuckets
(boolean supportsAggregablePercentiles) For internal use only.Deprecated.The maximum value that the meter is expected to observe.Deprecated.The minimum value that the meter is expected to observe.Determines the number of digits of precision to maintain on the dynamic range histogram used to compute percentile approximations.double[]
Produces an additional time series for each requested percentile.double[]
Publish at a minimum a histogram containing your defined SLO boundaries.double[]
Deprecated.Adds histogram buckets used to generate aggregable percentile approximations in monitoring systems that have query facilities to do so (e.g.boolean
boolean
merge
(DistributionStatisticConfig parent) Merges two configurations.
-
Field Details
-
DEFAULT
-
NONE
-
-
Constructor Details
-
DistributionStatisticConfig
public DistributionStatisticConfig()
-
-
Method Details
-
builder
-
merge
Merges two configurations. Any options that are non-null in this configuration take precedence. Any options that are non-null in the parent are used otherwise.- Specified by:
merge
in interfaceMergeable<DistributionStatisticConfig>
- Parameters:
parent
- The configuration to merge with. The parent takes lower precedence than this configuration.- Returns:
- A new, merged, immutable configuration.
-
getHistogramBuckets
For internal use only.- Parameters:
supportsAggregablePercentiles
- whether it supports aggregable percentiles- Returns:
- histogram buckets
-
isPercentileHistogram
Adds histogram buckets used to generate aggregable percentile approximations in monitoring systems that have query facilities to do so (e.g. Prometheus'histogram_quantile
, Atlas':percentiles
).- Returns:
- This builder.
-
getPercentiles
Produces an additional time series for each requested percentile. This percentile is computed locally, and so can't be aggregated with percentiles computed across other dimensions (e.g. in a different instance). UsepercentileHistogram
to publish a histogram that can be used to generate aggregable percentile approximations.- Returns:
- Percentiles to compute and publish. The 95th percentile should be expressed as
0.95
-
getPercentilePrecision
Determines the number of digits of precision to maintain on the dynamic range histogram used to compute percentile approximations. The higher the degrees of precision, the more accurate the approximation is at the cost of more memory.- Returns:
- The digits of precision to maintain for percentile approximations.
-
getMinimumExpectedValue
Deprecated.UsegetMinimumExpectedValueAsDouble()
. If you use this method, your code will not be compatible with code that uses Micrometer 1.3.x.The minimum value that the meter is expected to observe. Sets a lower bound on histogram buckets that are shipped to monitoring systems that support aggregable percentile approximations.- Returns:
- The minimum value that this distribution summary is expected to observe.
-
getMinimumExpectedValueAsDouble
The minimum value that the meter is expected to observe. Sets a lower bound on histogram buckets that are shipped to monitoring systems that support aggregable percentile approximations.- Returns:
- The minimum value that this distribution summary is expected to observe.
-
getMaximumExpectedValue
Deprecated.UsegetMaximumExpectedValueAsDouble()
. If you use this method, your code will not be compatible with code that uses Micrometer 1.3.x.The maximum value that the meter is expected to observe. Sets an upper bound on histogram buckets that are shipped to monitoring systems that support aggregable percentile approximations.- Returns:
- The maximum value that the meter is expected to observe.
-
getMaximumExpectedValueAsDouble
The maximum value that the meter is expected to observe. Sets an upper bound on histogram buckets that are shipped to monitoring systems that support aggregable percentile approximations.- Returns:
- The maximum value that the meter is expected to observe.
-
getExpiry
Statistics like max, percentiles, and histogram counts decay over time to give greater weight to recent samples (exception: histogram counts are cumulative for those systems that expect cumulative histogram buckets). Samples are accumulated to such statistics in ring buffers which rotate after this expiry, with a buffer length ofbufferLength
.- Returns:
- The amount of time samples are accumulated to a histogram before it is reset and rotated.
-
getBufferLength
Statistics like max, percentiles, and histogram counts decay over time to give greater weight to recent samples (exception: histogram counts are cumulative for those systems that expect cumulative histogram buckets). Samples are accumulated to such statistics in ring buffers which rotate afterexpiry
, with this buffer length.- Returns:
- The number of histograms to keep in the ring buffer.
-
getSlaBoundaries
Deprecated.UsegetServiceLevelObjectiveBoundaries()
. If you use this method, your code will not be compatible with code that uses Micrometer 1.4.x and later.Publish at a minimum a histogram containing your defined SLA boundaries. When used in conjunction withpercentileHistogram
, the boundaries defined here are included alongside other buckets used to generate aggregable percentile approximations. If theDistributionStatisticConfig
is meant for use with aTimer
, the SLA unit is in nanoseconds.- Returns:
- The SLA boundaries to include the set of histogram buckets shipped to the monitoring system.
-
getServiceLevelObjectiveBoundaries
Publish at a minimum a histogram containing your defined SLO boundaries. When used in conjunction withpercentileHistogram
, the boundaries defined here are included alongside other buckets used to generate aggregable percentile approximations. If theDistributionStatisticConfig
is meant for use with aTimer
, the SLO unit is in nanoseconds.- Returns:
- The SLO boundaries to include the set of histogram buckets shipped to the monitoring system.
-
isPublishingPercentiles
public boolean isPublishingPercentiles() -
isPublishingHistogram
public boolean isPublishingHistogram()
-
getMaximumExpectedValueAsDouble()
.