[improvement](backend balance) improve capacity cofficient of be load score (#26874)

This commit is contained in:
yujun
2023-11-13 21:51:31 +08:00
committed by GitHub
parent 4ecaa921f9
commit f4d5e6dd55

View File

@ -380,12 +380,12 @@ public class BackendLoadStatistic {
// the return cofficient:
// 1. percent <= percentLowWatermark: cofficient = 0.5;
// 2. percentLowWatermark < percent < percentHighWatermark: cofficient linear increase from 0.5 to 1.0;
// 3. percent >= percentHighWatermark: cofficient = 1.0;
// 2. percentLowWatermark < percent < percentHighWatermark: cofficient linear increase from 0.5 to 0.99;
// 3. percent >= percentHighWatermark: cofficient = 0.99;
public static double getSmoothCofficient(double percent, double percentLowWatermark,
double percentHighWatermark) {
final double lowCofficient = 0.5;
final double highCofficient = 1.0;
final double highCofficient = 0.99;
// low watermark and high watermark equal, then return 0.75
if (Math.abs(percentHighWatermark - percentLowWatermark) < 1e-6) {