Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- logdir="$1"
- [[ -f $logdir/cpuutil.log && -f $logdir/io.log && -f $logdir/power.log ]] || exit 1
- gnuplot << EOS
- set xdata time
- set timefmt "%Y-%m-%d_%H:%M:%S"
- set format x "%H:%M:%S"
- set terminal png noenhanced size 1280,960 font 'SourceHanSans-Medium' 18
- set style fill solid 1.0
- set key autotitle columnhead
- set key above
- set grid
- set lmargin at screen 0.1
- set output 'timeline.png'
- set multiplot layout 3,1
- set notitle
- set ylabel 'CPU使用率[%]'
- unset xlabel
- set yrange [0:]
- plot '${logdir}/cpuutil.log' using 1:(\$2+\$3+\$4) w boxes lc rgb "$COLOR_IOWAIT", \
- '' using 1:(\$2+\$3) w boxes lc rgb "$COLOR_SYSTEM",\
- '' using 1:2 w boxes lc rgb "$COLOR_USER"
- set notitle
- set ylabel 'ディスク速度[MB/s]'
- sec2mb(x) = x * 512 / 1024**2
- plot '${logdir}/io.log' using 1:(sec2mb(\$7)) w l notitle lc rgb "$COLOR_READ", \
- '' using 1:(sec2mb(\$9)) w l notitle lc rgb "$COLOR_WRITE"
- set notitle
- set xlabel '時間[s]'
- set ylabel '電力消費[W]'
- plot '${logdir}/power.log' using 1:2 w l
- unset multiplot
- EOS
Add Comment
Please, Sign In to add comment