Setup a Gauge.Builder that will create a gauge that reports the size of the Map.
The collection implementation used should be thread safe. Note that calling
Map.size() can be expensive for some collection implementations
and should be considered before registering.
Type Parameters:
T - The type of the state object from which the gauge value is extracted.
Setup a Gauge.Builder that will create a gauge that reports the size of the Collection.
The collection implementation used should be thread safe. Note that calling
Collection.size() can be expensive for some collection implementations
and should be considered before registering.
Type Parameters:
T - The type of the state object from which the gauge value is extracted.
Parameters:
name - Name of the gauge being registered.
collection - Thread-safe implementation of Collection used to access the value.
Setup a Gauge.Builder that will create a gauge that reports the size of the Map.
The collection implementation used should be thread safe. Note that calling
Map.size() can be expensive for some collection implementations
and should be considered before registering.
Type Parameters:
T - The type of the state object from which the gauge value is extracted.
Parameters:
name - Name of the gauge being registered.
map - Thread-safe implementation of Map used to access the value.
Returns the current value. The act of observing the value by calling this method triggers sampling
of the underlying number or user-defined function that defines the value for the gauge.
Get a set of measurements. Should always return the same number of measurements and in
the same order, regardless of the level of activity or the lack thereof.