摘要:
记录使用perf统计mysql执行耗时
perf使用:
FlameGraph.tar.gz-C++文档类资源
tar -xzvf FlameGraph.tar.gz
cd FlameGraphyum install perf -y
perf record -a -F 99 -g -p $(pgrep -x mysqld) -- /stonedb56/install/bin/mysql -D tpch -e "select
o_orderpriority,
count(*) as order_count
from
orders
where
o_orderdate >= date '1993-07-01'
and o_orderdate < date '1993-07-01' + interval '3' month
and exists (
select
*
from
lineitem
where
l_orderkey = o_orderkey
and l_commitdate < l_receiptdate
)
group by
o_orderpriority
order by
o_orderpriority ;"perf script -i perf.data > out.perf
./stackcollapse-perf.pl out.perf > out.floded
./flamegraph.pl out.floded > mysql.svg