Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Apr 2004 10:46:02 -0800
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        Jose Marcio Martins da Cruz <Jose-Marcio.Martins@ensmp.fr>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Pointers about CPU load measuring
Message-ID:  <20040402184600.GD11637@Odin.AC.HMC.Edu>
In-Reply-To: <406D6CEF.9030501@ensmp.fr>
References:  <406D6CEF.9030501@ensmp.fr>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Fri, Apr 02, 2004 at 03:38:55PM +0200, Jose Marcio Martins da Cruz wrote:
> 
> Someone can send some pointers on how to measure global CPU load under 
> FreeBSD from a C program ? I'm looking for values for idle/kernel/user, 
> in a similar way as does top. Is there any pointer or doc ?. I'd like to 
> avoir browsing top code.

The top code is rather gross.  You might take a look at the Ganglia
source code.  It products metrics like that in fairly focused functions
so it's more readable then top.

The file you're intrested in is here:

http://cvs.sourceforge.net/viewcvs.py/ganglia/monitor-core/gmond/machines/freebsd.c?rev=1.7&view=auto

If you want to play with the whole thing, the
sysutils/ganglia-monitor-core port may be of use.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAbbTnXY6L6fI4GtQRAqsJAJ9CMg2AJNNt31VZ1sTqlShQiULoCwCdF9c3
O5MOcBHylk7bfBeQi1pWe4I=
=FRFG
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040402184600.GD11637>