{"id":28509397,"url":"https://github.com/justbetter/magento2-xhprofprofiler","last_synced_at":"2025-07-02T23:31:16.445Z","repository":{"id":243205661,"uuid":"811763778","full_name":"justbetter/magento2-xhprofprofiler","owner":"justbetter","description":"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.","archived":false,"fork":false,"pushed_at":"2024-11-13T08:45:30.000Z","size":18,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-08T22:09:11.096Z","etag":null,"topics":["buggregator","magento2","magento2extensions","php","xhprof"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justbetter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-07T08:53:31.000Z","updated_at":"2025-04-15T02:08:20.000Z","dependencies_parsed_at":"2024-06-07T10:47:39.604Z","dependency_job_id":"009cece8-0c36-44bb-b6bb-46bed9d8e794","html_url":"https://github.com/justbetter/magento2-xhprofprofiler","commit_stats":null,"previous_names":["justbetter/magento2-xhprofprofiler"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/justbetter/magento2-xhprofprofiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justbetter%2Fmagento2-xhprofprofiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justbetter%2Fmagento2-xhprofprofiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justbetter%2Fmagento2-xhprofprofiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justbetter%2Fmagento2-xhprofprofiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justbetter","download_url":"https://codeload.github.com/justbetter/magento2-xhprofprofiler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justbetter%2Fmagento2-xhprofprofiler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263232492,"owners_count":23434676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["buggregator","magento2","magento2extensions","php","xhprof"],"created_at":"2025-06-08T22:08:24.329Z","updated_at":"2025-07-02T23:31:16.420Z","avatar_url":"https://github.com/justbetter.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xhprof Profiler for Magento 2\n\n## Overview\n\nThis 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.\n\n## Requirements\n\n- Magento 2.4.7 or higher\n- Xhprof PHP extension\n- Compatible with XHGui\n- Compatible with Buggregator\n\n## Installation\n\n1. **Install via composer:**\n\n   ```bash\n   composer require justbetter/magento2-xhprof-profiler\n   ```\n\n2. **Enable the module:**\n\n   ```bash\n   bin/magento module:enable JustBetter_XhprofProfiler\n   ```\n\n3. **Run setup upgrade and di compile:**\n\n   ```bash\n   bin/magento setup:upgrade\n   bin/magento setup:di:compile\n   ```\n\n## Configuration for Buggregator\n\nBy default this module uses XHGui for processing the profiling data. We can use the Buggregator driver by overriding the default driver via xml:\n```\n\u003ctype name=\"JustBetter\\XhprofProfiler\\Model\\Profiler\\XhprofProfiler\"\u003e\n    \u003carguments\u003e\n        \u003cargument name=\"driver\" xsi:type=\"object\"\u003eJustBetter\\XhprofProfiler\\Model\\Profiler\\Driver\\Buggregator\u003c/argument\u003e\n    \u003c/arguments\u003e\n\u003c/type\u003e\n```\n\nConfigure the module by adding the following configuration to your `app/etc/env.php` file:\n\n```php\nreturn [\n    // ... other configurations ...\n    'xhprofprofiler' =\u003e [\n        'app_name' =\u003e 'Magento 247',\n        'endpoint' =\u003e 'http://exciting_chatelet.orb.local/profiler/store'\n    ],\n];\n```\n\n- **app_name**: The name of your application.\n- **endpoint**: The endpoint where the profiling data will be stored.\n\n## Compatibility\n\nThis module is compatible with [XHGui](https://github.com/perftools/xhgui) and [Buggregator](https://buggregator.dev/). These are graphical interfaces for viewing XHProf profiling data.\n\n### To integrate with XHGui:\n\n1. Follow the installation guide of XHGui at [XHGui](https://github.com/perftools/xhgui)\n2. By default we use the default xhprof profiler and the results are getting uploaded to XHGui.\n3. 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. \n\n#### Default XHGui configuration \nYou can pass custom configuration to the XHGui driver via the arguments like the default configuration.\n```\n\u003ctype name=\"JustBetter\\XhprofProfiler\\Model\\Profiler\\Driver\\XHGui\"\u003e\n    \u003carguments\u003e\n        \u003cargument name=\"config\" xsi:type=\"array\"\u003e\n            \u003citem name=\"profiler\" xsi:type=\"string\"\u003exhprof\u003c/item\u003e\n            \u003citem name=\"save.handler\" xsi:type=\"string\"\u003eupload\u003c/item\u003e\n            \u003citem name=\"save.handler.upload\" xsi:type=\"array\"\u003e\n                \u003citem name=\"url\" xsi:type=\"string\"\u003ehttp://xhgui.xhgui.orb.local/run/import\u003c/item\u003e\n                \u003citem name=\"timeout\" xsi:type=\"number\"\u003e3\u003c/item\u003e\n                \u003citem name=\"token\" xsi:type=\"string\"\u003etoken\u003c/item\u003e\n            \u003c/item\u003e\n        \u003c/argument\u003e\n    \u003c/arguments\u003e\n\u003c/type\u003e\n\n```\n\n### To integrate with Buggregator:\n\n1. Ensure Buggregator is installed and configured in your environment.\n2. Configure the endpoint in `app/etc/env.php` to point to Buggregator's profiling data endpoint.\n\nExample configuration:\n\n```php\nreturn [\n    // ... other configurations ...\n    'xhprofprofiler' =\u003e [\n        'app_name' =\u003e 'Magento 247',\n        'endpoint' =\u003e 'http://your_buggregator_instance/profiler/store'\n    ],\n];\n```\n\n## Usage\n\nThe profiling is automatically enabled for all requests. The module uses the `AppInterfacePlugin` to start and terminate the profiler around each request.\n\n### Key Classes and Methods\n\n- **`XhprofProfiler`**\n    - **Methods:**\n        - `__construct()`: Initializes the profiler with the given driver and optional tags.\n        - `handle()`: Starts the profiler.\n        - `terminate()`: Ends the profiler and stores the profiling data.\n\n- **`AppInterfacePlugin`**\n    - **Methods:**\n        - `aroundLaunch()`: Wraps around the application launch to start and stop the profiler.\n      \n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Contributing\n\n1. Fork the repository.\n2. Create your feature branch (`git checkout -b feature/fooBar`).\n3. Commit your changes (`git commit -am 'Add some fooBar'`).\n4. Push to the branch (`git push origin feature/fooBar`).\n5. Create a new Pull Request.\n\n## Contact\n\nIf you have any questions or need further assistance, please contact [robin@justbetter.nl].\n\n---\n\nBy following this README, you should be able to integrate and use the Xhprof Profiler in your Magento 2 application effectively. Happy profiling!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustbetter%2Fmagento2-xhprofprofiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustbetter%2Fmagento2-xhprofprofiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustbetter%2Fmagento2-xhprofprofiler/lists"}