summaryrefslogtreecommitdiff
path: root/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go
diff options
context:
space:
mode:
authorKubeEdge Bot <48982446+kubeedge-bot@users.noreply.github.com>2024-07-11 10:16:54 +0800
committerGitHub <noreply@github.com>2024-07-11 10:16:54 +0800
commit530bedfb151c4d1ac226c14a332fde59c7f2266c (patch)
tree3ec616656344be9013c26929e03347bb12c35c82 /vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go
parentMerge pull request #5545 from luomengY/automated-cherry-pick-of-#5467-upstrea... (diff)
parentupdate k8s version to v1.27.15 in CI (diff)
downloadkubeedge-530bedfb151c4d1ac226c14a332fde59c7f2266c.tar.gz
Merge pull request #5699 from Shelley-BaoYue/bump-k8s-v1.27.15
Bump k8s from v1.27.7 to v1.27.15
Diffstat (limited to 'vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go')
-rw-r--r--vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go b/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go
index 51eb218bd..a64c07f46 100644
--- a/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go
+++ b/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go
@@ -264,9 +264,15 @@ type seatDemandStats struct {
}
func (stats *seatDemandStats) update(obs fq.IntegratorResults) {
+ stats.highWatermark = obs.Max
+ if obs.Duration <= 0 {
+ return
+ }
+ if math.IsNaN(obs.Deviation) {
+ obs.Deviation = 0
+ }
stats.avg = obs.Average
stats.stdDev = obs.Deviation
- stats.highWatermark = obs.Max
envelope := obs.Average + obs.Deviation
stats.smoothed = math.Max(envelope, seatDemandSmoothingCoefficient*stats.smoothed+(1-seatDemandSmoothingCoefficient)*envelope)
}