Package io.grpc.util
Class OutlierDetectionLoadBalancer.SuccessRateOutlierEjectionAlgorithm
java.lang.Object
io.grpc.util.OutlierDetectionLoadBalancer.SuccessRateOutlierEjectionAlgorithm
- All Implemented Interfaces:
OutlierDetectionLoadBalancer.OutlierEjectionAlgorithm
- Enclosing class:
OutlierDetectionLoadBalancer
static class OutlierDetectionLoadBalancer.SuccessRateOutlierEjectionAlgorithm
extends Object
implements OutlierDetectionLoadBalancer.OutlierEjectionAlgorithm
This algorithm ejects addresses that don't maintain a required rate of successful calls. The
required rate is not fixed, but is based on the mean and standard deviation of the success
rates of all of the addresses.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSuccessRateOutlierEjectionAlgorithm
(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config, ChannelLogger logger) -
Method Summary
Modifier and TypeMethodDescriptionvoid
ejectOutliers
(OutlierDetectionLoadBalancer.EndpointTrackerMap trackerMap, long ejectionTimeNanos) Eject any outlier addresses.(package private) static double
mean
(Collection<Double> values) Calculates the mean of the given values.(package private) static double
standardDeviation
(Collection<Double> values, double mean) Calculates the standard deviation for the given values and their mean.
-
Field Details
-
config
-
logger
-
-
Constructor Details
-
SuccessRateOutlierEjectionAlgorithm
SuccessRateOutlierEjectionAlgorithm(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config, ChannelLogger logger)
-
-
Method Details
-
ejectOutliers
public void ejectOutliers(OutlierDetectionLoadBalancer.EndpointTrackerMap trackerMap, long ejectionTimeNanos) Description copied from interface:OutlierDetectionLoadBalancer.OutlierEjectionAlgorithm
Eject any outlier addresses.- Specified by:
ejectOutliers
in interfaceOutlierDetectionLoadBalancer.OutlierEjectionAlgorithm
-
mean
Calculates the mean of the given values. -
standardDeviation
Calculates the standard deviation for the given values and their mean.
-