-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger][Profiler] Show dispatch caller #27343
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
[Messenger][Profiler] Show dispatch caller #27343
Conversation
Very nice. Though I think it should be on |
This looks nice 😍 can the same be be done for regular dispatcher? |
@ostrolucky : Theoretically yes of course, but in practice there are usually (perhaps not that much) more regular events dispatched than messages, so this may have a significant performances impact on dev. I remember trying to do the same for the translations panel but the perfs decrease was too much important for the benefits. We could give a try anyway. @sroze : Could still go to 4.1 to me as it completes the first PR improving the panel and changes are almost only additions, small and easy to test (and code is extracted from the validator panel). But of course you're right and there is no urge. So, your call :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 to tweak the existing panel for 4.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, 👌
@@ -29,6 +29,34 @@ public function __construct(MessageBusInterface $decoratedBus) | |||
*/ | |||
public function dispatch($message) | |||
{ | |||
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 7); | |||
|
|||
$file = $trace[0]['file']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you isolate that bit (with the for
and the compact
) in its own method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thank you @ogizanagi. |
This PR was merged into the 4.2-dev branch. Discussion ---------- [Messenger][Profiler] Show dispatch caller | Q | A | ------------- | --- | Branch? | 4.2 <!-- see below --> | Bug fix? | no | New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | N/A <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A Just something I missed on my checklist in the first PR:  Commits ------- 1c2f43f [Messenger][Profiler] Show dispatch caller
Just something I missed on my checklist in the first PR: