OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
870 stars 436 forks source link

[DDEV] Support for `xhprof`/`xhgui` #4325

Closed sreichel closed 3 days ago

sreichel commented 3 weeks ago

Description (*)

Support https://github.com/ddev/ddev-xhgui

Related Pull Requests

  1. see https://github.com/ddev/ddev-xhgui/pull/33

Manual testing scenarios (*)

Using DDEV ...

if (getenv('IS_DDEV_PROJECT') && getenv('NO_XHGUI') !== '1') {
    if (file_exists($xhgui = '/mnt/ddev_config/xhgui/collector/xhgui.collector.php')) {
        require_once $xhgui;
    }
}
addison74 commented 5 days ago

@sreichel - Before starting testing I would like to clarify all the steps based on the description.

  1. Install the perftools/php-profiler package using the command
ddev composer require perftools/php-profiler --dev
  1. Edit the app/Mage.php file just after the / AUTOLOADER PATCH / section to include the collector
if (file_exists("/mnt/ddev_config/xhgui/collector/xhgui.collector.php")) {
 require_once "/mnt/ddev_config/xhgui/collector/xhgui.collector.php";
}
  1. Create a file named ddev.xhgui.php in the app/etc/includes directory with this content
<?php
if (getenv('IS_DDEV_PROJECT') && getenv('NO_XHGUI') !== '1') {
    if (file_exists($xhgui = '/mnt/ddev_config/xhgui/collector/xhgui.collector.php')) {
        require_once $xhgui;
    }
}
  1. Run the ddev xhprof command to start profiling. XHGui is now available at https://yourproject.ddev.site:8142.

  2. Run the ddev xhgui to watch results.

Have I missed anything so far? It will help me to add this information in this file https://github.com/OpenMage/magento-lts/blob/f39a667c9d9eda4c4c015e29f40c78d8ed2dec38/docs/content/developers/ddev.md, after merging.

In this comment https://github.com/ddev/ddev-xhgui/pull/33#issuecomment-2450269258 you say the step 2 from above has no effect, we don't need to edit app/Mage.php, but it is still in the DDEV-XHGui documentation.

sreichel commented 4 days ago

Have I missed anything so far?

No. This should be all.

In this comment https://github.com/ddev/ddev-xhgui/pull/33#issuecomment-2450269258 you say the step 2 from above has no effect, we don't need to edit app/Mage.php, but it is still in the DDEV-XHGui documentation.

DOC will be updated later.

addison74 commented 4 days ago

OK. Please resolve the conflict related to the composer.lock file.

sreichel commented 4 days ago

It will help me to add this information in this file.

Thanks. :)

But wait for https://github.com/ddev/ddev-xhgui/pull/33. This could be automated a bit.