tomzx/profiler

v0.1.0 2016-10-26 09:44 UTC

This package is auto-updated.

Last update: 2024-04-10 08:14:00 UTC


README

License Latest Stable Version Latest Unstable Version Build Status Code Quality Code Coverage Total Downloads

PHP Profiler is a small library that provides profiling functionality. It uses the Chrome debugging protocol that is part of the Chrome DevTools. This means that you can generate .cpuprofile-compatible files that can then be loaded into Chrome profiles in the developer tools.

Getting started

  • In a console, php composer.phar require tomzx/profiler
$profiler = new \tomzx\Profiler\StackBasedProfiler();
$profiler->start();

// In your code
$profiler->push('My identifier');
///...
$profiler->pop();

$profile = $profiler->stop();
file_put_contents('test.cpuprofile', json_encode($profile));

License

The code is licensed under the MIT license. See LICENSE.