Package io.grpc.services
Class MetricRecorderHelper
- java.lang.Object
-
- io.grpc.services.MetricRecorderHelper
-
final class MetricRecorderHelper extends java.lang.ObjectUtility helper class to check whether values forCallMetricRecorderandMetricRecorderare inside the valid range.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateMetricRecorderHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static booleanisCpuOrApplicationUtilizationValid(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 booleanisRateValid(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 booleanisUtilizationValid(double utilization)Return true if the utilization value is in the range [0, 1] and false otherwise.
-
-
-
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.
-
-