Guest User

Untitled

a guest
Jun 22nd, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. logdir="$1"
  2. [[ -f $logdir/cpuutil.log && -f $logdir/io.log && -f $logdir/power.log ]] || exit 1
  3.  
  4. gnuplot << EOS
  5. set xdata time
  6. set timefmt "%Y-%m-%d_%H:%M:%S"
  7. set format x "%H:%M:%S"
  8.  
  9. set terminal png noenhanced size 1280,960 font 'SourceHanSans-Medium' 18
  10. set style fill solid 1.0
  11.  
  12. set key autotitle columnhead
  13. set key above
  14.  
  15. set grid
  16. set lmargin at screen 0.1
  17.  
  18. set output 'timeline.png'
  19.  
  20. set multiplot layout 3,1
  21. set notitle
  22.  
  23. set ylabel 'CPU使用率[%]'
  24. unset xlabel
  25. set yrange [0:]
  26.  
  27. plot '${logdir}/cpuutil.log' using 1:(\$2+\$3+\$4) w boxes lc rgb "$COLOR_IOWAIT", \
  28. '' using 1:(\$2+\$3) w boxes lc rgb "$COLOR_SYSTEM",\
  29. '' using 1:2 w boxes lc rgb "$COLOR_USER"
  30.  
  31. set notitle
  32. set ylabel 'ディスク速度[MB/s]'
  33.  
  34. sec2mb(x) = x * 512 / 1024**2
  35. plot '${logdir}/io.log' using 1:(sec2mb(\$7)) w l notitle lc rgb "$COLOR_READ", \
  36. '' using 1:(sec2mb(\$9)) w l notitle lc rgb "$COLOR_WRITE"
  37.  
  38. set notitle
  39. set xlabel '時間[s]'
  40. set ylabel '電力消費[W]'
  41.  
  42. plot '${logdir}/power.log' using 1:2 w l
  43.  
  44. unset multiplot
  45. EOS
Add Comment
Please, Sign In to add comment