Skip to content

tomzx/profiler

Repository files navigation

PHP Profiler

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.

About

PHP profiler.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages