PHPackages                             justbetter/magento2-xhprof-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. justbetter/magento2-xhprof-profiler

ActiveMagento2-module

justbetter/magento2-xhprof-profiler
===================================

Xhprof profiler integration for Magento

0.2.0(1y ago)6482MITPHPPHP &gt;=8.2

Since Oct 23Pushed 1y ago4 watchersCompare

[ Source](https://github.com/justbetter/magento2-xhprofprofiler)[ Packagist](https://packagist.org/packages/justbetter/magento2-xhprof-profiler)[ RSS](/packages/justbetter-magento2-xhprof-profiler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (4)Used By (0)

Xhprof Profiler for Magento 2
=============================

[](#xhprof-profiler-for-magento-2)

Overview
--------

[](#overview)

This module integrates Xhprof profiling capabilities into your Magento 2 application. It provides an easy way to profile and analyze your application's performance by tracking and storing profiling data.

Requirements
------------

[](#requirements)

- Magento 2.4.7 or higher
- Xhprof PHP extension
- Compatible with XHGui
- Compatible with Buggregator

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

[](#installation)

1. **Install via composer:**

    ```
    composer require justbetter/magento2-xhprof-profiler
    ```
2. **Enable the module:**

    ```
    bin/magento module:enable JustBetter_XhprofProfiler
    ```
3. **Run setup upgrade and di compile:**

    ```
    bin/magento setup:upgrade
    bin/magento setup:di:compile
    ```

Configuration for Buggregator
-----------------------------

[](#configuration-for-buggregator)

By default this module uses XHGui for processing the profiling data. We can use the Buggregator driver by overriding the default driver via xml:

```

        JustBetter\XhprofProfiler\Model\Profiler\Driver\Buggregator

```

Configure the module by adding the following configuration to your `app/etc/env.php` file:

```
return [
    // ... other configurations ...
    'xhprofprofiler' => [
        'app_name' => 'Magento 247',
        'endpoint' => 'http://exciting_chatelet.orb.local/profiler/store'
    ],
];
```

- **app\_name**: The name of your application.
- **endpoint**: The endpoint where the profiling data will be stored.

Compatibility
-------------

[](#compatibility)

This module is compatible with [XHGui](https://github.com/perftools/xhgui) and [Buggregator](https://buggregator.dev/). These are graphical interfaces for viewing XHProf profiling data.

### To integrate with XHGui:

[](#to-integrate-with-xhgui)

1. Follow the installation guide of XHGui at [XHGui](https://github.com/perftools/xhgui)
2. By default we use the default xhprof profiler and the results are getting uploaded to XHGui.
3. Update default configuration via di.xml, check [config.default.php](https://github.com/perftools/xhgui/blob/0.23.x/config/config.default.php) for the possible options.

#### Default XHGui configuration

[](#default-xhgui-configuration)

You can pass custom configuration to the XHGui driver via the arguments like the default configuration.

```

            xhprof
            upload

                http://xhgui.xhgui.orb.local/run/import
                3
                token

```

### To integrate with Buggregator:

[](#to-integrate-with-buggregator)

1. Ensure Buggregator is installed and configured in your environment.
2. Configure the endpoint in `app/etc/env.php` to point to Buggregator's profiling data endpoint.

Example configuration:

```
return [
    // ... other configurations ...
    'xhprofprofiler' => [
        'app_name' => 'Magento 247',
        'endpoint' => 'http://your_buggregator_instance/profiler/store'
    ],
];
```

Usage
-----

[](#usage)

The profiling is automatically enabled for all requests. The module uses the `AppInterfacePlugin` to start and terminate the profiler around each request.

### Key Classes and Methods

[](#key-classes-and-methods)

- **`XhprofProfiler`**

    - **Methods:**
        - `__construct()`: Initializes the profiler with the given driver and optional tags.
        - `handle()`: Starts the profiler.
        - `terminate()`: Ends the profiler and stores the profiling data.
- **`AppInterfacePlugin`**

    - **Methods:**
        - `aroundLaunch()`: Wraps around the application launch to start and stop the profiler.

License
-------

[](#license)

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing
------------

[](#contributing)

1. Fork the repository.
2. Create your feature branch (`git checkout -b feature/fooBar`).
3. Commit your changes (`git commit -am 'Add some fooBar'`).
4. Push to the branch (`git push origin feature/fooBar`).
5. Create a new Pull Request.

Contact
-------

[](#contact)

If you have any questions or need further assistance, please contact \[\].

---

By following this README, you should be able to integrate and use the Xhprof Profiler in your Magento 2 application effectively. Happy profiling!

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~20 days

Total

2

Last Release

545d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d00b3f55cd4ae8b8cfb001a644ed6c7a1127a956c24375bcfe16ce12bd89bed?d=identicon)[justbetter](/maintainers/justbetter)

---

Top Contributors

[![rbnmulder](https://avatars.githubusercontent.com/u/1227535?v=4)](https://github.com/rbnmulder "rbnmulder (6 commits)")

---

Tags

buggregatormagento2magento2extensionsphpxhprofmagentoxhprofbuggregatorjustbetter

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/justbetter-magento2-xhprof-profiler/health.svg)

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

###  Alternatives

[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8044.5M33](/packages/smile-elasticsuite)[yireo/magento2-webp2

Magento 2 module to add WebP support to the Magento frontend

2091.2M7](/packages/yireo-magento2-webp2)[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[yireo/magento2-googletagmanager2

Add Google Tag Manager to Magento

167930.4k5](/packages/yireo-magento2-googletagmanager2)[redchamps/module-clean-admin-menu

It will merge all third party extensions menu items to single menu item named 'Extensions'.

164416.3k](/packages/redchamps-module-clean-admin-menu)[yireo/magento2-checkouttester2

Checkout Tester for Magento 2

93477.4k1](/packages/yireo-magento2-checkouttester2)

PHPackages © 2026

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