Class DistributionStatisticConfig.Builder
java.lang.Object
io.micrometer.core.instrument.distribution.DistributionStatisticConfig.Builder
- Enclosing class:
- DistributionStatisticConfig
public static class DistributionStatisticConfig.Builder
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description DistributionStatisticConfig.Builder
bufferLength(java.lang.Integer bufferLength)
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).DistributionStatisticConfig
build()
DistributionStatisticConfig.Builder
expiry(java.time.Duration expiry)
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).DistributionStatisticConfig.Builder
maximumExpectedValue(java.lang.Double max)
The maximum value that the meter is expected to observe.DistributionStatisticConfig.Builder
maximumExpectedValue(java.lang.Long max)
Deprecated.DistributionStatisticConfig.Builder
minimumExpectedValue(java.lang.Double min)
The minimum value that the meter is expected to observe.DistributionStatisticConfig.Builder
minimumExpectedValue(java.lang.Long min)
Deprecated.UseminimumExpectedValue(Double)
instead since 1.4.0.DistributionStatisticConfig.Builder
percentilePrecision(java.lang.Integer digitsOfPrecision)
Determines the number of digits of precision to maintain on the dynamic range histogram used to compute percentile approximations.DistributionStatisticConfig.Builder
percentiles(double... percentiles)
Produces an additional time series for each requested percentile.DistributionStatisticConfig.Builder
percentilesHistogram(java.lang.Boolean enabled)
DistributionStatisticConfig.Builder
serviceLevelObjectives(double... slos)
Publish at a minimum a histogram containing your defined Service Level Objective (SLO) boundaries.DistributionStatisticConfig.Builder
sla(double... sla)
Deprecated.UseserviceLevelObjectives(double...)
instead.DistributionStatisticConfig.Builder
sla(long... sla)
Deprecated.UseserviceLevelObjectives(double...)
instead.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
percentilesHistogram
public DistributionStatisticConfig.Builder percentilesHistogram(@Nullable java.lang.Boolean enabled) -
percentiles
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). UseDistributionStatisticConfig.percentileHistogram
to publish a histogram that can be used to generate aggregable percentile approximations.- Parameters:
percentiles
- Percentiles to compute and publish. The 95th percentile should be expressed as0.95
.- Returns:
- This builder.
-
percentilePrecision
public DistributionStatisticConfig.Builder percentilePrecision(@Nullable java.lang.Integer digitsOfPrecision)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.- Parameters:
digitsOfPrecision
- The digits of precision to maintain for percentile approximations.- Returns:
- This builder.
-
serviceLevelObjectives
Publish at a minimum a histogram containing your defined Service Level Objective (SLO) boundaries. When used in conjunction withDistributionStatisticConfig.percentileHistogram
, 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.- Parameters:
slos
- The SLO boundaries to include the set of histogram buckets shipped to the monitoring system.- Returns:
- This builder.
- Since:
- 1.5.0
-
sla
Deprecated.UseserviceLevelObjectives(double...)
instead. "Service Level Agreement" is more formally the agreement between an engineering organization and the business. Service Level Objectives are set more conservatively than the SLA to provide some wiggle room while still satisfying the business requirement. SLOs are the threshold we intend to measure against, then.Publish at a minimum a histogram containing your defined SLA boundaries. When used in conjunction withDistributionStatisticConfig.percentileHistogram
, 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.- Parameters:
sla
- The SLA boundaries to include the set of histogram buckets shipped to the monitoring system.- Returns:
- This builder.
- Since:
- 1.4.0
-
sla
Deprecated.UseserviceLevelObjectives(double...)
instead. "Service Level Agreement" is more formally the agreement between an engineering organization and the business. Service Level Objectives are set more conservatively than the SLA to provide some wiggle room while still satisfying the business requirement. SLOs are the threshold we intend to measure against, then.Publish at a minimum a histogram containing your defined SLA boundaries. When used in conjunction withDistributionStatisticConfig.percentileHistogram
, 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.- Parameters:
sla
- The SLA boundaries to include the set of histogram buckets shipped to the monitoring system.- Returns:
- This builder.
-
minimumExpectedValue
@Deprecated public DistributionStatisticConfig.Builder minimumExpectedValue(@Nullable java.lang.Long min)Deprecated.UseminimumExpectedValue(Double)
instead since 1.4.0.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.- Parameters:
min
- The minimum value that this distribution summary is expected to observe.- Returns:
- This builder.
-
minimumExpectedValue
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.- Parameters:
min
- The minimum value that this distribution summary is expected to observe.- Returns:
- This builder.
- Since:
- 1.3.10
-
maximumExpectedValue
@Deprecated public DistributionStatisticConfig.Builder maximumExpectedValue(@Nullable java.lang.Long max)Deprecated.UsemaximumExpectedValue(Double)
instead since 1.4.0.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.- Parameters:
max
- The maximum value that the meter is expected to observe.- Returns:
- This builder.
-
maximumExpectedValue
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.- Parameters:
max
- The maximum value that the meter is expected to observe.- Returns:
- This builder.
- Since:
- 1.3.10
-
expiry
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(java.lang.Integer)
.- Parameters:
expiry
- The amount of time samples are accumulated to decaying distribution statistics before they are reset and rotated.- Returns:
- This builder.
-
bufferLength
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(java.time.Duration)
, with this buffer length.- Parameters:
bufferLength
- The number of histograms to keep in the ring buffer.- Returns:
- This builder.
-
build
- Returns:
- A new immutable distribution configuration.
-
maximumExpectedValue(Double)
instead since 1.4.0.