473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

HELP: cpu load graph plotting program

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.

Jul 23 '05 #1
2 2913
On Sun, 26 Jun 2005 21:53:26 +0400, KevinGPO <ke******@hotmail.com> wrote:

[]
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(), ...

--
Maxim Yegorushkin
<fi****************@gmail.com>
Jul 23 '05 #2
----- Original Message -----
From: "Maxim Yegorushkin" <fi****************@gmail.com>
Newsgroups: comp.lang.c++
Sent: Sunday, June 26, 2005 12:53 PM
Subject: Re: HELP: cpu load graph plotting program

On Sun, 26 Jun 2005 21:53:26 +0400, KevinGPO <ke******@hotmail.com> wrote:

[]
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(), ...

--
Maxim Yegorushkin
<fi****************@gmail.com>


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?
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Todd Gardner | last post by:
I would like to graph two columns of x,y numbers? I would greatly appreciate any pointers or suggestions. Thank you, Todd
11
by: Chapman | last post by:
Is it possible to plot the graph as an output of my program in C? It can be a simple graph as quadratic curves for example or a correlation between 2 variables only. Thanks
1
by: wayne | last post by:
i want to plot a line graph. The values that I obtain are the RGB value of a TIFF image. i m plotting RGB values vs value(1,2,3..) so when generated the RGB values, there will b a column of values...
3
by: i | last post by:
Hi, I'm working with an array of nodes, numbering roughly in the thousands. Each node has at least one, but up to four, references to another node - North, South, East, or West. I'm trying to...
7
by: diffuser78 | last post by:
My python program spits lot of data. I take that data and plot graphs using OfficeOrg spredsheet. I want to automate this task as this takes so much of time. I have some questions. 1. Which is...
4
by: Gouri | last post by:
Hi, Got a query regarding plotting a preview / thumbnail for a graph which reads data from a binary file. The preview should should take very less time, look exactly like the original graph i.e....
5
by: Narendar123P | last post by:
Hi all, I am trying to plot a graph in excel file using C#.Net. I am using the name space excel . If my graph has one series(2 columns), i am able to draw the graph. if my graph has two series(4...
8
by: Adrian | last post by:
Having plotted a graph from x,y co-ordinate to x,y co-ordinate, the graph disappears immediately (after the last plot). Writing " " to a label, in between subsequent plots, solves this problem....
3
by: 9966 | last post by:
Greetings, I'm currently having problem in plotting a simple graph in C++. I learned that we can actually use koolplot to do it. My question is whether it is possible to plot, let's say the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.