You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: manager/container.go
+21-6Lines changed: 21 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -47,9 +47,13 @@ import (
47
47
"k8s.io/utils/clock"
48
48
)
49
49
50
+
constjitterDefault=1.0
51
+
50
52
// Housekeeping interval.
51
53
varenableLoadReader=flag.Bool("enable_load_reader", false, "Whether to enable cpu load reader")
52
54
varHousekeepingInterval=flag.Duration("housekeeping_interval", 1*time.Second, "Interval between container housekeepings")
55
+
varInitialSplayFactor=flag.Float64("initial_splay_factor", jitterDefault, "Factor for the initial splay b/w the container housekeepings, default is 1.0. If negative value is passed, the value will be reset to default")
56
+
varJitterFactor=flag.Float64("jitter_factor", jitterDefault, "Factor for the jitters after the initial splay b/w the container housekeepings, default is 1.0. If negative value is passed, the value will be reset to default")
53
57
54
58
// TODO: replace regular expressions with something simpler, such as strings.Split().
55
59
// cgroup type chosen to fetch the cgroup path of a process.
@@ -91,6 +95,9 @@ type containerData struct {
91
95
housekeepingInterval time.Duration
92
96
maxHousekeepingInterval time.Duration
93
97
allowDynamicHousekeepingbool
98
+
firstHousekeepingbool
99
+
initialSplayFactorfloat64
100
+
jitterFactorfloat64
94
101
infoLastUpdatedTimeatomicTime// Unix nano
95
102
statsLastUpdatedTimeatomicTime// Unix nano
96
103
lastErrorTime time.Time
@@ -121,11 +128,11 @@ type containerData struct {
121
128
}
122
129
123
130
// jitter returns a time.Duration between duration and duration + maxFactor * duration,
124
-
// to allow clients to avoid converging on periodic behavior. If maxFactor is 0.0, a
125
-
// suggested default value will be chosen.
131
+
// to allow clients to avoid converging on periodic behavior. If maxFactor is 0.0, no
132
+
// jitter is applied. If maxFactor is negative, a suggested default value will be chosen.
0 commit comments