xhprof2flamegraph
安装
composer require sy-records/xhprof2flamegraph
使用
vendor/bin目录下有两个可执行文件,执行命令
./vendor/bin/xhprof2flamegraph -f ./test.xhprof | ./vendor/bin/flamegraph.pl > out.svg替换对应的路径信息
-f 为指定的
xhprof日志文件,,自动处理json格式 (如果日志文件为serialize序列化后的数据,请修改src/Command/Command.php文件中的第40行)json和serialize格式的数据
帮助
- xhprof2flamegraph -h
_ __ ____ __
__ __ | |__ _ __ _ __ ___ / _| |___ \ / _|
\ \/ / | '_ \ | '_ \ | '__| / _ \ | |_ __) | | |_
> < | | | | | |_) | | | | (_) | | _| / __/ | _|
/_/\_\ |_| |_| | .__/ |_| \___/ |_| |_____| |_|
|_|
Usage:
xhprof2flamegraph [-h, --help] [-f, --profile] [--metrics]
Options:
-h, --help show help
-f, --profile file path of xhprof profile data
--metrics select target metrics (ect/ewt/ecpu/emu/epmu) - flamegraph.pl -help
USAGE: ./flamegraph.pl [options] infile > outfile.svg
--title TEXT # change title text
--subtitle TEXT # second level title (optional)
--width NUM # width of image (default 1200)
--height NUM # height of each frame (default 16)
--minwidth NUM # omit smaller functions (default 0.1 pixels)
--fonttype FONT # font type (default "Verdana")
--fontsize NUM # font size (default 12)
--countname TEXT # count type label (default "samples")
--nametype TEXT # name type label (default "Function:")
--colors PALETTE # set color palette. choices are: hot (default), mem,
# io, wakeup, chain, java, js, perl, red, green, blue,
# aqua, yellow, purple, orange
--hash # colors are keyed by function name hash
--cp # use consistent palette (palette.map)
--reverse # generate stack-reversed flame graph
--inverted # icicle graph
--negate # switch differential hues (blue<->red)
--notes TEXT # add notes comment in SVG (for debugging)
--help # this message
eg,
./flamegraph.pl --title="Flame Graph: malloc()" trace.txt > graph.svg
Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
