mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
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:
commit
37dde5c960
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user