Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDEV] Support for xhprof/xhgui #4325

Merged
merged 6 commits into from
Nov 19, 2024
Merged

[DDEV] Support for xhprof/xhgui #4325

merged 6 commits into from
Nov 19, 2024

Conversation

sreichel
Copy link
Contributor

@sreichel sreichel commented Oct 31, 2024

Description (*)

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

  • git-ignore config-file
  • updated unittest

Related Pull Requests

  1. see Automate Drupal setup ddev/ddev-xhgui#33

Manual testing scenarios (*)

Using DDEV ...

  • add ddev.xhgui.php to app/etc/includes
if (getenv('IS_DDEV_PROJECT') && getenv('NO_XHGUI') !== '1') {
    if (file_exists($xhgui = '/mnt/ddev_config/xhgui/collector/xhgui.collector.php')) {
        require_once $xhgui;
    }
}
  • ddev xhprof ... to enable profiler
  • ddev xhgui ... to watch results

@github-actions github-actions bot added composer Relates to composer.json phpunit labels Oct 31, 2024
kiatng
kiatng previously approved these changes Nov 14, 2024
@addison74 addison74 changed the title DDEV: support for xhprof/xhgui [DDEV] Support for xhprof/xhgui Nov 17, 2024
@addison74
Copy link
Contributor

addison74 commented Nov 17, 2024

@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 ddev/ddev-xhgui#33 (comment) 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
Copy link
Contributor Author

sreichel commented Nov 18, 2024

Have I missed anything so far?

No. This should be all.

In this comment ddev/ddev-xhgui#33 (comment) 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
Copy link
Contributor

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

# Conflicts:
#	composer.lock
@sreichel
Copy link
Contributor Author

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

Thanks. :)

But wait for ddev/ddev-xhgui#33. This could be automated a bit.

@kiatng kiatng merged commit a156f8f into OpenMage:main Nov 19, 2024
21 checks passed
@sreichel sreichel deleted the ddev-xhgui branch November 19, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
composer Relates to composer.json phpunit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants