Skip to content

Commit 02bc246

Browse files
committed
CA-189076: Make sure perfmon wait at least the defined interval
With the current implementation, perfmon's actual idle intervals are between (defined_value - some_dither) and (defined_value + some_dither). It means that there are close to 50% cases where the actual idle/waiting periods are smaller than the defined value. This triggered an edge cases on alarm generation. When the alarm inhibite period is the same as perfmon's defined interval (i.e. the 5 min minimum), there are good chances that many alarms would be deferred until the next iteration as the inhibit period since last alarm has not fully expired (even though quite close). In cases where the same alarm should be generated continuously (at each iteration), the proportion of missing alarms would appear to be very high. This change makes sure that the actual waiting interval of perfmon covers at least the defined value. Signed-off-by: Zheng Li <[email protected]>
1 parent 31d8ea9 commit 02bc246

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/perfmon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,8 +1154,8 @@ def main():
11541154
# trust GC to do it on its own
11551155
gc.collect()
11561156

1157-
# Sleep for interval +/- dither, exiting early if we recv a cmd
1158-
timeout = rand(interval - dither, interval + dither)
1157+
# Sleep for interval + dither, exiting early if we recv a cmd
1158+
timeout = rand(interval, interval + dither)
11591159
cmdsock.settimeout(timeout)
11601160
try:
11611161
cmd = cmdsock.recv(cmdmaxlen)

0 commit comments

Comments
 (0)