X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=src%2Fplugin_idlejitter.c;h=2ed78160c93bed78b8d8aea3b63fe08b6734c686;hb=b428238a72b11dc13bbe87257a53ae97f536d513;hp=2d08e02ddf5cc6a877aa3e81a2cdbfbd93548826;hpb=32fe91cb025e0f53e9430b4bf55d97f8c6f2a15d;p=netdata.git diff --git a/src/plugin_idlejitter.c b/src/plugin_idlejitter.c index 2d08e02d..2ed78160 100644 --- a/src/plugin_idlejitter.c +++ b/src/plugin_idlejitter.c @@ -19,10 +19,11 @@ void *cpuidlejitter_main(void *ptr) { sleep_ms = CPU_IDLEJITTER_SLEEP_TIME_MS; } - RRDSET *st = rrdset_find("system.idlejitter"); + RRDSET *st = rrdset_find_localhost("system.idlejitter"); if(!st) { - st = rrdset_create("system", "idlejitter", NULL, "processes", NULL, "CPU Idle Jitter", "microseconds lost/s", 9999, rrd_update_every, RRDSET_TYPE_LINE); - rrddim_add(st, "jitter", NULL, 1, 1, RRDDIM_ABSOLUTE); + st = rrdset_create_localhost("system", "idlejitter", NULL, "processes", NULL, "CPU Idle Jitter" + , "microseconds lost/s", 9999, localhost->rrd_update_every, RRDSET_TYPE_LINE); + rrddim_add(st, "jitter", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); } struct timeval before, after; @@ -30,7 +31,9 @@ void *cpuidlejitter_main(void *ptr) { for(counter = 0; 1 ;counter++) { usec_t usec = 0, susec = 0; - while(susec < (rrd_update_every * USEC_PER_SEC)) { + if(netdata_exit) break; + + while(susec < (localhost->rrd_update_every * USEC_PER_SEC)) { now_monotonic_timeval(&before); sleep_usec(sleep_ms * 1000);