-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Performance profiler loading "Processing profile..." forever #109
Comments
Resolved. It was an issue with my naming convention for the filename. I changed my .env:
This is after advice from Dericks video here: https://www.youtube.com/watch?v=ttQgLBSpVvc |
Hey, have you figured out why do you need to change the profile file name? The default filename uses PID as part of the name, I wonder if the processes get reused under php-fpm and different requests end up writing to the same file effectively corrupting the profile. 🤔 |
Good guess. The profiler only output 2 files, here are their headers: cachegrind.out.15
cachegrind.out.16
So I think all the HTTP requests were appended to that cachegrind.out.16 file. If you watch the YouTube video at 1:15 (https://youtu.be/ttQgLBSpVvc?t=74), he says the default profiler_output_name isnt very useful 😆 and recomends the %R (See allowed specifiers here: https://xdebug.org/docs/all_settings#trace_output_name). |
Sorry if I am posting too much, I am now learning more about Xdebug 😄 In another video, he uses the timestamp in the filename too:
|
No, I appreciate the info. I wonder why keep the default tho if it's the case it doesn't work well with php-fpm, which is by far the most used way to run php nowdays. Personally I would probably use the pid (%p) in combination with timestamp (%u) or random number (%r), but Clockwork shouldn't care. It might be a good idea to bring this up with Xdebug devs and suggest better defaults here. I will also update Clockwork docs to mention changing this setting. |
I used WebGrind to read the default filename and it worked fine, so it makes me think its something with Clockwork parsing the file wrong. But not a huge issue. Perhaps the default file is to make it easier to cleanup, as it could endup filling your tmp directory. |
Using a fresh Laravel install
curl -s "https://laravel.build/example-app" | bash
and ran./vendor/bin/sail artisan migrate
.Added these to my .env:
Then
./vendor/bin/sail composer require itsgoingd/clockwork
.Then
./vendor/bin/sail up
.When I have
http://localhost/clockwork/app
open in Chrome, then make a request tohttp://localhost
in another Chrome tab, the request appears in the Clockwork app! But, if I click "Profiler", it is stuck on "Processing profile..." forever.I also get a JS bug in Chrome dev tools, I tracked it down to this line:
https://github.com/underground-works/clockwork-app/blob/master/src/features/callgrind/callgrind.js#L62
The line is a string of value
"0"
, but other times its undefined... So it cant split it by ' '.Do you know if this is valid? Or if its something wrong with my Xdebug setup/ profiling?
My uneducated guess is that the cachegrind.out.%p files are still being written too when Clockwork requests them, so its only reading half or none of a line. I only think this because I opened one of them and it was always being updated. BUT, could be a red herring.
Thanks for any help. Clockwork is and has always been a great addition to my tools :D
The text was updated successfully, but these errors were encountered: