/proc/stat

[root@Eniak root]# cat /proc/stat
cpu  174 0 2974 79656
cpu0 174 0 2974 79656
page 15272 8781
swap 1 0
intr 102369 82804 2 0 0 0 0 3 0 1 0 0 0 0 0 14 2796 771 21 15957 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
disk_io: (3,0):(1,1,8,0,0)
ctxt 10837
btime 1174871603
processes 1215

 

官方说明: man proc
       stat   kernel/system statistics.   Varies  with  architecture.   Common
              entries include:

              cpu  3357 0 4313 1362393
                     The  number  of  jiffies  (1/100ths of a second) that the
                     system spent in user mode, user mode  with  low  priority
                     (nice),  system  mode,  and  the idle task, respectively.
                     The last value should be 100 times the  second  entry  in
                     the uptime pseudo-file.

              page 5741 1808
                     The  number  of  pages the system paged in and the number
                     that were paged out (from disk).

              swap 1 0
                     The number of swap pages that have been  brought  in  and
                     out.

              intr 1462898
                     The number of interrupts received from the system boot.

              disk_io: (2,0):(31,30,5764,1,2) (3,0):...
                     (major,minor):(noinfo,       read_io_ops,      blks_read,
                     write_io_ops, blks_written)

              ctxt 115315
                     The number of context switches that the system underwent.

              btime 769041601
                     boot  time, in seconds since the epoch (January 1, 1970).

              processes 86031
                     Number of forks since boot.
                    
从man手册摘录出的内容可以知道,我们关心的数据在stat文件头两行已经标示出来了(单CPU)
cpu  174 0 2974 79656
cpu0 174 0 2974 79656

第一行是总的CPU资源状况,第二行是第一个CPU的资源状况,多CPU的以此类推
计算方法很简单,原理是系统每秒会有一个固定的时间片值,比如100,也就是说,
每秒CPU产生的100个时间片,要么被消耗掉(前三个数值),要么就空闲浪费掉(最后一个数值累加)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值