PHPackages                             perftools/php-profiler - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. perftools/php-profiler

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

perftools/php-profiler
======================

PHP Profiling based on XHGui

1.2.0(1y ago)1651.9M↑13.5%29[3 issues](https://github.com/perftools/php-profiler/issues)[6 PRs](https://github.com/perftools/php-profiler/pulls)13MITPHPPHP ^5.3.0 || ^7.0 || ^8.0

Since Mar 29Pushed 1y ago4 watchersCompare

[ Source](https://github.com/perftools/php-profiler)[ Packagist](https://packagist.org/packages/perftools/php-profiler)[ RSS](/packages/perftools-php-profiler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (40)Used By (13)

PHP Profiler
============

[](#php-profiler)

A PHP profiling library to submit profilings to [XHGui](https://github.com/perftools/xhgui).

Supported profilers:

- [Tideways XHProf v5.x](#tideways-xhprof-5): PHP &gt;= 7.0
- [XHProf](#xhprof): PHP &gt;= 5.3, PHP &gt;= 7.0
- [Tideways v4.x](#tideways-4x): PHP &gt;= 7.0
- [UProfiler](#uprofiler): PHP &gt;= 5.3, &lt; PHP 7.0

This profiling library will auto-detect any supported profiler and use that. The specific profiler can be chosen by `profiler` config key.

Goals
-----

[](#goals)

- Compatibility with PHP &gt;= 5.3.0
- No dependencies aside from the relevant extensions
- Customizable and configurable so you can build your own logic on top of it

Usage
-----

[](#usage)

In order to profile your application, you need to:

- [Install this package](#installation)
- [Install profiler extension](#installing-profilers)
- [Instantiate the profiler](#create-profiler)
- [Configure saver to send data to XHGui](#savers)
- [Import jsonl files](#import-jsonl-files) (optional)

Installation
------------

[](#installation)

The supported way to install this package is via [composer](https://getcomposer.org/):

```
composer require perftools/php-profiler

```

Create profiler
---------------

[](#create-profiler)

Creating profiler would be something like this:

```
