Package io.smallrye.metrics.exporters
Class OpenMetricsUnit
- java.lang.Object
-
- io.smallrye.metrics.exporters.OpenMetricsUnit
-
public class OpenMetricsUnit extends Object
- Author:
- hrupp
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetBaseUnitAsOpenMetricsString(Optional<String> optUnit)Determines the basic unit to be used by OpenMetrics exporter based on the input unit from parameter.static DoublescaleToBase(String inputUnit, Double value)Scales the value (time or memory size) interpreted using inputUnit to the base unit for OpenMetrics exporter That means: - values for memory size units are scaled to bytes - values for time units are scaled to seconds - values for other units are returned unchanged
-
-
-
Method Detail
-
getBaseUnitAsOpenMetricsString
public static String getBaseUnitAsOpenMetricsString(Optional<String> optUnit)
Determines the basic unit to be used by OpenMetrics exporter based on the input unit from parameter. That is: - for memory size units, returns "bytes" - for time units, returns "seconds" - for any other unit, returns the input unit itself
-
scaleToBase
public static Double scaleToBase(String inputUnit, Double value)
Scales the value (time or memory size) interpreted using inputUnit to the base unit for OpenMetrics exporter That means: - values for memory size units are scaled to bytes - values for time units are scaled to seconds - values for other units are returned unchanged
-
-