PHPackages                             fonclub/liveprof - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. fonclub/liveprof

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

fonclub/liveprof
================

A performance monitoring system for running on live sites

01PHP

Since Feb 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/fonclub/liveprof)[ Packagist](https://packagist.org/packages/fonclub/liveprof)[ RSS](/packages/fonclub-liveprof/feed)WikiDiscussions dev Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Live Profiler
=============

[](#live-profiler)

[![logo](images/liveprof_logo.png "logo")](images/liveprof_logo.png)

Live Profiler is a system-wide performance monitoring system in use at Badoo that is built on top of [XHProf](http://pecl.php.net/package/xhprof) or its forks ([Uprofiler](https://github.com/FriendsOfPHP/uprofiler) or [Tideways](https://github.com/tideways/php-profiler-extension)). Live Profiler continually gathers function-level profiler data from production tier by running a sample of page requests under XHProf.

[Live profiler UI](https://github.com/badoo/liveprof-ui) then aggregates the profile data corresponding to individual requests by various dimensions such a time, page type, and can help answer a variety of questions such as: What is the function-level profile for a specific page? How expensive is function "foo" across all pages, or on a specific page? What functions regressed most in the last day/week/month? What is the historical trend for execution time of a page/function? and so on.

Here is [a plugin](https://plugins.jetbrains.com/plugin/13767-live-profiler) for PhpStorm to see the method performance directly in IDE.

[liveprof.org](http://liveprof.org/) shows all features and can be used for test purposes.

[![Build Status](https://camo.githubusercontent.com/8fbd613f8a0946b1243659a6f0de8899db4ed1b861ee9e8627f939d49d48c419/68747470733a2f2f7472617669732d63692e6f72672f6261646f6f2f6c69766570726f662e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/badoo/liveprof)[![codecov](https://camo.githubusercontent.com/dcfe7d5b5b0756acf3c30f0ef4d1ba7d0573e10f98194f887d11d7233c732222/68747470733a2f2f636f6465636f762e696f2f67682f6261646f6f2f6c69766570726f662f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/badoo/liveprof)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8e643508eba1cc1daaef0961802fb16397349e02297b967fce7489ac465db8d7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6261646f6f2f6c69766570726f662f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/badoo/liveprof/?branch=master)[![GitHub license](https://camo.githubusercontent.com/53321e80d4b949075bbc408fa2d628683f480b34050a5ba46cafe6d6222c1198/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6261646f6f2f6c69766570726f662e737667)](https://github.com/badoo/liveprof/blob/master/LICENSE)

System Requirements
===================

[](#system-requirements)

- PHP version 5.4 or later / hhvm version 3.25.0 or later
- One of [XHProf](http://pecl.php.net/package/xhprof), [Uprofiler](https://github.com/FriendsOfPHP/uprofiler) or [Tideways](https://github.com/tideways/php-profiler-extension) to profile and collect the data. You can use other profiler which returns data in the follow format: ```
    $data = [
        [
            'parent_method==>child_method' => [
                'param' => 'value'
            ]
        ]
    ];
    ```
- Database extension to save profiling results to the database.

Installation
============

[](#installation)

1. You can install Live Profiler via [Composer](https://getcomposer.org/):

```
php composer.phar require badoo/liveprof
```

2. Prepere a storage for results depends on mode

\[save data in database\] If you use DB mode you need to prepare a database server. You can use any driver described [here](https://www.doctrine-project.org/projects/doctrine-dbal/en/2.8/reference/configuration.html#configuration) or implement the custom one. You need run a script to configure database. This script creates "details" table:

```
LIVE_PROFILER_CONNECTION_URL=mysql://db_user:db_password@db_mysql:3306/Profiler?charset=utf8 php vendor/badoo/liveprof/bin/install.php
```

\[save data in files\] It's also possible to save profiling result into files. To do it prepare a directory with write permissions.

\[send data to demo site\] You need to visit [liveprof.org](http://liveprof.org/) , sign in and copy API key.

3. Init a profiler before working code in the project entry point (usually public/index.php).

Usage
=====

[](#usage)

There is an example of usage a profiler with default parameters:

```
