Package com.jsgalactic.axiom.metrics
Class MetricsRegistry.Builder
java.lang.Object
com.jsgalactic.axiom.metrics.MetricsRegistry.Builder
- Enclosing class:
MetricsRegistry
Settings of a
MetricsRegistry. Not thread-safe; build once at startup.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates the registry.Sets the text of the# HELPline of a metric.maxSeries(int maxSeries) Sets the series limit.timerBuckets(String name, List<Duration> bounds) Sets the histogram bounds of one timer, whatever its tags.timerBuckets(List<Duration> bounds) Sets the histogram bounds of every timer that has none of its own.
-
Method Details
-
maxSeries
Sets the series limit.- Parameters:
maxSeries- most distinct name-and-tag combinations to keep, at least one- Returns:
- this builder
- Throws:
IllegalArgumentException- if the limit is below one
-
timerBuckets
Sets the histogram bounds of every timer that has none of its own.- Parameters:
bounds- positive, strictly ascending upper bounds, at most 64- Returns:
- this builder
- Throws:
IllegalArgumentException- if the bounds are empty, unordered or too many
-
timerBuckets
Sets the histogram bounds of one timer, whatever its tags. Applies to series created afterwards, so configure before the application starts.- Parameters:
name- timer namebounds- positive, strictly ascending upper bounds, at most 64- Returns:
- this builder
- Throws:
IllegalArgumentException- if the name is invalid or the bounds are empty, unordered or too many
-
help
Sets the text of the# HELPline of a metric.- Parameters:
name- metric nametext- one line of plain text, at most 512 characters- Returns:
- this builder
- Throws:
IllegalArgumentException- if the name is invalid or the text is empty, too long or contains a line break
-
build
Creates the registry.- Returns:
- an empty registry
-