diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-30 18:47:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-30 18:47:00 +0000 |
commit | 03bf87dcb06f7021bfb2df2fa8691593c6148aff (patch) | |
tree | e16b06711a2ed77cafb4b7754be0220c3d14a9d7 /collectors/idlejitter.plugin | |
parent | Adding upstream version 1.36.1. (diff) | |
download | netdata-03bf87dcb06f7021bfb2df2fa8691593c6148aff.tar.xz netdata-03bf87dcb06f7021bfb2df2fa8691593c6148aff.zip |
Adding upstream version 1.37.0.upstream/1.37.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/idlejitter.plugin')
-rw-r--r-- | collectors/idlejitter.plugin/plugin_idlejitter.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/collectors/idlejitter.plugin/plugin_idlejitter.c b/collectors/idlejitter.plugin/plugin_idlejitter.c index 535819c69..b6339cc0f 100644 --- a/collectors/idlejitter.plugin/plugin_idlejitter.c +++ b/collectors/idlejitter.plugin/plugin_idlejitter.c @@ -47,18 +47,15 @@ void *cpuidlejitter_main(void *ptr) { usec_t update_every_ut = localhost->rrd_update_every * USEC_PER_SEC; struct timeval before, after; - unsigned long long counter; - for(counter = 0; 1 ;counter++) { + while (!netdata_exit) { int iterations = 0; usec_t error_total = 0, error_min = 0, error_max = 0, elapsed = 0; - if(netdata_exit) break; - - while(elapsed < update_every_ut) { + while (elapsed < update_every_ut) { now_monotonic_high_precision_timeval(&before); worker_is_idle(); sleep_usec(sleep_ut); @@ -82,10 +79,7 @@ void *cpuidlejitter_main(void *ptr) { iterations++; } - if(netdata_exit) break; - if(iterations) { - if (likely(counter)) rrdset_next(st); rrddim_set_by_pointer(st, rd_min, error_min); rrddim_set_by_pointer(st, rd_max, error_max); rrddim_set_by_pointer(st, rd_avg, error_total / iterations); |