- Type Parameters:
N- subtype ofNumberwhich a specific gauge reports
Measures a value that can increase or decrease and is updated by external logic, not by explicit invocations
of methods on this type.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceGauge.Builder<N extends Number>Builder for a new gauge.Nested classes/interfaces inherited from interface io.helidon.metrics.api.Meter
Meter.BaseUnits, Meter.Id, Meter.Scope, Meter.Type -
Method Summary
Modifier and TypeMethodDescriptionstatic <N extends Number>
Gauge.Builder<N> Creates a builder for a supplier-based gauge.static <T> Gauge.Builder<Double> builder(String name, T stateObject, ToDoubleFunction<T> fn) Creates a builder for creating a new gauge based on applying a function to a state object.value()Returns the value of the gauge.
-
Method Details
-
builder
Creates a builder for creating a new gauge based on applying a function to a state object.- Type Parameters:
T- type of the state object- Parameters:
name- gauge namestateObject- state object which maintains the gauge valuefn- function which, when applied to the state object, returns the gauge value- Returns:
- new builder
-
builder
Creates a builder for a supplier-based gauge. -
value
N value()Returns the value of the gauge.Invoking this method triggers the sampling of the value or invocation of the function provided when the gauge was registered.
- Returns:
- current value of the gauge
-