Package org.microproxy.stats
Class StatsRegistry.Builder
java.lang.Object
org.microproxy.stats.StatsRegistry.Builder
- Enclosing class:
StatsRegistry
Settings for a
StatsRegistry.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a new registry with these settings.clusterOverflow(StatsRegistry.Overflow overflow) What happens to clusters beyondmaxClusters(defaultStatsRegistry.Overflow.OTHER).histogramBounds(double... bounds) The bucket bounds of histograms registered without bounds of their own (default Envoy's,Histogram.defaultBounds()).maxClusters(int max) How many clusters (chained proxies, and servers withperHostClusters) may have stats of their own (default 100), besidesdirect,cache,replayandother, which always may.maxScriptStats(int max) How many stats scripts may make (default 100); past that, a script's new stats do nothing.perHostClusters(boolean perHost) Whether each server a direct connection goes to is a cluster of its own, namedhost_port(default false: they all aredirect).The prefix of exported names (defaultenvoy): Prometheus names start with it and_, statsd names with it and a dot.tagExtractor(TagExtractor extractor) What takes the tags out of flat names (defaultTagExtractor.envoyDefaults()).
-
Method Details
-
prefix
The prefix of exported names (defaultenvoy): Prometheus names start with it and_, statsd names with it and a dot. A trailing_or dot is dropped; an empty prefix exports names as they are.- Parameters:
prefix- the prefix, such asmicroproxy- Returns:
- this builder
- Throws:
IllegalArgumentException- if it has characters other than letters, digits and_
-
tagExtractor
What takes the tags out of flat names (defaultTagExtractor.envoyDefaults()).- Parameters:
extractor- the extractor- Returns:
- this builder
-
maxClusters
How many clusters (chained proxies, and servers withperHostClusters) may have stats of their own (default 100), besidesdirect,cache,replayandother, which always may.- Parameters:
max- the most clusters, at least 1- Returns:
- this builder
- Throws:
IllegalArgumentException- if it is less than 1
-
clusterOverflow
What happens to clusters beyondmaxClusters(defaultStatsRegistry.Overflow.OTHER).- Parameters:
overflow- where their stats go- Returns:
- this builder
-
perHostClusters
Whether each server a direct connection goes to is a cluster of its own, namedhost_port(default false: they all aredirect). A forward proxy's servers are any number:maxClustersbounds them.- Parameters:
perHost- whether servers are clusters of their own- Returns:
- this builder
-
maxScriptStats
How many stats scripts may make (default 100); past that, a script's new stats do nothing.- Parameters:
max- the most script stats- Returns:
- this builder
- Throws:
IllegalArgumentException- if it is negative
-
histogramBounds
The bucket bounds of histograms registered without bounds of their own (default Envoy's,Histogram.defaultBounds()).- Parameters:
bounds- the upper bounds, ascending and finite- Returns:
- this builder
- Throws:
IllegalArgumentException- if they are not ascending and finite
-
build
Returns a new registry with these settings.- Returns:
- a new registry with these settings
-