IP Accounting spikes in bandwidth

Hello everyone! This is my first post here, I got my first Mikrotik couple of days ago and I’m in love :smiley: .

I wish to check my internet usage per device in my network, so with use of IP Accounting CGI I wrote a small js app which retrieves information from cgi every second and displays it on graph per IP and direction (download/upload).
If you wish to check app here’s the source: https://github.com/ivanpavlina/Bandwidth-Meter

But here lies the problem - I don’t get reliable data from Accounting CGI, full network load doesn’t produce a solid line on graph, I get spikes in my output.
Here’s the screenshot where you can see what I’m talking about http://imgur.com/a/KZhCd

During the download in task manager there are no spikes, download is steady which is also visible on download speed in chrome, but at the same time data from Accounting is all over the place.

Am I missing something here?

Thanks :slight_smile:

I found the problem, I didn’t realize that accounting is returning multiple pairs for one IP, I had to sum it to get real data.
Script is now working fine, sorry for posting this, fix is on github.

Mods can close this thread now.