Download the PHP package petrknap/php-profiler without Composer
On this page you can find all versions of the php package petrknap/php-profiler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download petrknap/php-profiler
More information about petrknap/php-profiler
Files in petrknap/php-profiler
Package php-profiler
Short Description PHP profiler for short-term & long-term profiling
License LGPL-3.0-or-later
Homepage https://github.com/petrknap/php-profiler
Informations about the package php-profiler
PHP profiler for short-term & long-term profiling
This tool allows you to monitor performance and detect memory leaks as well as inconsistent performance behavior of your application over time.
Basic profiling
For basic profiling you can use a profiling helper.
The Profiling
will allow you to profile between start
and finish
methods calls.
The Profiling
is simple and cannot be turned on and off easily.
So a profiler was created for the purpose of hard-coded more complex profiling.
Complex profiling
Request a profiler as a dependency and call a profile
method on it.
How to enable / disable it
It can be easily enabled, or disabled through the DI, which provides either the NullProfiler
.
Useful features
Take snapshot
If you need to measure the current values, just call the takeSnapshot
method on the profiler.
If you want to automate it then take snapshot on tick. Or you can use a more practical cascade profiling.
Take snapshot on tick
For greater precision, you can take snapshot on each N
tick.
This will result in very detailed code tracking, which can degrade the performance of the monitored application.
Cascade profiling
The profile
method provides you a nested profiler that you can use for more detailed cascade profiling.
Run composer require petrknap/profiler
to install it.
You can support this project via donation.
The project is licensed under the terms of the LGPL-3.0-or-later
.