Package org.apache.pinot.spi.metrics
Interface PinotGauge<T>
-
- Type Parameters:
T- the type of the metric's value
- All Superinterfaces:
PinotMetric,SettableValue<T>
public interface PinotGauge<T> extends PinotMetric, SettableValue<T>
A gauge metric is an instantaneous reading of a particular value. To instrument a queue's depth, for example:
final Queue<String> queue = new ConcurrentLinkedQueue<String>(); final Gauge<Integer> queueDepth = new Gauge<Integer>() { public Integer value() { return queue.size(); } };
-
-
Method Summary
-
Methods inherited from interface org.apache.pinot.spi.metrics.PinotMetric
getMetric
-
-
-
-
Method Detail
-
getGauge
Object getGauge()
-
setValue
default void setValue(T value)
Description copied from interface:SettableValueSets the value.- Specified by:
setValuein interfaceSettableValue<T>- Parameters:
value- the value to set.
-
setValueSupplier
default void setValueSupplier(Supplier<T> valueSupplier)
Description copied from interface:SettableValueSets the value supplier.- Specified by:
setValueSupplierin interfaceSettableValue<T>- Parameters:
valueSupplier- the value supplier to set.
-
value
T value()
Returns the metric's current value.- Returns:
- the metric's current value
-
-