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 java.lang.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 Modifier and Type Field Description private OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig
config
private ChannelLogger
logger
-
Constructor Summary
Constructors Constructor Description SuccessRateOutlierEjectionAlgorithm(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config, ChannelLogger logger)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
ejectOutliers(OutlierDetectionLoadBalancer.EndpointTrackerMap trackerMap, long ejectionTimeNanos)
Eject any outlier addresses.(package private) static double
mean(java.util.Collection<java.lang.Double> values)
Calculates the mean of the given values.(package private) static double
standardDeviation(java.util.Collection<java.lang.Double> values, double mean)
Calculates the standard deviation for the given values and their mean.
-
-
-
Field Detail
-
config
private final OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config
-
logger
private final ChannelLogger logger
-
-
Constructor Detail
-
SuccessRateOutlierEjectionAlgorithm
SuccessRateOutlierEjectionAlgorithm(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config, ChannelLogger logger)
-
-
Method Detail
-
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
static double mean(java.util.Collection<java.lang.Double> values)
Calculates the mean of the given values.
-
standardDeviation
static double standardDeviation(java.util.Collection<java.lang.Double> values, double mean)
Calculates the standard deviation for the given values and their mean.
-
-