Class DistributionStatisticConfig
java.lang.Object
io.micrometer.core.instrument.distribution.DistributionStatisticConfig
- All Implemented Interfaces:
Mergeable<DistributionStatisticConfig>
public class DistributionStatisticConfig extends java.lang.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
Nested Classes Modifier and Type Class Description static class
DistributionStatisticConfig.Builder
-
Field Summary
Fields Modifier and Type Field Description static DistributionStatisticConfig
DEFAULT
static DistributionStatisticConfig
NONE
-
Constructor Summary
Constructors Constructor Description DistributionStatisticConfig()
-
Method Summary
Modifier and Type Method Description static DistributionStatisticConfig.Builder
builder()
java.lang.Integer
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).java.time.Duration
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).java.util.NavigableSet<java.lang.Double>
getHistogramBuckets(boolean supportsAggregablePercentiles)
For internal use only.java.lang.Double
getMaximumExpectedValue()
Deprecated.java.lang.Double
getMaximumExpectedValueAsDouble()
The maximum value that the meter is expected to observe.java.lang.Double
getMinimumExpectedValue()
Deprecated.java.lang.Double
getMinimumExpectedValueAsDouble()
The minimum value that the meter is expected to observe.java.lang.Integer
getPercentilePrecision()
Determines the number of digits of precision to maintain on the dynamic range histogram used to compute percentile approximations.double[]
getPercentiles()
Produces an additional time series for each requested percentile.double[]
getServiceLevelObjectiveBoundaries()
Publish at a minimum a histogram containing your defined SLO boundaries.double[]
getSlaBoundaries()
Deprecated.java.lang.Boolean
isPercentileHistogram()
Adds histogram buckets used to generate aggregable percentile approximations in monitoring systems that have query facilities to do so (e.g.boolean
isPublishingHistogram()
boolean
isPublishingPercentiles()
DistributionStatisticConfig
merge(DistributionStatisticConfig parent)
Merges two configurations.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
public java.util.NavigableSet<java.lang.Double> getHistogramBuckets(boolean supportsAggregablePercentiles)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()
.