anboo / profiler
此包最新版本(dev-master)没有可用的许可证信息。
Profiler History php 应用程序
dev-master
2019-03-06 07:42 UTC
Requires
- psr/log: ^1.1
- ramsey/uuid: ^3.8
Requires (Dev)
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2024-09-07 00:54:00 UTC
README
使用示例
use \Anboo\Profiler\Prof; Prof::release(date('YmdHis')); Prof::start('request'); Prof::start('nested 1'); Prof::start('Array 2000000'); $arr = []; for ($i = 0; $i < 2000000; $i++) { $arr[] = $i; } Prof::end('Array 2000000'); Prof::start('Unset array (free memory)'); unset($arr); Prof::end(); Prof::start('SplFixedArray'); $splFix = new \SplFixedArray(2000000); for ($i = 0; $i < 2000000; $i++) { $splFix[$i] = $i; } Prof::end('SplFixedArray'); Prof::end(); Prof::end(); Prof::flush();
自定义配置
$logger = new \Monolog\Logger('app', [new \Monolog\Handler\StreamHandler('./log.txt')]); $configuration = new \Anboo\Profiler\Configuration(); $configuration->setLogger($logger); //Report about problems $configuration->setConnection('127.0.0.1', 27889); Prof::configuration($configuration);