sy-records/xhprof2flamegraph
Composer 安装命令:
composer require sy-records/xhprof2flamegraph
包简介
将xhprof产生的数据转为可以生成flamegraph火焰图的格式并生成火焰图
关键字:
README 文档
README
🎨将xhprof产生的数据转为可以生成flame graph火焰图的格式并生成火焰图
安装
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
sy-records/xhprof2flamegraph 适用场景与选型建议
sy-records/xhprof2flamegraph 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 353 次下载、GitHub Stars 达 11, 最近一次更新时间为 2019 年 05 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「xhprof」 「tideways」 「flamegraph」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sy-records/xhprof2flamegraph 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sy-records/xhprof2flamegraph 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sy-records/xhprof2flamegraph 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A system-wide performance monitoring system profiler.
Quick profiling of your code for Laravel
Silex provider for the qafoo profiler
Xhprof buggregator integration for Symfony Framework
Flame graphs and log processing for PHP stack traces.
GUI to analyze the profiling data collected using XHProf - A Hierarchical Profiler for PHP.
统计信息
- 总下载量: 353
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2019-05-04