Interface MeterRegistry
public interface MeterRegistry
A meter registry akin to micrometer.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents the configuration of the registry. -
Method Summary
Modifier and TypeMethodDescriptionconfig()Returns the registry configuration.Tracks a monotonically increasing value.<T extends Number>
TRegister a gauge that reports the value of theNumber.getCounter(String name) Returns the counter of the specified name.Returns the gauge of the specified name.Returns the meter of the specified name.Returns the meter of the specified name matching the given tags.Returns the registered meters.Returns the timer of the specified name.Measures the time taken for short tasks and the count of these tasks.
-
Method Details
-
config
MeterRegistry.Config config()Returns the registry configuration.- Returns:
- A configuration object used to change the behavior of this registry.
-
remove
Remove aMeterfrom thisregistry. This is expected to be aMeterwith the sameMeter.Idreturned when registering a meter - which will haveMeterFilters applied to it.- Parameters:
meter- The meter to remove- Returns:
- The removed meter (may not be the same instance as registered before), or null if the provided meter is not currently registered.
-
remove
Remove aMeterfrom thisregistry. This is expected to be aMeterwith the sameMeter.Idreturned when registering a meter - which will haveMeterFilters applied to it. May affect multiple meters as tags not specified here.- Parameters:
name- the name of the meter to remove- Returns:
- The removed meter (may not be the same instance as registered before), or null if the provided meter is not currently registered.
-
remove
Remove aMeterfrom thisregistrybased the givenMeter.Idas-is. The registry'sMeterFilters will not be applied to it. You can use theMeter.Idof theMeterreturned when registering a meter, since that will haveMeterFilters already applied to it.- Parameters:
id- The id of the meter to remove- Returns:
- The removed meter, or null if no meter matched the provided id
-
getMeter
Returns the meter of the specified name.- Parameters:
name- the name- Returns:
- the meter, may not be the same instance as returned before, may be null for none
-
getMeter
Returns the meter of the specified name matching the given tags.- Parameters:
name- the name- Returns:
- the meter, may not be the same instance as returned before, may be null for none
-
getGauge
Returns the gauge of the specified name.- Parameters:
name- the name- Returns:
- the gauge, may be null for none
-
getCounter
Returns the counter of the specified name.- Parameters:
name- the name- Returns:
- the counter, may be null for none
-
getTimer
Returns the timer of the specified name.- Parameters:
name- the name- Returns:
- the timer, may be null for none
-
gauge
Register a gauge that reports the value of theNumber.- Type Parameters:
T- The type of the state object from which the gauge value is extracted.- Parameters:
name- Name of the gauge being registered.number- Thread-safe implementation ofNumberused to access the value.- Returns:
- The number that was passed in so the registration can be done as part of an assignment statement.
-
counter
Tracks a monotonically increasing value.- Parameters:
name- The base metric nametags- MUST be an even number of arguments representing key/value pairs of tags.- Returns:
- A new or existing counter.
-
timer
Measures the time taken for short tasks and the count of these tasks.- Parameters:
name- The base metric nametags- MUST be an even number of arguments representing key/value pairs of tags.- Returns:
- A new or existing timer.
-
getMeters
Returns the registered meters.- Returns:
- the registered meters.
-