Skip to content

Instantly share code, notes, and snippets.

@LexaChebara
Created April 3, 2014 09:30
Show Gist options
  • Select an option

  • Save LexaChebara/9951340 to your computer and use it in GitHub Desktop.

Select an option

Save LexaChebara/9951340 to your computer and use it in GitHub Desktop.
График CPL (load average) по данным atop
#!/bin/sh -u
# $0 [atop logfile to plot]
log=${1-'/var/log/atop.log'}
tmp=/tmp/atop$$
rm -f $tmp
trap "rm -f $tmp" 0 1 2
atop -PCPL -r "$log" >$tmp
gnuplot -persist <<EOF
set xdata time
set timefmt '%Y/%m/%d %H:%M:%S'
set format x "%H:%M:%S"
set grid
set title "CPL"
plot \
"$tmp" using 4:8 t '' , \
"$tmp" using 4:8 smooth csplines t '', \
"$tmp" using 4:9 t '' , \
"$tmp" using 4:9 smooth csplines t '' , \
"$tmp" using 4:10 t '' , \
"$tmp" using 4:10 smooth csplines t '' ;
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment