Download the PHP package justbetter/magento2-xhprof-profiler without Composer
On this page you can find all versions of the php package justbetter/magento2-xhprof-profiler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download justbetter/magento2-xhprof-profiler
More information about justbetter/magento2-xhprof-profiler
Files in justbetter/magento2-xhprof-profiler
Package magento2-xhprof-profiler
Short Description Xhprof profiler integration for Magento
License MIT
Informations about the package magento2-xhprof-profiler
Xhprof Profiler for Magento 2
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
- Magento 2.4.7 or higher
- Xhprof PHP extension
- Compatible with Buggregator
Installation
-
Install via composer:
-
Enable the module:
- Run setup upgrade and di compile:
Configuration
Configure the module by adding the following configuration to your app/etc/env.php
file:
- app_name: The name of your application.
- endpoint: The endpoint where the profiling data will be stored.
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
-
XhprofProfiler
- Constants:
HEADER
: The header key used to enable Xhprof profiling.IGNORED_FUNCTIONS_KEY
: The key for ignored functions in the profiler.
- Methods:
__construct()
: Initializes the profiler with the given driver, deployment configuration, and optional tags.handle()
: Starts the profiler.terminate()
: Ends the profiler and stores the profiling data.
- Constants:
AppInterfacePlugin
- Methods:
aroundLaunch()
: Wraps around the application launch to start and stop the profiler.
- Methods:
Buggregator Compatibility
This module is compatible with Buggregator, a debug and profiler tool for PHP applications. Buggregator can collect and visualize profiling data generated by this module, providing a comprehensive debugging and performance analysis experience.
To integrate with Buggregator:
- Ensure Buggregator is installed and configured in your environment.
- Configure the endpoint in
app/etc/env.php
to point to Buggregator's profiling data endpoint.
Example configuration:
Example
Here is an example of how the profiler is used in the plugin:
Exception Handling
The terminate
method of the XhprofProfiler
class can throw the following exceptions:
- FileSystemException: If there is an issue with the file system.
- RuntimeException: If there is a runtime issue.
Ensure you have proper exception handling in place when integrating this module.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
- Fork the repository.
- Create your feature branch (
git checkout -b feature/fooBar
). - Commit your changes (
git commit -am 'Add some fooBar'
). - Push to the branch (
git push origin feature/fooBar
). - Create a new Pull Request.
Contact
If you have any questions or need further assistance, please contact [[email protected]].
By following this README, you should be able to integrate and use the Xhprof Profiler in your Magento 2 application effectively. Happy profiling!
All versions of magento2-xhprof-profiler with dependencies
magento/framework Version *
magento/module-config Version ^101.2
spiral-packages/profiler Version ^1.2
perftools/php-profiler Version ^1.1