Package org.microproxy.stats
Interface Gauge
- All Superinterfaces:
Metric
A value that goes up and down, such as
downstream_cx_active. Gauges made by a registry
hold an AtomicLong, or read a supplier when the value lives
elsewhere (StatsRegistry.gauge(String, String, java.util.function.LongSupplier)), which
cannot be changed through the gauge; those of StatsRegistry.NOOP do nothing.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.microproxy.stats.Metric
Metric.Type -
Method Summary
Methods inherited from interface org.microproxy.stats.Metric
help, name, tagExtractedName, tags
-
Method Details
-
set
void set(long value) Sets the value.- Parameters:
value- the new value- Throws:
UnsupportedOperationException- for a gauge that reads a supplier
-
add
void add(long delta) Addsdelta, which may be negative.- Parameters:
delta- how much to add- Throws:
UnsupportedOperationException- for a gauge that reads a supplier
-
inc
default void inc()Adds one.- Throws:
UnsupportedOperationException- for a gauge that reads a supplier
-
dec
default void dec()Subtracts one.- Throws:
UnsupportedOperationException- for a gauge that reads a supplier
-
value
long value()Returns the current value.- Returns:
- the current value
-
type
Description copied from interface:MetricReturns what kind of metric this is.
-