Merge pull request #2108 from murgatroid99/outlier_detection_mean_fix

grpc-js: Fix mean calculation in outlier detection LB policy
This commit is contained in:
Michael Lumish 2022-04-26 12:07:38 -07:00 committed by GitHub
commit 37dde5c960
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -429,7 +429,7 @@ export class OutlierDetectionLoadBalancer implements LoadBalancer {
}
// Step 2
const successRateMean = successRates.reduce((a, b) => a + b);
const successRateMean = successRates.reduce((a, b) => a + b) / successRates.length;
let successRateVariance = 0;
for (const rate of successRates) {
const deviation = rate - successRateMean;