X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=src%2Fplugin_idlejitter.c;h=2ed78160c93bed78b8d8aea3b63fe08b6734c686;hb=14c7c7206eef181f536464bf4e206d568466728f;hp=23fb4c9d984460515cda5e2d8b786941ea15d499;hpb=bb6da9c67e6ee7a257f764d2d3e26cc0a276e5c7;p=netdata.git diff --git a/src/plugin_idlejitter.c b/src/plugin_idlejitter.c index 23fb4c9d..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_ALGORITHM_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);