satmaelstorm/ts-profiler 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

satmaelstorm/ts-profiler

最新稳定版本:1.2.1

Composer 安装命令:

composer require satmaelstorm/ts-profiler

包简介

Tiny and simple profiler

关键字:

README 文档

README

Tiny and Simple PHP-runtime Profiler

This component allows you to profile the code directly in the production environment.

You can use it as a Singleton:

$profiler = ProfilerSingletone::getInstance();

Also, if you want disable profiling at this time, you can use:

$profiler = ProfilerSingletone::getInstance(false);

So, if you don't want use Singleton, you can use:

$profiler = new Profiler();

or

$profiler = new Profiler(false);

when you don't need profiler at this time

This case very useful, when you want to use TSProfiler as Symfony service, or in another framework, which will ensure the uniqueness of the existence of a class instance.

For profiling, trackers are created using the addTracker method. Each tracker can store data in its own way. The profiling data will save the class that implements the ShutdownInterface interface. You can write any plug-in - save with sql-server, file, Monolog or some other way.

$tracker = $profiler->addTracker($name, $saver);

If you want disable this tracker at this time:

$tracker = $profiler->addTracker($name, $saver, false);

Example with CSVSaver class:

$tracker = $profiler->addTracker(
    'csvTracker',
    new \satmaelstorm\TSProfiler\TSProfilerShutdown\CSVSaver('\tmp'); 
                                );

After creating the tracker, you wrap the profiled lines using the startJob and stopJob methods of the tracker.

$tracker->startJob('jobName');
//profiled code
$tracker->stopJob('jobName');

统计信息

  • 总下载量: 9.72k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-04-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固