我正在解析linux sar输出,我有一个如下所示的dat文件:
07:09:49 CPU %usr %nice %sys %iowait %steal %irq %soft %guest %idle
07:09:51 all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
07:09:53 all 11.82 0.00 0.13 0.00 0.00 0.00 0.00 0.00 88.05
07:09:55 all 53.99 0.00 0.63 0.00 0.13 0.00 0.13 0.00 45.12
07:09:57 all 55.18 0.00 0.25 0.00 0.00 0.00 0.00 0.00 44.57
07:09:59 all 66.58 0.00 0.51 0.00 0.00 0.00 0.13 0.00 32.78
07:10:01 all 71.90 0.00 0.63 0.13 0.00 0.00 0.13 0.00 27.22
07:10:03 all 70.24 0.00 0.63 0.00 0.00 0.00 0.13 0.00 29.00
07:10:05 all 55.39 0.00 0.63 0.00 0.00 0.00 0.13 0.00 43.85
07:10:07 all 72.90 0.00 0.38 0.00 0.00 0.00 0.00 0.00 26.73
07:10:09 all 60.96 0.00 0.38 0.00 0.13 0.00 0.13 0.00 38.40
07:10:11 all 76.60 0.00 0.63 0.00 0.00 0.00 0.13 0.00 22.65
07:10:13 all 53.87 0.00 0.76 0.00 0.00 0.00 0.13 0.00 45.25
07:10:15 all 46.73 0.00 0.63 0.00 0.00 0.00 0.00 0.00 52.64
07:10:17 all 56.37 0.00 0.50 0.00 0.00 0.00 0.13 0.00 43.00
07:10:19 all 58.15 0.00 0.63 0.00 0.00 0.00 0.13 0.00 41.09
07:10:21 all 61.26 0.00 0.75 0.00 0.00 0.00 0.13 0.00 37.86
07:10:23 all 51.50 0.00 0.75 0.12 0.12 0.00 0.25 0.00 47.2
set title ' CPU usage'
set xdata time
set timefmt '%H:%M:%S'
set xlabel 'time'
set ylabel 'CPU Usage'
set style data lines
plot 'filename.dat' using 1:3 title '0.6'
pause -1
答案 0 :(得分:2)
您必须设置抽动标签的格式:
set format x '%H:%M:%S'