-
Notifications
You must be signed in to change notification settings - Fork 34
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
Implement a bernard panel for the symfony webprofiler #54
Conversation
98411f7
to
e911fdf
Compare
Thats pretty cool looking 👍 I'll let somebody else okay the code. |
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.
Nice work! However I sent a few suggestion to improve the profiler.
Also, have you tried the profiler with Symfony 2.7 as the profiler was redesigned in 2.8?
Collector/ProducerCollector.php
Outdated
{ | ||
$envelope = $event->getEnvelope(); | ||
|
||
$this->data['messages'][$event->getQueue()->__toString()][] = [ |
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.
Why not using a string cast (string) $event->getQueue()
here?
return; | ||
} | ||
|
||
$definition = new Definition(ProducerCollector::class); |
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.
What about declaring this as PHP instead of conditionally loading a xml 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.
I did indeed loaded the xml in an earlier version, but now I indeed use a php configuration. Or did I miss something?
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.
Why did you moved from xml to php for the collector definition?
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.
Oh you mean the other way around. I first had it like that but then struggled to make it conditional (wasn't much of an issue) but I refactored it to php then. I don't know if there is a preference to xml or php but I cna change it back!
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.
As the bundle already use xml for configuring services, I think it's better to stick with it if possible. Anyone else have an opinion on this?
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.
fixed!
{% endblock %} | ||
|
||
{% block menu %} | ||
{% if collector.messageCount > 0 %} |
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.
You should not hide the menu entry if there is no messages.
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endfor %} |
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.
Related to the menu block, you should add an else statement here to tell users there is no messages to show.
e911fdf
to
fe831b6
Compare
@fbourigault Thanks for the review! I fixed the commented issues and I will test symfony 2.7 later today! 2 more screenshots for the profiler when no messages are produced |
fe831b6
to
e2fe183
Compare
I've tested the toolbar in 2.7 and it's indeed quite broken 😛 so now is the question what we should do
As this is a new feature I tend more to solution 2. HttplugBundle had the same discussion and also went with bumping symfony. |
i vote to bump it. |
Me too. Users can safely upgrade from 2.7 to 2.8 (was our conclusion for HttplugBundle). |
e2fe183
to
adc5525
Compare
Minimum symfony version bumped to 2.8. I will test the pr a bit more to make sure it all works. Only thing left is custom svg icon. Is anyone able to create a icon for the bernard bundle? |
Based on the favicon maybe this one:
|
Thanks @franmomu, now I will be able to finish the PR! Is it possible to remove the white (lighter) block in the background so we only have the "b". And make the "b" around 17/18px in height and color #aaa. Thanks! |
Ok! Something like this:
|
Yes, thanks a lot @franmomu! |
793e37b
to
7e82d6e
Compare
Rebase and squashed. @henrikbjorn @fbourigault this PR is ready for a final review! |
Let's go! 😄 |
Thanks for your work on this, nice thing! |
#50 This PR adds a toolbar item and profiler section for produced messages. A message count and distinct queue count. The profiler section shows a summary of all produced messages and you can view a dump representation of the message object
TODO:
Screenshots: