linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* CPU/disk usage
@ 2005-05-21 14:09 Adam Dyga
  2005-05-21 20:27 ` Glynn Clements
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Dyga @ 2005-05-21 14:09 UTC (permalink / raw)
  To: linux-c-programming

Hello,

What's the best way to:
1. Get the percent cpu usage (as in top)
2. Get disk activity (eg. number of bytes read/written from/to disk 
during some period of time).

Ad1) I know I could find the cpu usage in top sources, but unfortunately 
I don't have enough time
to do it currently - maybe some of you did this already.
There is sysinfo() system call that returns average loads during the 
last 1, 5, and 15
minutes but average load, AFAIK, is a average number of tasks waiting 
for cpu, so it's not
exactly what I want.

Cheers
AD

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: CPU/disk usage
@ 2005-05-21 17:12 Akbar Ali
  0 siblings, 0 replies; 3+ messages in thread
From: Akbar Ali @ 2005-05-21 17:12 UTC (permalink / raw)
  To: Adam Dyga, linux-c-programming

Why not just take a quick look at the top source code
?
btw, if you find out tell me, cause i'm intersted in
that data as well..

--- Adam Dyga <adeon@tlen.pl> wrote:
> Hello,
> 
> What's the best way to:
> 1. Get the percent cpu usage (as in top)
> 2. Get disk activity (eg. number of bytes
> read/written from/to disk 
> during some period of time).
> 
> Ad1) I know I could find the cpu usage in top
> sources, but unfortunately 
> I don't have enough time
> to do it currently - maybe some of you did this
> already.
> There is sysinfo() system call that returns average
> loads during the 
> last 1, 5, and 15
> minutes but average load, AFAIK, is a average number
> of tasks waiting 
> for cpu, so it's not
> exactly what I want.
> 
> Cheers
> AD
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at 
> http://vger.kernel.org/majordomo-info.html
> 


		
Discover Yahoo! 
Get on-the-go sports scores, stock quotes, news and more. Check it out! 
http://discover.yahoo.com/mobile.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-05-21 20:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-21 14:09 CPU/disk usage Adam Dyga
2005-05-21 20:27 ` Glynn Clements
  -- strict thread matches above, loose matches on Subject: below --
2005-05-21 17:12 Akbar Ali

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).