fixes #36: bandwidth: wrong initialization of buckets
This merge request (hopefully) fixes #36 (closed), sending of 0-speed bucket by bandwidth plugin.
There was a problem with initialization of buckets (which also corrupted other data). The reason was that index counter was not reset after setting of windows, so first 5 buckets were not initialized at all (and the rest of them was shifted).
This is also the reason why timestamp in the data shown in the issue #36 (closed) is (nonsensically) 75000000. Because the 600000kbps (=75000000B/s) is wrongly written into timestamp instead of bucket key.
This actually could cause repeatedly wrong data even after the counters were reset (in communicate
). Bucket 5 was initialized to key 0, so the intentional skipping of bucket idx 0 (for (i=1;...)
) in update_buckets
was not helping here.