What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Did anyone of you already profiled some API endpoints locally? I wanted to do that with the Xdebug p

U018XELUZS9
U018XELUZS9 Posts: 167 🧑🏻‍🚀 - Cadet

Did anyone of you already profiled some API endpoints locally? I wanted to do that with the Xdebug profiler, but I’m not sure where they are saved at.

What I’ve tried already:
• I’ve added a new section to my deploy.dev.yml that looks like this:

  php:
    ini:
      "xdebug.mode": "profile"

• Profiling CLI commands works as expected, e.g. I can see the cachegrind file inside /tmp/xdebug after calling e.g. vendor/bin/console list

╰─$ ls -l /tmp/xdebug/
total 3680
-rw-r--r-- 1 spryker www-data 3767816 Apr 25 13:43 cachegrind.out.44721.gz

• I’ve sent a HTTP request to the Glue API, but there is no new cachegrind file in the output directory of Xdebug (/tmp/xdebug)
• I also checked if the file exists in one of the other containers (like the glue or zed container), but they’re empty, too

Comments

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 🧑🏻‍🚀 - Cadet
    edited April 2023

    did you sent the xdebug header with the request?

  • U018XELUZS9
    U018XELUZS9 Posts: 167 🧑🏻‍🚀 - Cadet

    Nope, but it’s also not needed, I figured it out now. I needed to create the folder inside the glue & zed docker containers with the correct permissions via mkdir -m 777 /tmp/xdebug. It’s working now 💪

    Would be nice to have support for that in the docker/sdk btw, e.g. by running docker/sdk start -p (-p for profile, just as -x for debug-mode)

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 🧑🏻‍🚀 - Cadet

    For our dev env we have php and php xdebug container. the header tells which container will be used.