From: Costa Tsaousis (ktsaou) Date: Wed, 25 Nov 2015 23:30:57 +0000 (+0200) Subject: fixed a bug in the incremental calculations where the exact duration (in nanoseconds... X-Git-Tag: v1.0rc~236 X-Git-Url: https://arthur.barton.de/gitweb/?p=netdata.git;a=commitdiff_plain;h=171a60571572067aad59fbee9f975b05b8663001 fixed a bug in the incremental calculations where the exact duration (in nanoseconds) between incremental updates was not taken into account, so the values were always calculated using the pre-agreed update_every duration --- diff --git a/charts.d/airsearches.chart.sh b/charts.d/airsearches.chart.sh index c3ff22f3..449b1425 100755 --- a/charts.d/airsearches.chart.sh +++ b/charts.d/airsearches.chart.sh @@ -57,7 +57,7 @@ airsearches_create() { echo "CHART airsearches.affiliates '' 'Air Searches per affiliate' 'requests / min' airsearches '' stacked 20000 $airsearches_update_every" for x in $airsearches_cmds do - echo "DIMENSION $x '' incremental 60 $airsearches_update_every" + echo "DIMENSION $x '' incremental 60 1" done return 0 diff --git a/charts.d/cpu_apps.chart.sh b/charts.d/cpu_apps.chart.sh index d0165ad3..879cbbdd 100755 --- a/charts.d/cpu_apps.chart.sh +++ b/charts.d/cpu_apps.chart.sh @@ -34,7 +34,7 @@ cpu_apps_create() { local x= for x in $cpu_apps_apps do - echo "DIMENSION $x $x incremental 1000 $((cpu_apps_clockticks * cpu_apps_update_every))" + echo "DIMENSION $x $x incremental 1000 $cpu_apps_clockticks" # this string is needed later in the update() function # to finalize the instructions for the bc command diff --git a/charts.d/crsproxy.chart.sh b/charts.d/crsproxy.chart.sh index f3f9c6df..fc5358b4 100755 --- a/charts.d/crsproxy.chart.sh +++ b/charts.d/crsproxy.chart.sh @@ -54,18 +54,18 @@ DIMENSION web '' absolute 1 1 DIMENSION native '' absolute 1 1 DIMENSION virtual '' absolute 1 1 CHART crsproxy.requests '' "CRS Proxy Requests Rate" "requests / min" crsproxy '' area 20001 $crsproxy_update_every -DIMENSION web '' incremental 60 $crsproxy_update_every -DIMENSION native '' incremental -60 $crsproxy_update_every +DIMENSION web '' incremental 60 1 +DIMENSION native '' incremental -60 1 CHART crsproxy.clients '' "CRS Proxy Clients Rate" "clients / min" crsproxy '' area 20010 $crsproxy_update_every -DIMENSION web '' incremental 60 $crsproxy_update_every -DIMENSION native '' incremental -60 $crsproxy_update_every -DIMENSION virtual '' incremental 60 $crsproxy_update_every +DIMENSION web '' incremental 60 1 +DIMENSION native '' incremental -60 1 +DIMENSION virtual '' incremental 60 1 CHART crsproxy.replies '' "CRS Replies Rate" "replies / min" crsproxy '' area 20020 $crsproxy_update_every -DIMENSION ok '' incremental 60 $crsproxy_update_every -DIMENSION failed '' incremental -60 $crsproxy_update_every +DIMENSION ok '' incremental 60 1 +DIMENSION failed '' incremental -60 1 CHART crsproxy.bconnections '' "Back-End Connections Rate" "connections / min" crsproxy '' area 20030 $crsproxy_update_every -DIMENSION ok '' incremental 60 $crsproxy_update_every -DIMENSION failed '' incremental -60 $crsproxy_update_every +DIMENSION ok '' incremental 60 1 +DIMENSION failed '' incremental -60 1 EOF local x= diff --git a/charts.d/mysql.chart.sh b/charts.d/mysql.chart.sh index ffd635ff..dda1e568 100755 --- a/charts.d/mysql.chart.sh +++ b/charts.d/mysql.chart.sh @@ -164,76 +164,76 @@ mysql_create() { do cat <next) { if(w->target || (!w->processes && !w->exposed)) continue; - fprintf(stdout, "DIMENSION %s '' incremental 100 %llu %s\n", w->name, (unsigned long long)(Hertz * update_every), w->hidden?"hidden,noreset":"noreset"); + fprintf(stdout, "DIMENSION %s '' incremental 100 %llu %s\n", w->name, (unsigned long long)(Hertz), w->hidden?"hidden,noreset":"noreset"); } fprintf(stdout, "CHART apps.mem '' 'Apps Dedicated Memory (w/o shared)' 'MB' apps apps stacked 20003 %d\n", update_every); @@ -1771,56 +1771,56 @@ void show_charts(void) for (w = target_root; w ; w = w->next) { if(w->target || (!w->processes && !w->exposed)) continue; - fprintf(stdout, "DIMENSION %s '' incremental 100 %llu noreset\n", w->name, Hertz * processors * update_every); + fprintf(stdout, "DIMENSION %s '' incremental 100 %llu noreset\n", w->name, Hertz * processors); } fprintf(stdout, "CHART apps.cpu_system '' 'Apps CPU System Time (%ld%% = %ld core%s)' 'cpu time %%' apps none stacked 20021 %d\n", (processors * 100), processors, (processors>1)?"s":"", update_every); for (w = target_root; w ; w = w->next) { if(w->target || (!w->processes && !w->exposed)) continue; - fprintf(stdout, "DIMENSION %s '' incremental 100 %llu noreset\n", w->name, Hertz * processors * update_every); + fprintf(stdout, "DIMENSION %s '' incremental 100 %llu noreset\n", w->name, Hertz * processors); } fprintf(stdout, "CHART apps.major_faults '' 'Apps Major Page Faults (swaps in)' 'page faults/s' apps apps stacked 20010 %d\n", update_every); for (w = target_root; w ; w = w->next) { if(w->target || (!w->processes && !w->exposed)) continue; - fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, update_every); + fprintf(stdout, "DIMENSION %s '' incremental 1 1 noreset\n", w->name); } fprintf(stdout, "CHART apps.minor_faults '' 'Apps Minor Page Faults' 'page faults/s' apps none stacked 20011 %d\n", update_every); for (w = target_root; w ; w = w->next) { if(w->target || (!w->processes && !w->exposed)) continue; - fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, update_every); + fprintf(stdout, "DIMENSION %s '' incremental 1 1 noreset\n", w->name); } fprintf(stdout, "CHART apps.lreads '' 'Apps Disk Logical Reads' 'kilobytes/s' apps none stacked 20042 %d\n", update_every); for (w = target_root; w ; w = w->next) { if(w->target || (!w->processes && !w->exposed)) continue; - fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024 * update_every); + fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024); } fprintf(stdout, "CHART apps.lwrites '' 'Apps I/O Logical Writes' 'kilobytes/s' apps none stacked 20042 %d\n", update_every); for (w = target_root; w ; w = w->next) { if(w->target || (!w->processes && !w->exposed)) continue; - fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024 * update_every); + fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024); } fprintf(stdout, "CHART apps.preads '' 'Apps Disk Reads' 'kilobytes/s' apps apps stacked 20002 %d\n", update_every); for (w = target_root; w ; w = w->next) { if(w->target || (!w->processes && !w->exposed)) continue; - fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024 * update_every); + fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024); } fprintf(stdout, "CHART apps.pwrites '' 'Apps Disk Writes' 'kilobytes/s' apps apps stacked 20002 %d\n", update_every); for (w = target_root; w ; w = w->next) { if(w->target || (!w->processes && !w->exposed)) continue; - fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024 * update_every); + fprintf(stdout, "DIMENSION %s '' incremental 1 %d noreset\n", w->name, 1024); } fprintf(stdout, "CHART apps.files '' 'Apps Open Files' 'open files' apps apps stacked 20050 %d\n", update_every); @@ -1845,11 +1845,11 @@ void show_charts(void) } fprintf(stdout, "CHART netdata.apps_cpu '' 'Apps Plugin CPU' 'milliseconds/s' netdata netdata stacked 10000 %d\n", update_every); - fprintf(stdout, "DIMENSION user '' incremental 1 %d\n", 1000 * update_every); - fprintf(stdout, "DIMENSION system '' incremental 1 %d\n", 1000 * update_every); + fprintf(stdout, "DIMENSION user '' incremental 1 %d\n", 1000); + fprintf(stdout, "DIMENSION system '' incremental 1 %d\n", 1000); fprintf(stdout, "CHART netdata.apps_files '' 'Apps Plugin Files' 'files/s' netdata netdata line 10001 %d\n", update_every); - fprintf(stdout, "DIMENSION files '' incremental 1 %d\n", update_every); + fprintf(stdout, "DIMENSION files '' incremental 1 1\n"); fprintf(stdout, "DIMENSION pids '' absolute 1 1\n"); fprintf(stdout, "DIMENSION fds '' absolute 1 1\n"); fprintf(stdout, "DIMENSION targets '' absolute 1 1\n"); diff --git a/src/plugin_checks.c b/src/plugin_checks.c index c8e1f75f..5d204a8f 100755 --- a/src/plugin_checks.c +++ b/src/plugin_checks.c @@ -32,11 +32,11 @@ void *checks_main(void *ptr) check1 = rrdset_create("netdata", "check1", NULL, "netdata", "Caller gives microseconds", "a million !", 99999, rrd_update_every, RRDSET_TYPE_LINE); rrddim_add(check1, "absolute", NULL, -1, 1, RRDDIM_ABSOLUTE); - rrddim_add(check1, "incremental", NULL, 1, 1 * rrd_update_every, RRDDIM_INCREMENTAL); + rrddim_add(check1, "incremental", NULL, 1, 1, RRDDIM_INCREMENTAL); check2 = rrdset_create("netdata", "check2", NULL, "netdata", "Netdata calcs microseconds", "a million !", 99999, rrd_update_every, RRDSET_TYPE_LINE); rrddim_add(check2, "absolute", NULL, -1, 1, RRDDIM_ABSOLUTE); - rrddim_add(check2, "incremental", NULL, 1, 1 * rrd_update_every, RRDDIM_INCREMENTAL); + rrddim_add(check2, "incremental", NULL, 1, 1, RRDDIM_INCREMENTAL); check3 = rrdset_create("netdata", "checkdt", NULL, "netdata", "Clock difference", "microseconds diff", 99999, rrd_update_every, RRDSET_TYPE_LINE); rrddim_add(check3, "caller", NULL, 1, 1, RRDDIM_ABSOLUTE); diff --git a/src/plugin_proc.c b/src/plugin_proc.c index 4201a6fb..91646eb7 100755 --- a/src/plugin_proc.c +++ b/src/plugin_proc.c @@ -136,8 +136,8 @@ void *proc_main(void *ptr) if(!stcpu_thread) { stcpu_thread = rrdset_create("netdata", "plugin_proc_cpu", NULL, "netdata", "NetData Proc Plugin CPU usage", "milliseconds/s", 9999, rrd_update_every, RRDSET_TYPE_STACKED); - rrddim_add(stcpu_thread, "user", NULL, 1, 1000 * rrd_update_every, RRDDIM_INCREMENTAL); - rrddim_add(stcpu_thread, "system", NULL, 1, 1000 * rrd_update_every, RRDDIM_INCREMENTAL); + rrddim_add(stcpu_thread, "user", NULL, 1, 1000, RRDDIM_INCREMENTAL); + rrddim_add(stcpu_thread, "system", NULL, 1, 1000, RRDDIM_INCREMENTAL); } else rrdset_next(stcpu_thread); @@ -151,8 +151,8 @@ void *proc_main(void *ptr) if(!stcpu) { stcpu = rrdset_create("netdata", "server_cpu", NULL, "netdata", "NetData CPU usage", "milliseconds/s", 2000, rrd_update_every, RRDSET_TYPE_STACKED); - rrddim_add(stcpu, "user", NULL, 1, 1000 * rrd_update_every, RRDDIM_INCREMENTAL); - rrddim_add(stcpu, "system", NULL, 1, 1000 * rrd_update_every, RRDDIM_INCREMENTAL); + rrddim_add(stcpu, "user", NULL, 1, 1000, RRDDIM_INCREMENTAL); + rrddim_add(stcpu, "system", NULL, 1, 1000, RRDDIM_INCREMENTAL); } else rrdset_next(stcpu); @@ -179,7 +179,7 @@ void *proc_main(void *ptr) if(!streqs) { streqs = rrdset_create("netdata", "requests", NULL, "netdata", "NetData Web Requests", "requests/s", 3001, rrd_update_every, RRDSET_TYPE_LINE); - rrddim_add(streqs, "requests", NULL, 1, 1 * rrd_update_every, RRDDIM_INCREMENTAL); + rrddim_add(streqs, "requests", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(streqs); @@ -192,8 +192,8 @@ void *proc_main(void *ptr) if(!stbytes) { stbytes = rrdset_create("netdata", "net", NULL, "netdata", "NetData Network Traffic", "kilobits/s", 3002, rrd_update_every, RRDSET_TYPE_AREA); - rrddim_add(stbytes, "in", NULL, 8, 1024 * rrd_update_every, RRDDIM_INCREMENTAL); - rrddim_add(stbytes, "out", NULL, -8, 1024 * rrd_update_every, RRDDIM_INCREMENTAL); + rrddim_add(stbytes, "in", NULL, 8, 1024, RRDDIM_INCREMENTAL); + rrddim_add(stbytes, "out", NULL, -8, 1024, RRDDIM_INCREMENTAL); } else rrdset_next(stbytes); diff --git a/src/plugin_tc.c b/src/plugin_tc.c index eeeadc95..2a7e9469 100755 --- a/src/plugin_tc.c +++ b/src/plugin_tc.c @@ -227,7 +227,7 @@ static void tc_device_commit(struct tc_device *d) if(!c->updated) continue; if(c->isleaf && c->hasparent) - rrddim_add(st, c->id, c->name?c->name:c->id, 8, 1024 * rrd_update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, c->id, c->name?c->name:c->id, 8, 1024, RRDDIM_INCREMENTAL); } } else { @@ -247,7 +247,7 @@ static void tc_device_commit(struct tc_device *d) debug(D_TC_LOOP, "TC: Adding to chart '%s', dimension '%s'", st->id, c->id, c->name); // new class, we have to add it - rd = rrddim_add(st, c->id, c->name?c->name:c->id, 8, 1024 * rrd_update_every, RRDDIM_INCREMENTAL); + rd = rrddim_add(st, c->id, c->name?c->name:c->id, 8, 1024, RRDDIM_INCREMENTAL); } else debug(D_TC_LOOP, "TC: Updating chart '%s', dimension '%s'", st->id, c->id); @@ -582,8 +582,8 @@ void *tc_main(void *ptr) if(!stcpu) stcpu = rrdset_find("netdata.plugin_tc_cpu"); if(!stcpu) { stcpu = rrdset_create("netdata", "plugin_tc_cpu", NULL, "netdata", "NetData TC CPU usage", "milliseconds/s", 10000, rrd_update_every, RRDSET_TYPE_STACKED); - rrddim_add(stcpu, "user", NULL, 1, 1000 * rrd_update_every, RRDDIM_INCREMENTAL); - rrddim_add(stcpu, "system", NULL, 1, 1000 * rrd_update_every, RRDDIM_INCREMENTAL); + rrddim_add(stcpu, "user", NULL, 1, 1000, RRDDIM_INCREMENTAL); + rrddim_add(stcpu, "system", NULL, 1, 1000, RRDDIM_INCREMENTAL); } else rrdset_next(stcpu); diff --git a/src/proc_diskstats.c b/src/proc_diskstats.c index d48b8bf9..4d16fd26 100755 --- a/src/proc_diskstats.c +++ b/src/proc_diskstats.c @@ -274,8 +274,8 @@ int do_proc_diskstats(int update_every, unsigned long long dt) { st = rrdset_create(RRD_TYPE_DISK, disk, NULL, disk, "Disk I/O Bandwidth", "kilobytes/s", 2000, update_every, RRDSET_TYPE_AREA); - rrddim_add(st, "reads", NULL, sector_size, 1024 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "writes", NULL, sector_size * -1, 1024 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "reads", NULL, sector_size, 1024, RRDDIM_INCREMENTAL); + rrddim_add(st, "writes", NULL, sector_size * -1, 1024, RRDDIM_INCREMENTAL); } else rrdset_next_usec(st, dt); @@ -292,8 +292,8 @@ int do_proc_diskstats(int update_every, unsigned long long dt) { st = rrdset_create("disk_ops", disk, NULL, disk, "Disk Completed I/O Operations", "operations/s", 2001, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "reads", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "writes", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "reads", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "writes", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next_usec(st, dt); @@ -326,7 +326,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) { st = rrdset_create("disk_backlog", disk, NULL, disk, "Disk Backlog", "backlog (ms)", 2003, update_every, RRDSET_TYPE_AREA); st->isdetail = 1; - rrddim_add(st, "backlog", NULL, 1, 10 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "backlog", NULL, 1, 10, RRDDIM_INCREMENTAL); } else rrdset_next_usec(st, dt); @@ -342,7 +342,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) { st = rrdset_create("disk_util", disk, NULL, disk, "Disk Utilization Time", "% of time working", 2004, update_every, RRDSET_TYPE_AREA); st->isdetail = 1; - rrddim_add(st, "utilization", NULL, 1, 10 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "utilization", NULL, 1, 10, RRDDIM_INCREMENTAL); } else rrdset_next_usec(st, dt); @@ -358,8 +358,8 @@ int do_proc_diskstats(int update_every, unsigned long long dt) { st = rrdset_create("disk_mops", disk, NULL, disk, "Disk Merged Operations", "merged operations/s", 2021, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "reads", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "writes", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "reads", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "writes", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next_usec(st, dt); @@ -376,8 +376,8 @@ int do_proc_diskstats(int update_every, unsigned long long dt) { st = rrdset_create("disk_iotime", disk, NULL, disk, "Disk Total I/O Time", "milliseconds/s", 2022, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "reads", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "writes", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "reads", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "writes", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next_usec(st, dt); diff --git a/src/proc_interrupts.c b/src/proc_interrupts.c index 1e811eaf..55427b8c 100755 --- a/src/proc_interrupts.c +++ b/src/proc_interrupts.c @@ -110,7 +110,7 @@ int do_proc_interrupts(int update_every, unsigned long long dt) { for(l = 0; l < lines ;l++) { if(!irrs[l].used) continue; - rrddim_add(st, irrs[l].id, irrs[l].name, 1, update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, irrs[l].id, irrs[l].name, 1, 1, RRDDIM_INCREMENTAL); } } else rrdset_next(st); @@ -137,7 +137,7 @@ int do_proc_interrupts(int update_every, unsigned long long dt) { for(l = 0; l < lines ;l++) { if(!irrs[l].used) continue; - rrddim_add(st, irrs[l].id, irrs[l].name, 1, update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, irrs[l].id, irrs[l].name, 1, 1, RRDDIM_INCREMENTAL); } } else rrdset_next(st); diff --git a/src/proc_net_dev.c b/src/proc_net_dev.c index 0bb97fa7..72e0ea91 100755 --- a/src/proc_net_dev.c +++ b/src/proc_net_dev.c @@ -83,8 +83,8 @@ int do_proc_net_dev(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create("net", iface, NULL, iface, "Bandwidth", "kilobits/s", 1000, update_every, RRDSET_TYPE_AREA); - rrddim_add(st, "received", NULL, 8, 1024 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -8, 1024 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -101,9 +101,9 @@ int do_proc_net_dev(int update_every, unsigned long long dt) { st = rrdset_create("net_packets", iface, NULL, iface, "Packets", "packets/s", 1001, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "received", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "multicast", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "multicast", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -121,8 +121,8 @@ int do_proc_net_dev(int update_every, unsigned long long dt) { st = rrdset_create("net_errors", iface, NULL, iface, "Interface Errors", "errors/s", 1002, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "inbound", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "outbound", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "inbound", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "outbound", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -139,8 +139,8 @@ int do_proc_net_dev(int update_every, unsigned long long dt) { st = rrdset_create("net_drops", iface, NULL, iface, "Interface Drops", "drops/s", 1003, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "inbound", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "outbound", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "inbound", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "outbound", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -175,8 +175,8 @@ int do_proc_net_dev(int update_every, unsigned long long dt) { st = rrdset_create("net_compressed", iface, NULL, iface, "Compressed Packets", "packets/s", 1200, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "received", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -193,9 +193,9 @@ int do_proc_net_dev(int update_every, unsigned long long dt) { st = rrdset_create("net_events", iface, NULL, iface, "Network Interface Events", "events/s", 1200, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "frames", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "collisions", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "carrier", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "frames", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "collisions", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "carrier", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); diff --git a/src/proc_net_ip_vs_stats.c b/src/proc_net_ip_vs_stats.c index 18114af2..b7fbec53 100755 --- a/src/proc_net_ip_vs_stats.c +++ b/src/proc_net_ip_vs_stats.c @@ -56,7 +56,7 @@ int do_proc_net_ip_vs_stats(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create(RRD_TYPE_NET_IPVS, "sockets", NULL, RRD_TYPE_NET_IPVS, "IPVS New Connections", "connections/s", 1001, update_every, RRDSET_TYPE_LINE); - rrddim_add(st, "connections", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "connections", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -71,8 +71,8 @@ int do_proc_net_ip_vs_stats(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create(RRD_TYPE_NET_IPVS, "packets", NULL, RRD_TYPE_NET_IPVS, "IPVS Packets", "packets/s", 1002, update_every, RRDSET_TYPE_LINE); - rrddim_add(st, "received", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -88,8 +88,8 @@ int do_proc_net_ip_vs_stats(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create(RRD_TYPE_NET_IPVS, "net", NULL, RRD_TYPE_NET_IPVS, "IPVS Bandwidth", "kilobits/s", 1000, update_every, RRDSET_TYPE_AREA); - rrddim_add(st, "received", NULL, 8, 1024 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -8, 1024 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL); } else rrdset_next(st); diff --git a/src/proc_net_netstat.c b/src/proc_net_netstat.c index 35535265..8f46c92e 100755 --- a/src/proc_net_netstat.c +++ b/src/proc_net_netstat.c @@ -79,8 +79,8 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create("system", "ipv4", NULL, "ipv4", "IPv4 Bandwidth", "kilobits/s", 2000, update_every, RRDSET_TYPE_AREA); - rrddim_add(st, "received", NULL, 8, 1024 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -8, 1024 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -97,8 +97,8 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) { st = rrdset_create("ipv4", "inerrors", NULL, "ipv4", "IPv4 Input Errors", "packets/s", 4000, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "noroutes", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "trunkated", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "noroutes", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "trunkated", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -115,8 +115,8 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) { st = rrdset_create("ipv4", "mcast", NULL, "ipv4", "IPv4 Multicast Bandwidth", "kilobits/s", 9000, update_every, RRDSET_TYPE_AREA); st->isdetail = 1; - rrddim_add(st, "received", NULL, 8, 1024 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -8, 1024 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -133,8 +133,8 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) { st = rrdset_create("ipv4", "bcast", NULL, "ipv4", "IPv4 Broadcast Bandwidth", "kilobits/s", 8000, update_every, RRDSET_TYPE_AREA); st->isdetail = 1; - rrddim_add(st, "received", NULL, 8, 1024 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -8, 1024 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -151,8 +151,8 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) { st = rrdset_create("ipv4", "mcastpkts", NULL, "ipv4", "IPv4 Multicast Packets", "packets/s", 9500, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "received", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -169,8 +169,8 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) { st = rrdset_create("ipv4", "bcastpkts", NULL, "ipv4", "IPv4 Broadcast Packets", "packets/s", 8500, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "received", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); diff --git a/src/proc_net_rpc_nfsd.c b/src/proc_net_rpc_nfsd.c index 63fb1077..ba3a8d47 100644 --- a/src/proc_net_rpc_nfsd.c +++ b/src/proc_net_rpc_nfsd.c @@ -422,9 +422,9 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create("nfsd", "readcache", NULL, "nfsd", "Read Cache", "reads/s", 5000, update_every, RRDSET_TYPE_STACKED); - rrddim_add(st, "hits", NULL, 1, update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "misses", NULL, 1, update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "nocache", NULL, 1, update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "hits", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "misses", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "nocache", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -442,11 +442,11 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) { st = rrdset_create("nfsd", "filehandles", NULL, "nfsd", "File Handles", "handles/s", 5001, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "stale", NULL, 1, update_every, RRDDIM_ABSOLUTE); - rrddim_add(st, "total_lookups", NULL, 1, update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "anonymous_lookups", NULL, 1, update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "dir_not_in_dcache", NULL, -1, update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "non_dir_not_in_dcache", NULL, -1, update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "stale", NULL, 1, 1, RRDDIM_ABSOLUTE); + rrddim_add(st, "total_lookups", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "anonymous_lookups", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "dir_not_in_dcache", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "non_dir_not_in_dcache", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -465,8 +465,8 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create("nfsd", "io", NULL, "nfsd", "I/O", "kilobytes/s", 5002, update_every, RRDSET_TYPE_AREA); - rrddim_add(st, "read", NULL, 1, 1000 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "write", NULL, -1, 1000 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "read", NULL, 1, 1000, RRDDIM_INCREMENTAL); + rrddim_add(st, "write", NULL, -1, 1000, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -493,7 +493,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create("nfsd", "threads_fullcnt", NULL, "nfsd", "Threads Full Count", "ops/s", 5004, update_every, RRDSET_TYPE_LINE); - rrddim_add(st, "full_count", NULL, 1, update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "full_count", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -537,17 +537,17 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create("nfsd", "readahead", NULL, "nfsd", "Read Ahead Depth", "percentage", 5005, update_every, RRDSET_TYPE_STACKED); - rrddim_add(st, "10%", NULL, 1, update_every, RRDDIM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "20%", NULL, 1, update_every, RRDDIM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "30%", NULL, 1, update_every, RRDDIM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "40%", NULL, 1, update_every, RRDDIM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "50%", NULL, 1, update_every, RRDDIM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "60%", NULL, 1, update_every, RRDDIM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "70%", NULL, 1, update_every, RRDDIM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "80%", NULL, 1, update_every, RRDDIM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "90%", NULL, 1, update_every, RRDDIM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "100%", NULL, 1, update_every, RRDDIM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "misses", NULL, 1, update_every, RRDDIM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "10%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "20%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "30%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "40%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "50%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "60%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "70%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "80%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "90%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "100%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "misses", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL); } else rrdset_next(st); @@ -576,8 +576,8 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) { st = rrdset_create("nfsd", "net", NULL, "nfsd", "Network Reads", "reads/s", 5007, update_every, RRDSET_TYPE_STACKED); st->isdetail = 1; - rrddim_add(st, "udp", NULL, 1, update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "tcp", NULL, 1, update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "udp", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "tcp", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -598,9 +598,9 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) { st = rrdset_create("nfsd", "rpc", NULL, "nfsd", "Remote Procedure Calls", "calls/s", 5008, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "all", NULL, 1, update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "bad_format", NULL, -1, update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "bad_auth", NULL, -1, update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "all", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "bad_format", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "bad_auth", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -622,7 +622,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) { st = rrdset_create("nfsd", "proc2", NULL, "nfsd", "NFS v2 Calls", "calls/s", 5009, update_every, RRDSET_TYPE_STACKED); for(i = 0; nfsd_proc_values[i].present2 ; i++) - rrddim_add(st, nfsd_proc_values[i].name, NULL, 1, update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, nfsd_proc_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -641,7 +641,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) { st = rrdset_create("nfsd", "proc3", NULL, "nfsd", "NFS v3 Calls", "calls/s", 5010, update_every, RRDSET_TYPE_STACKED); for(i = 0; nfsd_proc_values[i].present3 ; i++) - rrddim_add(st, nfsd_proc_values[i].name, NULL, 1, update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, nfsd_proc_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -660,7 +660,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) { st = rrdset_create("nfsd", "proc4", NULL, "nfsd", "NFS v4 Calls", "calls/s", 5011, update_every, RRDSET_TYPE_STACKED); for(i = 0; nfsd_proc_values[i].present4 ; i++) - rrddim_add(st, nfsd_proc_values[i].name, NULL, 1, update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, nfsd_proc_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -679,7 +679,7 @@ int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) { st = rrdset_create("nfsd", "proc4ops", NULL, "nfsd", "NFS v4 Operations", "operations/s", 5012, update_every, RRDSET_TYPE_STACKED); for(i = 0; nfsd4_ops_values[i].present ; i++) - rrddim_add(st, nfsd4_ops_values[i].name, NULL, 1, update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, nfsd4_ops_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); diff --git a/src/proc_net_snmp.c b/src/proc_net_snmp.c index b6929827..482fc94a 100755 --- a/src/proc_net_snmp.c +++ b/src/proc_net_snmp.c @@ -103,9 +103,9 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create(RRD_TYPE_NET_SNMP, "packets", NULL, RRD_TYPE_NET_SNMP, "IPv4 Packets", "packets/s", 3000, update_every, RRDSET_TYPE_LINE); - rrddim_add(st, "received", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "forwarded", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "forwarded", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -123,9 +123,9 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) { st = rrdset_create(RRD_TYPE_NET_SNMP, "fragsout", NULL, RRD_TYPE_NET_SNMP, "IPv4 Fragments Sent", "packets/s", 3010, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "ok", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "failed", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "all", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "ok", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "failed", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "all", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -143,9 +143,9 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) { st = rrdset_create(RRD_TYPE_NET_SNMP, "fragsin", NULL, RRD_TYPE_NET_SNMP, "IPv4 Fragments Reassembly", "packets/s", 3011, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "ok", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "failed", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "all", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "ok", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "failed", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "all", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -163,14 +163,14 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) { st = rrdset_create(RRD_TYPE_NET_SNMP, "errors", NULL, RRD_TYPE_NET_SNMP, "IPv4 Errors", "packets/s", 3002, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "InDiscards", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "OutDiscards", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "InDiscards", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "OutDiscards", NULL, -1, 1, RRDDIM_INCREMENTAL); - rrddim_add(st, "InHdrErrors", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "InAddrErrors", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "InUnknownProtos", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "InHdrErrors", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "InAddrErrors", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "InUnknownProtos", NULL, 1, 1, RRDDIM_INCREMENTAL); - rrddim_add(st, "OutNoRoutes", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "OutNoRoutes", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -244,8 +244,8 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create(RRD_TYPE_NET_SNMP, "tcppackets", NULL, "tcp", "IPv4 TCP Packets", "packets/s", 2600, update_every, RRDSET_TYPE_LINE); - rrddim_add(st, "received", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -262,8 +262,8 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) { st = rrdset_create(RRD_TYPE_NET_SNMP, "tcperrors", NULL, "tcp", "IPv4 TCP Errors", "packets/s", 2700, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "InErrs", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "RetransSegs", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "InErrs", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "RetransSegs", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -280,11 +280,11 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) { st = rrdset_create(RRD_TYPE_NET_SNMP, "tcphandshake", NULL, "tcp", "IPv4 TCP Handshake Issues", "events/s", 2900, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "EstabResets", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "OutRsts", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "ActiveOpens", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "PassiveOpens", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "AttemptFails", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "EstabResets", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "OutRsts", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "ActiveOpens", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "PassiveOpens", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "AttemptFails", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -327,8 +327,8 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create(RRD_TYPE_NET_SNMP, "udppackets", NULL, "udp", "IPv4 UDP Packets", "packets/s", 2601, update_every, RRDSET_TYPE_LINE); - rrddim_add(st, "received", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -345,10 +345,10 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) { st = rrdset_create(RRD_TYPE_NET_SNMP, "udperrors", NULL, "udp", "IPv4 UDP Errors", "events/s", 2701, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "RcvbufErrors", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "SndbufErrors", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "InErrors", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "NoPorts", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "InErrors", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "NoPorts", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); diff --git a/src/proc_net_stat_conntrack.c b/src/proc_net_stat_conntrack.c index 5f16c8df..feeaa853 100755 --- a/src/proc_net_stat_conntrack.c +++ b/src/proc_net_stat_conntrack.c @@ -116,9 +116,9 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "new", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter New Connections", "connections/s", 1001, update_every, RRDSET_TYPE_LINE); - rrddim_add(st, "new", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "ignore", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "invalid", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "new", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "ignore", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "invalid", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -136,9 +136,9 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) { st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "changes", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Connection Changes", "changes/s", 1002, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "inserted", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "deleted", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "delete_list", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "inserted", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "deleted", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "delete_list", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -156,9 +156,9 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) { st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "expect", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Connection Expectations", "expectations/s", 1003, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "created", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "deleted", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "new", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "created", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "deleted", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "new", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -176,9 +176,9 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) { st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "search", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Connection Searches", "searches/s", 1010, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "searched", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "restarted", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "found", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "searched", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "restarted", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "found", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -196,10 +196,10 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) { st = rrdset_create(RRD_TYPE_NET_STAT_CONNTRACK, "errors", NULL, RRD_TYPE_NET_STAT_CONNTRACK, "Netfilter Errors", "events/s", 1005, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "icmp_error", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "insert_failed", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "drop", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "early_drop", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "icmp_error", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "insert_failed", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "drop", NULL, -1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "early_drop", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); diff --git a/src/proc_stat.c b/src/proc_stat.c index 27d11fb3..b2364bec 100755 --- a/src/proc_stat.c +++ b/src/proc_stat.c @@ -125,7 +125,7 @@ int do_proc_stat(int update_every, unsigned long long dt) { st = rrdset_create("system", "intr", NULL, "cpu", "CPU Interrupts", "interrupts/s", 900, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "interrupts", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "interrupts", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -143,7 +143,7 @@ int do_proc_stat(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create("system", "ctxt", NULL, "cpu", "CPU Context Switches", "context switches/s", 800, update_every, RRDSET_TYPE_LINE); - rrddim_add(st, "switches", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "switches", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -170,7 +170,7 @@ int do_proc_stat(int update_every, unsigned long long dt) { st = rrdset_create("system", "forks", NULL, "cpu", "New Processes", "processes/s", 700, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "started", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "started", NULL, 1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); diff --git a/src/proc_vmstat.c b/src/proc_vmstat.c index b6c8ce7b..8ae1eb26 100755 --- a/src/proc_vmstat.c +++ b/src/proc_vmstat.c @@ -166,8 +166,8 @@ int do_proc_vmstat(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create("system", "swapio", NULL, "mem", "Swap I/O", "kilobytes/s", 250, update_every, RRDSET_TYPE_AREA); - rrddim_add(st, "in", NULL, sysconf(_SC_PAGESIZE), 1024 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "out", NULL, -sysconf(_SC_PAGESIZE), 1024 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "in", NULL, sysconf(_SC_PAGESIZE), 1024, RRDDIM_INCREMENTAL); + rrddim_add(st, "out", NULL, -sysconf(_SC_PAGESIZE), 1024, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -183,8 +183,8 @@ int do_proc_vmstat(int update_every, unsigned long long dt) { if(!st) { st = rrdset_create("system", "io", NULL, "disk", "Disk I/O", "kilobytes/s", 150, update_every, RRDSET_TYPE_AREA); - rrddim_add(st, "in", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "out", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "in", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "out", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); @@ -201,8 +201,8 @@ int do_proc_vmstat(int update_every, unsigned long long dt) { st = rrdset_create("system", "pgfaults", NULL, "mem", "Memory Page Faults", "page faults/s", 500, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "minor", NULL, 1, 1 * update_every, RRDDIM_INCREMENTAL); - rrddim_add(st, "major", NULL, -1, 1 * update_every, RRDDIM_INCREMENTAL); + rrddim_add(st, "minor", NULL, 1, 1, RRDDIM_INCREMENTAL); + rrddim_add(st, "major", NULL, -1, 1, RRDDIM_INCREMENTAL); } else rrdset_next(st); diff --git a/src/rrd.c b/src/rrd.c index fe264cf7..7975ef69 100755 --- a/src/rrd.c +++ b/src/rrd.c @@ -978,28 +978,46 @@ unsigned long long rrdset_done(RRDSET *st) rd->last_collected_value = rd->collected_value; } - rd->calculated_value += (calculated_number)(rd->collected_value - rd->last_collected_value); + rd->calculated_value += (calculated_number)(rd->collected_value - rd->last_collected_value) + * (calculated_number)rd->multiplier + / (calculated_number)rd->divisor + * (calculated_number)1000000ULL + / (calculated_number)st->usec_since_last_update; if(unlikely(st->debug)) debug(D_RRD_STATS, "%s/%s: CALC INC " - CALCULATED_NUMBER_FORMAT " += " + CALCULATED_NUMBER_FORMAT " += (" COLLECTED_NUMBER_FORMAT " - " COLLECTED_NUMBER_FORMAT + " * %ld" + " / %ld" + " * 1000000" + " / %llu" + ")" , st->id, rd->name , rd->calculated_value , rd->collected_value, rd->last_collected_value + , (calculated_number)rd->multiplier + , (calculated_number)rd->divisor + , st->usec_since_last_update ); break; case RRDDIM_ABSOLUTE: - rd->calculated_value = (calculated_number)rd->collected_value; + rd->calculated_value = (calculated_number)rd->collected_value + * (calculated_number)rd->multiplier + / (calculated_number)rd->divisor; if(unlikely(st->debug)) debug(D_RRD_STATS, "%s/%s: CALC ABS/ABS-NO-IN " CALCULATED_NUMBER_FORMAT " = " COLLECTED_NUMBER_FORMAT + " * %ld" + " / %ld" , st->id, rd->name , rd->calculated_value , rd->collected_value + , (calculated_number)rd->multiplier + , (calculated_number)rd->divisor ); break; @@ -1097,22 +1115,14 @@ unsigned long long rrdset_done(RRDSET *st) } if(likely(rd->updated && rd->counter > 1 && iterations < st->gap_when_lost_iterations_above)) { - rd->values[st->current_entry] = pack_storage_number( - new_value - * (calculated_number)rd->multiplier - / (calculated_number)rd->divisor - , storage_flags ); + rd->values[st->current_entry] = pack_storage_number(new_value, storage_flags ); if(unlikely(st->debug)) debug(D_RRD_STATS, "%s/%s: STORE[%ld] " CALCULATED_NUMBER_FORMAT " = " CALCULATED_NUMBER_FORMAT - " * %ld" - " / %ld" , st->id, rd->name , st->current_entry , unpack_storage_number(rd->values[st->current_entry]), new_value - , rd->multiplier - , rd->divisor ); } else { diff --git a/src/unit_test.c b/src/unit_test.c index dd69d68a..a0a41240 100755 --- a/src/unit_test.c +++ b/src/unit_test.c @@ -267,7 +267,7 @@ int unit_test(long delay, long shift) RRDDIM *rdabsi = NULL; if(do_abs) rdabs = rrddim_add(st, "absolute", "absolute", 1, 1, RRDDIM_ABSOLUTE); - if(do_inc) rdinc = rrddim_add(st, "incremental", "incremental", 1, 1 * rrd_update_every, RRDDIM_INCREMENTAL); + if(do_inc) rdinc = rrddim_add(st, "incremental", "incremental", 1, 1, RRDDIM_INCREMENTAL); if(do_abst) rdabst = rrddim_add(st, "percentage-of-absolute-row", "percentage-of-absolute-row", 1, 1, RRDDIM_PCENT_OVER_ROW_TOTAL); if(do_absi) rdabsi = rrddim_add(st, "percentage-of-incremental-row", "percentage-of-incremental-row", 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);