PHPackages                             link0/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. link0/profiler

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

link0/profiler
==============

A profiling library for PHP using XHProf or uprofiler and providing multiple persistance layers

v1.0.1(11y ago)14896[3 issues](https://github.com/link0/profiler/issues)[2 PRs](https://github.com/link0/profiler/pulls)1MITPHPPHP &gt;=5.3.3

Since Oct 19Pushed 8y ago3 watchersCompare

[ Source](https://github.com/link0/profiler)[ Packagist](https://packagist.org/packages/link0/profiler)[ RSS](/packages/link0-profiler/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (6)Used By (1)

Link0\\Profiler
===============

[](#link0profiler)

[![Latest Stable Version](https://camo.githubusercontent.com/a7726a5398227328c148fe15d02ef412395a7aa0b2a89a7d521d2dae6e885ac9/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b302f70726f66696c65722f762f737461626c652e737667)](https://packagist.org/packages/link0/profiler)[![Total Downloads](https://camo.githubusercontent.com/c5437c67b277249b566e1d441f13e65c2ae0ab63bc9e007c6e8e7a9b5da868e2/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b302f70726f66696c65722f646f776e6c6f6164732e737667)](https://packagist.org/packages/link0/profiler)[![License](https://camo.githubusercontent.com/1e63e41cf6e204b75d613b6034926787fe57b9e97bd268253fad7815aa7933c3/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b302f70726f66696c65722f6c6963656e73652e737667)](https://packagist.org/packages/link0/profiler)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0cc8fc67991e1578e000ddcc6bfc3469e19117a031b1e98f7000442fcf74ec1f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c696e6b302f70726f66696c65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/link0/profiler/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/8406d6688e9358467627585663613595add5fd6a2592a883e466e1cf6da57edf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c696e6b302f70726f66696c65722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/link0/profiler/?branch=master)[![Build Status](https://camo.githubusercontent.com/89bd934321052c0ea069ae9905363e4455724f897f22d8b906f912cc966b771a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c696e6b302f70726f66696c65722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/link0/profiler/build-status/master)

**Link0/Profiler** as a layer over XHProf profiling, and persisting profiles for later analysis.

The code is quite new, so please report any bugs if you encounter them, even though unit-tests should cover 100% of the code.

All ideas are welcome, and contributors as well.

[![SensioLabsInsight](https://camo.githubusercontent.com/339a74d85268bfc6f7c86994c7a2d175381e5ef2af1003fe3b2433d88935cab0/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f31313531633937332d373563332d343165612d623934342d3165363737653431383632612f6269672e706e67)](https://insight.sensiolabs.com/projects/1151c973-75c3-41ea-b944-1e677e41862a)

Requirements
============

[](#requirements)

- PHP 5.4 is required but using the latest version of PHP is highly recommended
- [XHProf](http://pecl.php.net/package/xhprof) or [Uprofiler](https://github.com/FriendsOfPHP/uprofiler) is required to do actual profiling

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

[](#installation)

To add **Link0/Profiler** as a local, per-project dependency to your project, simply require the dependency `link0/profiler` with composer.

```
composer require "link0/profiler" "~1.0"

```

There is also a Symfony2 bundle available, see [Link0/ProfilerBundle](https://github.com/link0/ProfilerBundle). To install it, use the following composer package

```
composer require "link0/profiler-bundle" "~1.0"

```

To install XHProf on your machine

```
pecl install -f xhprof

```

or

```
apt-get install php5-xhprof

```

or

```
# If you have the josegonzalez/homebrew-php formulae tapped, install them with brew.
# Change your version accordingly
brew install php55-xhprof

```

Quick setup with XHGui
======================

[](#quick-setup-with-xhgui)

To get started with this profiler package and XHGui, setup XHGui to listen to your MongoDB instance.

From every project that you want to profile, and aggregate the results to the centralized server, setup the following config:

```
    $connectionAddress = 'mongodb://mongodb.example.com:27017';
    $mongoClient = new \Link0\Profiler\PersistenceHandler\MongoDbHandler\MongoClient($connectionAddress);
    $persistenceHandler = new \Link0\Profiler\PersistenceHandler\MongoDbHandler($mongoClient);
    $profiler = new \Link0\Profiler\Profiler($persistenceHandler);
    $profiler->start();
```

More in-depth
=============

[](#more-in-depth)

The library is all about the [Profiler](https://github.com/link0/profiler/blob/master/src/Link0/Profiler/Profiler.php), you want to instantiate that and let it do it's magic

```
$profiler = new \Link0\Profiler\Profiler();
$profiler->start();
print_r($profiler->stop());
```

If you want to start profiling using a browser based tool like [XHProf Helper](https://chrome.google.com/webstore/detail/xhprof-helper/adnlhmmjijeflmbmlpmhilkicpnodphi?hl=en), You can use this method

```
$profiler = new \Link0\Profiler\Profiler();
$profiler->startOn(@$_COOKIE['_profiler']);
// or
$profiler->startOn(@$_COOKIE['XHProf_Profile']);
```

If you want to store the results, you can pass a [PersistenceHandler](https://github.com/dennisdegreef/profiler/tree/cleanup/src/Link0/Profiler/PersistenceHandler) object to the Profiler

```
$persistenceHandler = new \Link0\Profiler\PersistenceHandler\MemoryHandler();
$profiler = new \Link0\Profiler\Profiler($persistenceHandler);
```

This way, the results are stored in memory, may not be that convienient, but can be nice to play around with.

There is also an implementation to store profiles on the filesystem, using the [Flysystem](http://flysystem.thephpleague.com/) library.

```
$filesystemAdapter = new \League\Flysystem\Adapter\Local('/tmp/profiler');
$filesystem = new \League\Flysystem\Filesystem($filesystemAdapter);
$persistenceHandler = new \Link0\Profiler\PersistenceHandler\FilesystemHandler($filesystem);
$profiler = new \Link0\Profiler\Profiler($persistenceHandler);
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 98.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~35 days

Total

5

Last Release

4132d ago

Major Versions

v0.1.2 → v1.0.02015-03-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/331efd6a491b9b408231d3c2e2f253e5245a4ef4434301fe8e4593dc9a56c54b?d=identicon)[link0](/maintainers/link0)

![](https://www.gravatar.com/avatar/727e8758d552c828426421f0e9926cfb477f42e01290f689e61d0611f9cd9860?d=identicon)[dennisdegreef](/maintainers/dennisdegreef)

---

Top Contributors

[![dennisdegreef](https://avatars.githubusercontent.com/u/361905?v=4)](https://github.com/dennisdegreef "dennisdegreef (198 commits)")[![rtuin](https://avatars.githubusercontent.com/u/360150?v=4)](https://github.com/rtuin "rtuin (2 commits)")[![jildertmiedema](https://avatars.githubusercontent.com/u/3383186?v=4)](https://github.com/jildertmiedema "jildertmiedema (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/link0-profiler/health.svg)

```
[![Health](https://phpackages.com/badges/link0-profiler/health.svg)](https://phpackages.com/packages/link0-profiler)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[concrete5/core

Concrete core subtree split

20166.1k52](/packages/concrete5-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
