jenner/timer
Composer 安装命令:
composer require jenner/timer
包简介
php timer. performance analysis tool
README 文档
README
php runtime status report tool
Import
composer require jenner/timer
Or
require /path/to/php-time/src/Time.php
What it can do?
require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; // init, set the memory size unit $timer = new \Jenner\Timer(\Jenner\Timer::UNIT_KB); // mark a $timer->mark('a'); sleep(2); // mark b $timer->mark('b'); sleep(3); // mark c $timer->mark('c'); sleep(4); // mark d $timer->mark('d'); // print total report $timer->printReport(); // get total report $report = $timer->getReport(); // get the report of mark $a_report = $timer->getReport('a'); print_r($a_report); // get the diff report between a and b $timer->printDiffReportByStartAndEnd('a', 'b'); // get the diff report between a and b $ab_diff_report = $timer->getDiffReportByStartAndEnd('a', 'b'); // print the total diff report $timer->printDiffReport(); // get the total diff report $diff_report = $timer->getDiffReport(); // write the total report into the log file $timer->logReport('/tmp/php-time.log1'); // write the diff report into the log file $timer->logDiffReport('/tmp/php-time.log2'); // write the diff report between a and b into the log file $timer->logDiffReportByStartAndEnd('/tmp/php-time.log3', 'a', 'b');
result:
------------------------------------------
mark:a
time:1437535424.9998s
memory_real:1280KB
memory_emalloc:833.046875KB
memory_peak_real:1280KB
memory_peak_emalloc:843.2890625KB
------------------------------------------
mark:b
time:1437535427s
memory_real:1280KB
memory_emalloc:834.2265625KB
memory_peak_real:1280KB
memory_peak_emalloc:843.2890625KB
------------------------------------------
mark:c
time:1437535430.0002s
memory_real:1280KB
memory_emalloc:835.1875KB
memory_peak_real:1280KB
memory_peak_emalloc:843.2890625KB
------------------------------------------
mark:d
time:1437535434.0004s
memory_real:1280KB
memory_emalloc:836.1484375KB
memory_peak_real:1280KB
memory_peak_emalloc:843.2890625KB
Array
(
[time] => 1437535424.9998
[memory_real] => 1310720
[memory_emalloc] => 853040
[memory_peak_real] => 1310720
[memory_peak_emalloc] => 863528
)
------------------------------------------
mark:[diff] start_mark:a end_mark:b
time:2.0001850128174s
memory_real:0KB
memory_emalloc:1.1796875KB
memory_peak_real:0KB
memory_peak_emalloc:0KB
------------------------------------------
mark:[total diff]
time:9.0006000995636s
memory_real:0KB
memory_emalloc:3.1015625KB
memory_peak_real:0KB
memory_peak_emalloc:0KB
jenner/timer 适用场景与选型建议
jenner/timer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 178.7k 次下载、GitHub Stars 达 16, 最近一次更新时间为 2015 年 07 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「memory」 「php timer」 「memory used」 「performance analysis tool」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jenner/timer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jenner/timer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jenner/timer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Native PHP Library to profile PHP code.
PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way
Drop-dead simple execution time measurements
Utility class for timing
PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way
统计信息
- 总下载量: 178.7k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 17
- 点击次数: 32
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-22