Download the PHP package sandstorm/phpprofiler without Composer
On this page you can find all versions of the php package sandstorm/phpprofiler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sandstorm/phpprofiler
More information about sandstorm/phpprofiler
Files in sandstorm/phpprofiler
Package phpprofiler
Short Description Base package for collecting timers and xhprof traces. Can be used with sandstorm/plumber for visualization.
License GPL-3.0+
Informations about the package phpprofiler
PhpProfiler -- Profiling Neos Flow Applications
-- Measuring the flow of your application --
PhpProfiler is a profiling and tracing tool that measures time spent in various parts of your application flow and can leverage XHProf to profile applications.
It stores data in a format understood by Plumber and can also store to the databases used by XHProf.io (http://xhprof.io/) and XHGui (https://github.com/preinheimer/xhgui).
Installation
To install, just use composer:
The system will automatically install PhpProfiler and use XHProf if it is installed.
Configuration
This is the default configuration:
To enable the XHProf.io and XHGui backends adjust the configuration as needed, but keep in mind that any needed setup (e.g. databasae creation) needs to be done as described in the respective documentation.
Limiting Profiling Run Probability
Using the environment variable PHPPROFILER_SAMPLINGRATE
the probability of runs being
profiled can be changed. If the variable is not set, every run will be profiled. If a float
between 0 and 1 is given, that represents a probability between 0% and 100% for every run
to trigger profiling.
If limiting the probability to a low enough value, it is feasible to leave PhpProfiler running on production instances.
Profiling Custom Code
PhpProfiler collects regular XHProf data and some data specific to TYPO3 Flow, Neos and CMS.
To collect profiling information on critical parts of a custom application, various options exist.
Profiling method calls using an Aspect (NEW!)
You can use the Sandstorm\PhpProfiler\Annotations\Profile
annotation on a method in order
to profile it:
Adding custom timers
When hunting for performance bottlenecks, it often makes sense to add custom timers throughout your application. Doing so is quite easy, as the following example demonstrates:
If the timer name contains a colon (:
), related timers are grouped together in the User Interface:
It's not a problem if multiple timers are active at the same time; even the same timer can be active multiple times at the same time. The following example is perfectly valid:
Furthermore, the startTimer
allows a second array
argument containing additional information
which is shown in the UI.
Setting Options
Furthermore, you can set meta-information on the current run (which is called options
currently):
Viewing the results
For the Plumber UI install the Plumber package as described in it's manual.
For XHProf.ui and XHGui follow the instructions given on the project websites.
Credits
Originally developed by Sebastian Kurfürst, Sandstorm Media UG (haftungsbeschränkt)
Code from the XHProf.io and XHGui projects is included for storing the data.
License
All the code is licensed under the GPL license.