Class Summary.Builder
- Enclosing class:
Summary
public static class Summary.Builder
extends MetricWithFixedMetadata.Builder<Summary.Builder,Summary>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
5 minutes.static final int
5. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Default properties for summary metrics.maxAgeSeconds
(long maxAgeSeconds) The quantiles are relative to a moving time window.numberOfAgeBuckets
(int ageBuckets) The quantiles are relative to a moving time window.quantile
(double quantile) Add a quantile.quantile
(double quantile, double error) Add a quantile.Allow Exemplars for this metric.Turn off Exemplars for this metric.Methods inherited from class MetricWithFixedMetadata.Builder
constLabels, help, labelNames, name, unit
-
Field Details
-
DEFAULT_MAX_AGE_SECONDS
5 minutes. SeemaxAgeSeconds(long)
. -
DEFAULT_NUMBER_OF_AGE_BUCKETS
5. SeenumberOfAgeBuckets(int)
- See Also:
-
-
Method Details
-
quantile
Add a quantile. Seequantile(double, double)
.Default errors are:
- error = 0.001 if quantile <= 0.01 or quantile >= 0.99
- error = 0.005 if quantile <= 0.02 or quantile >= 0.98
- error = 0.01 else.
-
quantile
Add a quantile. Call multiple times to add multiple quantiles.Example: The following will track the 0.95 quantile:
The second argument is the acceptable error margin, i.e. with the code above the quantile will not be exactly the 0.95 quantile but something between 0.949 and 0.951..quantile(0.95, 0.001)
There are two special cases:
.quantile(0.0, 0.0)
gives you the minimum observed value.quantile(1.0, 0.0)
gives you the maximum observed value
-
maxAgeSeconds
The quantiles are relative to a moving time window.maxAgeSeconds
is the size of that time window. Default isDEFAULT_MAX_AGE_SECONDS
. -
numberOfAgeBuckets
The quantiles are relative to a moving time window. ThenumberOfAgeBuckets
defines how smoothly the time window moves forward. For example, if the time window is 5 minutes and has 5 age buckets, then it is moving forward every minute by one minute. Default isDEFAULT_NUMBER_OF_AGE_BUCKETS
. -
getDefaultProperties
Default properties for summary metrics. -
build
- Specified by:
build
in classMetricWithFixedMetadata.Builder<Summary.Builder,
Summary>
-
withExemplars
Allow Exemplars for this metric. -
withoutExemplars
Turn off Exemplars for this metric.
-