为什么最新版本的sys-stat在kill后没有显示平均值..?

时间:2018-06-13 07:41:57

标签: linux memory profiling cpu cpu-usage

我的日志中的旧输出显示ctrl + c

后的平均值
#pidstat 1 -p `pgrep bgpd`
Linux 3.16.7-gd1a374d-dellz9100on (rtr1)        Tuesday 29 May 2018     _x86_64_        (4 CPU)

05:07:01  UTC   UID       PID    %usr %system  %guest    %CPU   CPU  Command

05:07:07  UTC     0      2144    0.00    0.00    0.00    0.00     2  bgpd
05:07:08  UTC     0      2144    0.00    0.00    0.00    0.00     2  bgpd
05:07:09  UTC     0      2144    0.00    0.00    0.00    0.00     2  bgpd
05:07:10  UTC     0      2144    0.00    0.00    0.00    0.00     2  bgpd
05:07:11  UTC     0      2144    0.00    0.00    0.00    0.00     2  bgpd
05:07:12  UTC     0      2144    0.00    0.00    0.00    0.00     2  bgpd
^C
Average:        0      2144    0.09    0.00    0.00    0.09     -  bgpd

现在它没有显示平均值

# pidstat 1 -p `pgrep bgpd`
    Linux 3.16.7-gd1a374d-dellz9100on (rtr1)        06/13/18        _x86_64_        (4 CPU)

    07:32:51          PID    %usr %system  %guest    %CPU   CPU  Command
    07:32:56         2144    0.00    0.00    0.00    0.00     0  bgpd
    07:32:57         2144    0.00    0.00    0.00    0.00     1  bgpd
    07:32:58         2144    0.00    0.00    0.00    0.00     1  bgpd
    ^C
 #

pidstat的版本

root@rtr1:/home/ocnos# pidstat -V
sysstat version 10.0.5
(C) Sebastien Godard (sysstat <at> orange.fr)
root@rtr1:/home/ocnos#

1 个答案:

答案 0 :(得分:0)

此工具的开发人员的邮件回复

No, your previous version was not 9.x. 
This feature (displaying average stats when Ctrl/C is hit) was added to pidstat in release 10.1.4.
Regards,
Sebastien.