07-29-04 01:47 AM
nsf470@yahoo.com (pj) writes:
> Hi,
>
> I want to measure host loads (using getloadavg()) every 10 seconds
> while I am running an application which is written in C, and write the
> host load average during the application execution to a file right
> before the application ends.
>
> I want to modify (instrument) the source code and call the getloadavg
> every 10 seconds during an execution. I don't want to create a child
> process to run an application while the parent process measures the
> load. is there a way to instrument the application source code so that
> I can call getloadavg() every 10 seconds until the execution ends?
>
> thanks a lot for any input on this.
> pj
Yes, that's very useful to try to get the load average every 10
seconds when the system updates the fastest load average only every
minute!
The getloadavg() function returns the number of processes in the system
run queue averaged over various periods of time. Up to nelem samples are
retrieved and assigned to successive elements of loadavg[]. The system
imposes a maximum of 3 samples, representing averages over the last 1, 5,
and 15 minutes, respectively.
--
__Pascal Bourguignon__ http://www.informatimago.com/
There is no worse tyranny than to force a man to pay for what he does not
want merely because you think it would be good for him. -- Robert Heinlein
[ Post a follow-up to this message ]
|