Coding a bandwidth monitor

Soldato
Joined
2 Dec 2005
Posts
5,514
Location
Herts
Re: Bandwidth monitor with rolling time period

I am still after a bandwidth monitor with the ability to show "the usage in the last 24 hours". I think the only way of achieving this will be to hack up the code for freemeter here.

It is in C#. I have a tiny bit of experience with C++, and lots with PHP, but I am looking mainly for a few hints on where to start, especially as there are a lot of .cs files in the zip.

The finished product can do away with most of the fancy stuff (graphs, options like refresh rate, multiple adaptor etc. etc.). All it needs is a little window with a number, which is the sum of upload and download usage in the last 24 hours.

From a coding point of view, I imagine
Initial start up of program (connecting to the adaptor, I have no idea how it does this),
Since the program has just opened, start a new counter at zero,
Start recording the data usage in 1 second intervals (a 60*60*24 sized vector like in C++?),
When 60*60*24 intervals have passed, add this interval and subtract first interval in set to achieve rolling 24 hour period.

With regards to hacking up freemeter, we just need the actual method it uses to collect bandwidth usage. However it connects to the adaptor, and reads off the consumption.

And finally the method of displaying this number in a window, but this should be easy.

:)
 
With regards to hacking up freemeter, we just need the actual method it uses to collect bandwidth usage. However it connects to the adaptor, and reads off the consumption.
Looking at the source code, its using the inbuilt windows performance monitors for the most part. Its straightforward code really, when you ignore all the GDI crap being used for drawing (which looks to be about 90% of the code!!).
 
DUMeter did what you ask for me a few years back, it's probably improved by now.
Excellent, DUMeter has it.


But it's only a 30 day trial! :( Not sure what I'm going to do about that.

Might still need to work out cacti.

Thanks for having a look over the code L33. That was my thought also. Do you think you could try to isolate the useful bits? Or tell me where to look?

Thanks chaps :)
 
Back
Top Bottom