Top Description Methods
org.eclipse.microprofile.metrics

public Interface Gauge<T extends Number>

extends Metric
Annotations
@FunctionalInterface
Type Parameters
<T>
the type of the metric's value. Must be numeric.

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 getValue() {
        return queue.size();
    }
};

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

the metric's current value
getValue
()

Returns the metric's current value.

Method Detail

getValueback to summary
public T getValue()

Returns the metric's current value.

Returns:T

the metric's current value