https://github.com/aurimasniekis/epwt-xhprof
EPWT XHProf Symfony Profiler Integration
https://github.com/aurimasniekis/epwt-xhprof
Last synced: about 1 month ago
JSON representation
EPWT XHProf Symfony Profiler Integration
- Host: GitHub
- URL: https://github.com/aurimasniekis/epwt-xhprof
- Owner: aurimasniekis
- Created: 2015-04-20T09:23:49.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-22T11:54:27.000Z (about 10 years ago)
- Last Synced: 2025-04-24T06:07:01.924Z (about 1 month ago)
- Language: PHP
- Size: 1.36 MB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
EPWTXhprofBundle
================[](https://packagist.org/packages/epwt/xhprof) [](//packagist.org/packages/epwt/xhprof) [](https://packagist.org/packages/epwt/xhprof) [](https://github.com/igrigorik/ga-beacon)
EPWTXhprofBundle provides XHProf integration to Symfony profiler and wrapper for XHProf simple usage anywhere in project.
[](Resources/meta/toolbar.png)
[](Resources/meta/samples_list.png) [](Resources/meta/sample_runs.png) [](Resources/meta/sample_run.png)
[](Resources/meta/full_sample.png)## Requirements
* Symfony >= 2.3
* PHP >= 5.4
* Facebook XHProf Extension## Install via Composer
```
composer require --dev epwt/xhprof "~1.0"
```## Setting up
Register EPWTXhprofBundle in AppKernel.php file. I suggest to use it only in development or testing environment
### AppKernel.php
```php
public function registerBundles()
{
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new EPWT\XhprofBundle\EPWTXhprofBundle();
}
}
```## Usage
To use XHProf anywhere in project just initiate profiling by using global function:
```php
xhprofStart('Name of sample');
```To end profiling use:
```php
xhprofEnd();
```## Sample Usage
```php
for($a = 0; $a < 20; $a++) {
xhprofStart('Hello world');
for ($i = 0; $i < 20; $i ++) {
sleep(0.1);
}
xhprofEnd();
}
```License
-------This bundle is under the MIT license. See the complete license in the bundle:
Resources/meta/LICENSE
About
-----EPWTXhprofBundle is brought to you by [Aurimas Niekis](https://github.com/gcds).
Reporting an issue or a feature request
---------------------------------------Issues and feature requests are tracked in the [Github issue tracker](https://github.com/gcds/epwt-xhprof/issues).
When reporting a bug, it may be a good idea to reproduce it in a basic project
built using the [Symfony Standard Edition](https://github.com/symfony/symfony-standard)
to allow developers of the bundle to reproduce the issue by simply cloning it
and following some steps.