diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-30 18:47:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-30 18:47:05 +0000 |
commit | 97e01009d69b8fbebfebf68f51e3d126d0ed43fc (patch) | |
tree | 02e8b836c3a9d89806f3e67d4a5fe9f52dbb0061 /collectors/idlejitter.plugin | |
parent | Releasing debian version 1.36.1-1. (diff) | |
download | netdata-97e01009d69b8fbebfebf68f51e3d126d0ed43fc.tar.xz netdata-97e01009d69b8fbebfebf68f51e3d126d0ed43fc.zip |
Merging upstream version 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); |