比较值的周期变化

cat latency_s.output | grep -v "mysql" | awk '{print $4, "\t", $7, "\t", $9, "\t", $11,"\t", $13}'
mysql -p'' -Bse'select event_name , total_latency from sys.x$io_global_by_wait_by_latency order by event_name' > io_global_by_wait_by_latency.old
while true
do
    sleep 1
    mv io_global_by_wait_by_latency.new io_global_by_wait_by_latency.old
    mysql -p'' -Bse'select event_name , total_latency from sys.x$io_global_by_wait_by_latency order by event_name' > io_global_by_wait_by_latency.new
    timestamp=`date`
    echo -n $timestamp
    echo -n "   "
    paste io_global_by_wait_by_latency.old io_global_by_wait_by_latency.new | awk '{print $1, " ", ($4-$2)/1000.0/1000/1000}' | awk '{if ($2) print $2 ," ", $1 ;}' | paste -sd' '
done

 

posted @ 2019-07-09 17:46  友哥  阅读(206)  评论(0编辑  收藏  举报