diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2015-11-26 01:30:57 +0200 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2015-11-26 01:30:57 +0200 |
commit | 171a60571572067aad59fbee9f975b05b8663001 (patch) | |
tree | 82b6756bf87354155c0dd842fa30687f2688cc71 /src/proc_net_dev.c | |
parent | 62aac417f30aba33549f4e706b43f685d988a58d (diff) |
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
Diffstat (limited to 'src/proc_net_dev.c')
-rwxr-xr-x | src/proc_net_dev.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/proc_net_dev.c b/src/proc_net_dev.c index 0bb97fa7ab..72e0ea9149 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); |