a way of calculating cpu usage information in proc fs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
Hi all,

            After reading the proc.txt file,i come to the following 
            conclusion:

          1. I get the total clock speed of the cpu 
            from /proc/cpuinfo from cpu MHz entry.
          2. Now i add the values of all the colomns
            in the first row of /proc/stat(the row which
            starts with cpu).this gives the total cpu usage.

Then i am dividing the above value with 1000 and the resulting answer is again divided with the total clock speed to get the percentage of cpu usage.

Is my approach  correct.

I am checking my results with system monitor but there is a variation.
Plz rectify me,if i am wrong.

Thanks,
Sounak.
(This is my best effort to write a mail)




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux