plotting cpu and mem consumption
Hi Group,
for a project[1] I am trying to find an OS independant way to measure the amount of cpu usage
and memory consumption of the program. It would be nice if I could do that in my C++ code, so I
can show the results at runtime or even plot a nice graph (I got wild dreams).
After some google'ing I found some (nice) examples[2] but they are all windows based. Does
universal code for this problem exist?
Of course I can make different classes (one for windows and another for *nix), I do something
similar to assign sockets. But then I also need code for *nix, without using bash-scripting of
course.
So I am looking for something OS independant, but examples for windows or *nix can help me out
for now as well.
Goodnight everyone and thanks in advance,
--wim
______
[1] I am trying to compare some differint multicast protocols, and yes, also cpu usage and
memory consumption is an important part of that :-)
[2] if anybody wants them, I can always post links, just ask
Re: plotting cpu and mem consumption
Quote:
Originally posted by vvim
Of course I can make different classes (one for windows and another for *nix)
That exactly what U should do using C++.
Probably, some scripting languages like Python and Perl have a common interface for doing that stuff, but at any rate its internal realization is system dependent.
It's not necessary to use scripting for *nix-like systems from your c++ program, all information is available from the /proc pseudo-filesystem (read man page for proc).