Skip to content
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

profiler redesign #146

Merged
merged 1 commit into from
Apr 19, 2017
Merged

Conversation

fbourigault
Copy link
Contributor

@fbourigault fbourigault commented Apr 10, 2017

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets partially #93
Documentation N/A
License MIT

Here is my proposal for the new profiler design.

Now, when you display the profiler, you just see a list of requests sent and only have the method, the url and the response status code displayed. When you click on a line, the request (captured after plugin stack) and the response (captured before the plugin stack) are displayed. Then you have a button to toggle plugin stack which show the plugins list.

I used CSS3 flexbox for the layout with the help of word-wrap & co, we get a nice look at every screen size. No overflow for very long headers/urls.

The body toggle is now moved per request profile instead of globally.

I also cleaned the html to be more CSP friendly (no more inlined style/script attributes). I also reduced the javascript code to the strict minimum.

HTTP method colors are from SwaggerUi. I also used the best font color to have enough contrast for a11y.

Comments are welcome :)

httplugbundle2

To Do

  • Update the changelog.
  • Update the documentation.
  • Complete ProfileClientTest.

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

I have nothing to remark.

Good work

@Nyholm
Copy link
Member

Nyholm commented Apr 11, 2017

Could you have a look why the tests are failing?

@fbourigault
Copy link
Contributor Author

I broke those myself and didn't update them yet.

About the features, I didn't re-implemented the display of failed stacks. I don't think the http status is enough as any plugin can transform an 200 response to an exception. I also removed the path of arrows in the plugin stack. Maybe it must be re-introduced for users not familiar with PluginClient internals.

@fbourigault
Copy link
Contributor Author

Should I follow php-http/client-common#45?
If yes, what does it means exactly? Using a PSR-7 implementation and go with new GuzzleHttp\Psr7\Request() instead of $this->getMockBuilder(RequestInterface::class)->getMock();?
And last question, should I do the same for promise?

@Nyholm
Copy link
Member

Nyholm commented Apr 13, 2017

Yes. That is correct. They are just value objects. It is okey to use them when testing.

@fbourigault
Copy link
Contributor Author

So I can consider Promise a value object?

@sagikazarmark
Copy link
Member

Great work @fbourigault thanks for your hard work.

Regarding promises: while messages can be considered VOs, Promises not really. They represent behaviour, not values.

@fbourigault
Copy link
Contributor Author

Does someone have ideas on how to display a failed stack?

@Nyholm
Copy link
Member

Nyholm commented Apr 14, 2017

Thank you Mark.

@fbourigault: Hm, No, not really. Maybe just display the stack as normal but on the request line indicate it failed.

@fbourigault fbourigault force-pushed the profiler-redesign branch 3 times, most recently from 70b0806 to c4ac621 Compare April 14, 2017 21:13
@fbourigault
Copy link
Contributor Author

I added a green check mark in front of successful stacks and a red ballot in front of failed one. What do you think?
httplugbundle3

@fbourigault
Copy link
Contributor Author

I think this is now ready. I encourage everyone to test this new profiler on their own projects. Using the profiler worth more than my screenshots.

@Nyholm
Copy link
Member

Nyholm commented Apr 15, 2017

Thank you. I will test it and see what's happen.. I maybe have time to do it before Tuesday.

@fbourigault
Copy link
Contributor Author

I ran some extra tests using BrowserStack. It works on every browser (IE, Edge, Chrome, Firefox, Safari) where the profiler is fine 👌

@Nyholm
Copy link
Member

Nyholm commented Apr 18, 2017

I've tried the PR now. I like it. I've got nothing to complain about.

@fbourigault Really good job. Feel free to merge when you are ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants