feat(profiling): add idle phases to timeline#2343
Conversation
573c6eb to
99e54dc
Compare
It seems sensible, but could you expand on that a little bit more? I wonder if there's some correct-by-construction pattern we should employ here. |
99e54dc to
fab567f
Compare
The profiler is not needed in the This involves also keeping the static We might not need this in case we opt-in to just ignore the "last" idle timebox, which might be a corner case anyway, as this is the special case where the process shuts down. |
Be slightly more cautious about errors as well. Also use #[no_mangle] with ddog_php_prof_ prefix functions.
a07bd9f to
2f860cb
Compare
morrisonlevi
left a comment
There was a problem hiding this comment.
As long as you've checked that it actually still works after my commit (not just that the commits look okay) then I'm good with it! The prof-correctness tests pass which is a good sign, obviously, but I still like to check this kind of thing manually.
Description
This PR will add idle phases between requests and idle phases due to the
sleep()-class functions to the timeline view.In detail this covers:
sleep()usleep()time_nanosleep()time_sleep_until()Also includes one unrelated change: Moves the call to
exception::exception_profiling_mshutdown();a few lines up, so that it happens before the config and the profiler is shutdown.This PR superseeds #2315 and will only contain idle phases as in sleeping or waiting to handle a new request in synchronous PHP (as used in PHP-FPM or Apache mod_php). Everything else (like event loop idle phases) shall go to another PR.
PROF-8370
Readiness checklist
Reviewer checklist