Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Messenger] Improve the profiler panel#27202

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:4.1fromogizanagi:messenger/profiler_improvments
May 13, 2018
Merged

[Messenger] Improve the profiler panel#27202

fabpot merged 1 commit intosymfony:4.1fromogizanagi:messenger/profiler_improvments
May 13, 2018

Conversation

@ogizanagi
Copy link
Contributor

@ogizanagiogizanagi commentedMay 8, 2018
edited
Loading

QA
Branch?4.1
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsN/A
LicenseMIT
Doc PRN/A

This is an attempt to enhance the profiler panel a bit.

with the following messages dispatched:

$queryBus->dispatch(Envelope::wrap(newGetGreetingsQuery('Hello you'))    ->with(newJustAFriendOfMine())    ->with(newAndHisPlusO̶n̶e̶Eleven()));$commandBus->dispatch(newSendGiftCommand());$queryBus->dispatch(newGetGreetingsQuery('Exterminate!'));

Before

screenshot 2018-05-12 a 13 57 57

🐛calls order are wrong here, fixed in this PR

After

collapsed

screenshot 2018-05-12 a 13 18 35

screenshot 2018-05-12 a 13 26 44

📝When loading the page, all messages details are collapsed by default but the first one per tab.

expanded

screenshot 2018-05-12 a 13 49 42

live

mai-12-2018 13-55-40

toolbar (with exceptions)

screenshot 2018-05-10 a 23 18 32

Notes

  • Table headers are clickable, so you can jump directly to the message class in the code
  • Reversing headers/rows allows to have a wider space for dumps and allows to add more entries in the future. This is an issue we already have with the Validator panel (when there is both an invalid value as object and a constraint violation dumped) which I'd like to revamp soon.
  • I wonder if we should keep the dispatched messages in call order, or if we can segregate by bus (using tabs?).
  • we could add a left container listing messages classes only, allowing to show details of a single message dispatched on a right container (similar to what the Form panel does). I'll probably suggest the same for the Validator panel.

yceruto, ro0NL, ikhsan017, jeremyb, billgsm, and apfelbox reacted with thumbs up emojisroze, yceruto, tlfbrito, and Koc reacted with heart emoji
@yceruto
Copy link
Member

I wonder if we should keep the dispatched messages in call order, or if we can segregate by bus (using tabs?).

+1 for segregate by bus using tabs.

@sroze
Copy link
Contributor

I wonder if we should keep the dispatched messages in call order, or if we can segregate by bus (using tabs?).

👍 to keep it by call order. It makes much more sense when you want to investigate what happened (which is the point of the profiler)

@ogizanagi
Copy link
ContributorAuthor

@sroze : Then what about a default "All" tab ? :)

yceruto and sroze reacted with thumbs up emoji

@sroze
Copy link
Contributor

Reversing headers/rows allows to have a wider space for dumps and allows to add more entries in the future

Maybe we can have a collapsed/expanded version? The collapsed will just be the bus name and the message name. You can click on it and it displays this tabled version?

ogizanagi reacted with thumbs up emoji

@ro0NL
Copy link
Contributor

What about a filter and perhaps share some logic with#24263?

sroze, ogizanagi, and yceruto reacted with thumbs up emoji

@ogizanagi
Copy link
ContributorAuthor

ogizanagi commentedMay 10, 2018
edited
Loading

New version pushed & screens updated in PR description.

@sroze : A simple collapsible version is indeed better. Long messages' FQCN wouldn't suit great for what I had in mind at first, and the amount of messages per request would never be big, so it's a great idea!

@ro0NL : when#24263 is merged, let's see what we can do here. For now, tabs are perfect to me :)

*/
class TraceableMessageBusimplements MessageBusInterface
{
privatestatic$calls =0;
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This might not be ideal. Use a microtime to keep calls order instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What's wrong with keeping PHP incrementing the keys with$this->dispatchedMessages[]?

Copy link
ContributorAuthor

@ogizanagiogizanagiMay 11, 2018
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

There are multiple buses, so multiple traceable buses. This ensures the calls order is kept accross all instances, while iterating over each traceable buses in the datacollector to get their dispatched messages separately won't 😉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Oh yeah, obviously. 🤦‍♂️ . What about adding thetime (asmicrotime(true)) in thedispatchedMessage object andusorting them when displaying or late collecting them? (using it as the key might - very very unlikely but still - colide)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

That's what I suggested in#27202 (comment) :p
I take that as a "Let's do it" then 😄 Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

🙊

@yceruto
Copy link
Member

yceruto commentedMay 10, 2018
edited
Loading

This looks great! just a minor comment, making bg-red each counter with exception is a bit confusing at first sight, is there other way to represent that the tab has exceptions?

@ogizanagi
Copy link
ContributorAuthor

making bg-red each counter with exception is a bit confusing at first sight, is there other way to represent that the tab has exceptions?

Not sure. Actually that's kind of what we're already used to when there is an "error". For instance any item in the toolbar or the menu.
The "Infos & Error tabs" in the logger panel only shows the nb of error logs instead of the whole count when there is an error, so looses an info.
Not sure showing both total & with exceptions counts would render nicely neither.

@yceruto
Copy link
Member

For example, could we show aborder-bottom: 2px solid #B0413E; with grey bg if not all are exceptions and show as now if all of them are exceptions?

@ogizanagi
Copy link
ContributorAuthor

screenshot 2018-05-11 a 00 22 05

Any opinion? I think I like it :)

yceruto and sroze reacted with heart emoji

@yceruto
Copy link
Member

Another sample of the same:
messages_color

Copy link
Contributor

@srozesroze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

That looks amazing ❤️

*/
class TraceableMessageBusimplements MessageBusInterface
{
privatestatic$calls =0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What's wrong with keeping PHP incrementing the keys with$this->dispatchedMessages[]?

@mvrhov
Copy link

IMO "All buses" could easily be shortened to just "All"

@sroze
Copy link
Contributor

The tests are failing now by the way :)

@ogizanagi
Copy link
ContributorAuthor

@sroze: I know :) I'll try to make this ready this afternoon.

@sroze
Copy link
Contributor

sroze commentedMay 12, 2018 via email

No worries, no pressure at all.
On Sat, May 12, 2018 at 11:01 AM Maxime Steinhausser < ***@***.***> wrote:@sroze <https://github.com/sroze>: I know :) I'll try to make this ready this afternoon. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#27202 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAxHEda0mGEnSi02Wd6T9DDCWKWgiukQks5txqTZgaJpZM4T3Agu> .

@ogizanagi
Copy link
ContributorAuthor

Ready

I've also changed "All buses" to "All" as suggested by@mvrhov and added a small informational note below tabs.

@yceruto
Copy link
Member

@ogizanagi what about don't show the "Exception" row if "No Exception"?

ogizanagi reacted with thumbs up emoji

@ogizanagi
Copy link
ContributorAuthor

Done :)

Copy link
Contributor

@srozesroze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Amazing work. Thank you!

<h3class="tab-title">{{bus }}<spanclass="badge {{exceptionsCount?exceptionsCount==messages|length?'status-error':'status-some-errors' }}">{{messages|length }}</span></h3>

<divclass="tab-content">
<pclass="text-muted">Ordered list of messages dispatched by the <code>{{bus }}</code> bus</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

...dispatch *on* the ...?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Fixed!

@fabpot
Copy link
Member

Thank you@ogizanagi.

sroze, ro0NL, and yceruto reacted with hooray emoji

@fabpotfabpot merged commit3d19578 intosymfony:4.1May 13, 2018
fabpot added a commit that referenced this pull requestMay 13, 2018
This PR was squashed before being merged into the 4.1 branch (closes#27202).Discussion----------[Messenger] Improve the profiler panel| Q             | A| ------------- | ---| Branch?       | 4.1 <!-- see below -->| Bug fix?      | no| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://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   <!--#26597  issue number(s), if any -->| License       | MIT| Doc PR        | N/AThis is an attempt to enhance the profiler panel a bit.**with the following messages dispatched:**```php$queryBus->dispatch(Envelope::wrap(new GetGreetingsQuery('Hello you'))    ->with(new JustAFriendOfMine())    ->with(new AndHisPlusO̶n̶e̶Eleven()));$commandBus->dispatch(new SendGiftCommand());$queryBus->dispatch(new GetGreetingsQuery('Exterminate!'));```## Before<img width="1084" alt="screenshot 2018-05-12 a 13 57 57" src="https://user-images.githubusercontent.com/2211145/39957055-8a0f009e-55ec-11e8-9d8e-bf79aad4b420.PNG">🐛calls order are wrong here, fixed in this PR## After### collapsed<!-- <img width="1083" alt="screenshot 2018-05-10 a 23 51 07" src="https://user-images.githubusercontent.com/2211145/39896093-19a8c7ee-54ad-11e8-8dcb-4e165ffd2eae.PNG">--><img width="1085" alt="screenshot 2018-05-12 a 13 18 35" src="https://user-images.githubusercontent.com/2211145/39956802-9d4c38a2-55e7-11e8-8425-ad090c0871b6.PNG"><img width="1085" alt="screenshot 2018-05-12 a 13 26 44" src="https://user-images.githubusercontent.com/2211145/39956827-25d9e426-55e8-11e8-9116-160603649f33.PNG">📝 _When loading the page, all messages details are collapsed by default but the first one per tab._### expanded<!-- <img width="1083" alt="screenshot 2018-05-10 a 23 13 39" src="https://user-images.githubusercontent.com/2211145/39894779-42c9cc9a-54a8-11e8-9529-6292481536d4.PNG"> --><img width="1086" alt="screenshot 2018-05-12 a 13 49 42" src="https://user-images.githubusercontent.com/2211145/39956981-639fc3d6-55eb-11e8-9224-a48f591db3da.PNG">### live<!-- ![mai-10-2018 23-16-17](https://user-images.githubusercontent.com/2211145/39894789-4b8fa138-54a8-11e8-986c-fccf6cd0234f.gif) -->![mai-12-2018 13-55-40](https://user-images.githubusercontent.com/2211145/39957041-37f17b34-55ec-11e8-8569-a733a104bf82.gif)### toolbar (with exceptions)<img width="284" alt="screenshot 2018-05-10 a 23 18 32" src="https://user-images.githubusercontent.com/2211145/39895011-0467f2a0-54a9-11e8-9d78-25461cf71c41.PNG">## Notes- Table headers are clickable, so you can jump directly to the message class in the code- Reversing headers/rows allows to have a wider space for dumps and allows to add more entries in the future. This is an issue we already have with the Validator panel (when there is both an invalid value as object and a constraint violation dumped) which I'd like to revamp soon.- ~~I wonder if we should keep the dispatched messages in call order, or if we can segregate by bus (using tabs?).~~- ~~we could add a left container listing messages classes only, allowing to show details of a single message dispatched on a right container (similar to what the Form panel does). I'll probably suggest the same for the Validator panel.~~Commits-------3d19578 [Messenger] Improve the profiler panel
@ogizanagiogizanagi deleted the messenger/profiler_improvments branchMay 13, 2018 08:05
@fabpotfabpot mentioned this pull requestMay 21, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

+1 more reviewer

@srozesrozesroze approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

8 participants

@ogizanagi@yceruto@sroze@ro0NL@mvrhov@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp