[lkml]   [2000]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Loadavg calculation
On Sun, Nov 05, 2000 at 07:55:40AM -0500, wrote:

> The other option we looked at, besides using loadavg, was using idle pct%,
> but if I read the source for top right, involves reading the entire
> process table to calculate clock ticks used and then figuring out how many
> weren't used.

Snoop the source of vmstat, it measures the amount of programs in the run
queue, which is how the load average is calculated. You do need to average
this data in order for it to be useful.

You might also follow /proc/uptime, which gives the number of jiffies the
system has been up, and how many jiffies have been spent by the idle task.
If you take the derivative if the idle jiffies, you get the percentage idle

You might also try to measure directly how much time is spent in the idle
task (0).


bert hubert

PowerDNS Versatile DNS Services
Trilab The Technology People
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:45    [W:0.058 / U:1.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site