Class MetricsCollector.SnapshotTextOptions
java.lang.Object
com.soklet.MetricsCollector.SnapshotTextOptions
- Enclosing interface:
MetricsCollector
Options for rendering a textual metrics snapshot.
Use withMetricsFormat(MetricsFormat) to obtain a builder and customize output.
Key options:
metricFilterallows per-sample filtering by name and labelshistogramFormatcontrols bucket vs count/sum outputincludeZeroBucketsdrops empty bucket samples when false
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder forMetricsCollector.SnapshotTextOptions.static enumSupported histogram rendering strategies.static final classA single text-format sample with its label set. -
Method Summary
Modifier and TypeMethodDescriptionfromMetricsFormat(@NonNull MetricsCollector.MetricsFormat metricsFormat) Creates options with the specified format and defaults for all other fields.The histogram rendering strategy.Whether zero-count buckets should be emitted.Optional filter for rendered samples.The text exposition format to emit.withMetricsFormat(@NonNull MetricsCollector.MetricsFormat metricsFormat) Begins building options with the specified format.
-
Method Details
-
withMetricsFormat
public static @NonNull MetricsCollector.SnapshotTextOptions.Builder withMetricsFormat(@NonNull MetricsCollector.MetricsFormat metricsFormat) Begins building options with the specified format.- Parameters:
metricsFormat- the text exposition format- Returns:
- a builder seeded with the format
-
fromMetricsFormat
public static @NonNull MetricsCollector.SnapshotTextOptions fromMetricsFormat(@NonNull MetricsCollector.MetricsFormat metricsFormat) Creates options with the specified format and defaults for all other fields.- Parameters:
metricsFormat- the text exposition format- Returns:
- a
MetricsCollector.SnapshotTextOptionsinstance
-
getMetricsFormat
The text exposition format to emit.- Returns:
- the metrics format
-
getMetricFilter
public @NonNull Optional<Predicate<MetricsCollector.SnapshotTextOptions.MetricSample>> getMetricFilter()Optional filter for rendered samples.- Returns:
- the filter, if present
-
getHistogramFormat
The histogram rendering strategy.- Returns:
- the histogram format
-
getIncludeZeroBuckets
Whether zero-count buckets should be emitted.- Returns:
trueif zero-count buckets are included
-