Package org.microproxy.stats
Class StatsScope
java.lang.Object
org.microproxy.stats.StatsScope
Metrics named
<prefix>.<name> whose names come from outside the proxy, such as a
script's (script.<name>), and of which there may be at most a fixed number: past it, new
names get metrics that do nothing (and a warning is logged once), so their number stays bounded
whatever names are asked for. Names already made keep working. Made by StatsRegistry.scope(java.lang.String, int).-
Method Summary
Modifier and TypeMethodDescriptionThe counter<prefix>.<name>, made the first time while there is room.The gauge<prefix>.<name>, made the first time while there is room.The histogram<prefix>.<name>, with the registry's bounds, made the first time while there is room.intmaxStats()Returns how many metrics the scope may make.prefix()Returns the prefix of this scope's names.intsize()Returns how many metrics the scope has made.
-
Method Details
-
prefix
Returns the prefix of this scope's names.- Returns:
- the prefix of this scope's names
-
maxStats
public int maxStats()Returns how many metrics the scope may make.- Returns:
- how many metrics the scope may make
-
size
public int size()Returns how many metrics the scope has made.- Returns:
- how many metrics the scope has made
-
counter
The counter<prefix>.<name>, made the first time while there is room.- Parameters:
name- the name within the scope- Returns:
- the counter, or one that does nothing once the scope is full
- Throws:
IllegalArgumentException- if the name is not valid, or names a metric of another kind
-
gauge
The gauge<prefix>.<name>, made the first time while there is room.- Parameters:
name- the name within the scope- Returns:
- the gauge, or one that does nothing once the scope is full
- Throws:
IllegalArgumentException- if the name is not valid, or names a metric of another kind
-
histogram
The histogram<prefix>.<name>, with the registry's bounds, made the first time while there is room.- Parameters:
name- the name within the scope- Returns:
- the histogram, or one that does nothing once the scope is full
- Throws:
IllegalArgumentException- if the name is not valid, or names a metric of another kind
-