After a few angry phone calls with my ISP over me blowing past a stupid 300GB month transfer cap, and a few more completely empty threats about switching ISPs (we only have one ISP in my town, they know it, I know it...) I rolled a simple bandwidth monitoring application in golang with a web front end. The DB performance on boltdb was atrocious (only 2-3k get/put per second) when I was running tests, so if someone knows why don't keep it a secret.
Its designed to provide real time throughput as well as a summary by the minute, hour, day, and month. The minutes, hours, and days roll over but months are held forever. I didn't like the available solutions and I am guilty of the NIH as much as the next guy, so I figured I would share.
Not sure what this is going to accomplish, other than allowing me to squabble about the exact byte count when I am forced to call again and play this stupid dance over again...
monitor is at github.com/traetox/gobwmon
sample frontend is at github.com/traetox/bwmonfrontend
screenshot: http://i.imgur.com/SyMPdSo.png
评论:
mwholt:
jamra06:YES, thank you, this is awesome.
For a couple years now I have been wanting to write something similar except it monitors speed, not transfer. I saw recently that somebody wrote a program for the raspberry pi that tweets to Comcast when their connection is slow, but I think that even just having a graph of connection speed over time would be interesting.
We need more software in the realm of keeping ISPs accountable.
TheMerovius:Just shooting ideas...
Maybe you can use a simple proxy with a rate limiter like leaky bucket... Only create a ridiculously high limit. Then, when your leaky bucket rate limiter resets it's limit, which it should on a timer, write out the capacity used to bolt.
I'd argue that setting up a real timeseries-database (e.g. Prometheus) with a tiny program exporting bytes throughput would get you better results simpler, but good on you :)
