mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
grpc-js: Fix mean calculation in outlier detection LB policy
This commit is contained in:
parent
6360a6c90c
commit
db65d566e6
@ -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