Re: HELP: cpu load graph plotting program



Le dimanche 26 juin 2005 à 18:49 -0400, muppet a écrit :
> Sure there is -- system(), in the standard C library, is a good place 

> to start

mwahahahahah. system() is the worst way to get this kind of information.
it's slow, not portable. and system('free') won't help at all as free
output would be redirected to stdout, so you won't be able to get
anything. don't use it.

> You can also have a look at libgtop, the library implementing the  
> functionality of GTop:
> http://directory.fsf.org/libs/LibGTop.html

libgtop2 is part of desktop ! gnome-system-monitor and multiload-applet
use it.

info libgtop

there are also examples in libgtop/examples/

you can find a python binding in gnome-python-extras, which is probably
easier to use.

>>> import gtop
>>> m = gtop.mem()
>>> m
Struct { .buffer = 35688448, .cached = 160116736, .free =
17915904, .locked = 0, .shared = 0, .total = 527470592, .used =
509554688, .user = 313749504 }

etc ...


enjoy !
-- 
Benoît Dejean <TazForEver AT dlfp DOT org>
JID: TazForEver jabber org
GNOME http://www.gnomefr.org/
LibGTop http://directory.fsf.org/libgtop.html

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]