Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Apr 2004 21:10:56 GMT
From:      Mark <admin@asarian-host.net>
To:        "Dan Nelson" <dnelson@allantgroup.com>, "Dag-Erling Smorgrav" <des@des.no>
Cc:        Jose Marcio Martins da Cruz <Jose-Marcio.Martins@ensmp.fr>
Subject:   Re: Pointers about CPU load measuring
Message-ID:  <200404022110.I32LASTU007692@asarian-host.net>
References:  <406D6CEF.9030501@ensmp.fr> <xzpsmfm5dn8.fsf@dwp.des.no> <20040402205301.GD6724@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Dan Nelson 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.
>>
>> Use sysctlbyname(3) to retrieve vm.loadavg, which is a struct loadavg
>> (defined in <sys/resource.h>)
>
> Actually the kern.cp_time variable might be better if you want
> idle/kernel/user values.

I current let snmpd do the job. Is that as accurate as manually reading the
kern.cp_time variable?

- Mark



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