Class OpenMetricsUnit


  • public class OpenMetricsUnit
    extends Object
    Author:
    hrupp
    • 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