Package io.grpc.services
Class MetricRecorderHelper
java.lang.Object
io.grpc.services.MetricRecorderHelper
Utility helper class to check whether values for
CallMetricRecorder
and
MetricRecorder
are inside the valid range.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(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.
-
Constructor Details
-
MetricRecorderHelper
private MetricRecorderHelper()
-
-
Method Details
-
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.
-