Class MetricRecorderHelper


  • final class MetricRecorderHelper
    extends java.lang.Object
    Utility helper class to check whether values for CallMetricRecorder and MetricRecorder are inside the valid range.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static boolean isCpuOrApplicationUtilizationValid​(double utilization)
      Return true if the cpu utilization or application specific utilization value is in the range [0, inf) and false otherwise.
      (package private) static boolean isRateValid​(double rate)
      Return true if a rate value (such as qps or eps) is in the range [0, inf) and false otherwise.
      (package private) static boolean isUtilizationValid​(double utilization)
      Return true if the utilization value is in the range [0, 1] and false otherwise.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MetricRecorderHelper

        private MetricRecorderHelper()
    • Method Detail

      • isUtilizationValid

        static boolean isUtilizationValid​(double utilization)
        Return true if the utilization value is in the range [0, 1] and false otherwise.
      • isCpuOrApplicationUtilizationValid

        static boolean isCpuOrApplicationUtilizationValid​(double utilization)
        Return true if the cpu utilization or application specific utilization value is in the range [0, inf) and false otherwise. Occasionally users have over 100% cpu utilization and get a runaway effect where the backend with highest qps gets more and more qps sent to it. So we allow cpu utilization > 1.0, similarly for application specific utilization.
      • isRateValid

        static boolean isRateValid​(double rate)
        Return true if a rate value (such as qps or eps) is in the range [0, inf) and false otherwise.