Class MicrometerUtils
java.lang.Object
com.gigaspaces.metrics.micrometer.MicrometerUtils
Utility methods for working with Micrometer meters.
This class provides common operations needed when extracting values from Micrometer's various meter types, particularly for legacy reporter compatibility and snapshot generation.
- Since:
- 17.1.4
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectgetMeterValue(io.micrometer.core.instrument.Meter meter) Extracts the numeric value from a Micrometer meter.
-
Method Details
-
getMeterValue
Extracts the numeric value from a Micrometer meter.This method handles all standard Micrometer meter types and provides consistent value extraction logic used by both the legacy reporter bridge and snapshot generation.
Supported meter types:
Counter- Returns count as longGauge- Returns value as long (with NaN/Infinite checks)Timer- Returns countDistributionSummary- Returns countLongTaskTimer- Returns active tasksFunctionCounter- Returns count as longFunctionTimer- Returns countTimeGauge- Returns value as long (with NaN/Infinite checks)
Invalid value handling:
Returnsnullfor:- Gauge values that are NaN or Infinite
- TimeGauge values that are NaN or Infinite
- Unsupported meter types
- Parameters:
meter- The Micrometer meter to extract value from- Returns:
- The numeric value from the meter, or
nullif the meter type is unsupported or the value is invalid (NaN/Infinite for gauges) - See Also:
-
CounterGaugeTimer
-