HELP: cpu load graph plotting program

K

KevinGPO

I am making a monitor program for the PC. My monitor program will grab
statistics about CPU and memory every 1 or 5 seconds. Then I want to
store this data so I have a history and hence be able to graph this out
in my GUI.

I thought about using a plain text file to store my graph data and plot
it out. Plot it out manually or use gnuplot.

I found this tool called RRDTool
(http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/). It's a database
to store time-series data. Then it will beautifully graph out your
data. However it's based on executing/running the program/script. Data
is input using it's own command-line script. And graph creation is done
the same way using another command-line script.

Problem is, how can I get C/C++ to call or incorporate RRDTool
command-line program into my GUI? Is there any way in C/C++ to call
another program? I don't think there is. Plus I don't think RRDTool has
developer libraries (lib*.lib, etc) for C/C++ programmers to call into
their own programs.

If anyone has any suggestions/advice as to easy ways to store simple
statistics (CPU & memory load), and graph them in a GUI like GTK+
(http://www.gtk.org/) I'd be very grateful.

Or does anyone know a 3rd party graph plotting library that plots to
GUIs like GTK/QT/SDL?

Many thanks.
 
M

Maxim Yegorushkin

[]
Problem is, how can I get C/C++ to call or incorporate RRDTool
command-line program into my GUI? Is there any way in C/C++ to call
another program? I don't think there is. Plus I don't think RRDTool has
developer libraries (lib*.lib, etc) for C/C++ programmers to call into
their own programs.

ANSI C: system()
POSIX: popen(), fork()/exec(), ...
 
J

Jim Langston

----- Original Message -----
From: "Maxim Yegorushkin" <[email protected]>
Newsgroups: comp.lang.c++
Sent: Sunday, June 26, 2005 12:53 PM
Subject: Re: HELP: cpu load graph plotting program

[]
Problem is, how can I get C/C++ to call or incorporate RRDTool
command-line program into my GUI? Is there any way in C/C++ to call
another program? I don't think there is. Plus I don't think RRDTool has
developer libraries (lib*.lib, etc) for C/C++ programmers to call into
their own programs.

ANSI C: system()
POSIX: popen(), fork()/exec(), ...

In addition, if RRDTool, which is command line (hench console I believe)
gets
input from std::in (forgot what it was called in the C days, standard input
I believe)
you can do redirection of input.

In it's basic form it's:
RDDTool < MyInput.txt
or
cat MyInput.txt | RDDTool
(type if using windows/msdos).

I know there's away to attach an output stream to an input stream, but not
sure
how you would go about it on the system level. Iguess it's OS dependant?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top