Skip to content

Added stopwatch plugin #102

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

Merged
merged 2 commits into from
Jul 26, 2016
Merged

Added stopwatch plugin #102

merged 2 commits into from
Jul 26, 2016

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Jul 25, 2016

Q A
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? no
Related tickets fixes #92
Documentation
License MIT

What's in this PR?

With this PR we integrate with the WebProfiler timeline

screen shot 2016-07-25 at 03 01 39

@sagikazarmark
Copy link
Member

What happens if a custom stopwatch (either the httplug service or a completely custom one) is added to the plugin stack?

@Nyholm
Copy link
Member Author

Nyholm commented Jul 25, 2016

If someone uses the default stopwatchPlugin we are doing the same calls to the stopwatch component twice. That means that our measured times would be twice as large.

If someone uses the stopwatchPlugin with a custom stopwatch, then nothing special will happen.

@sagikazarmark
Copy link
Member

Okay, so probably we should add a check to see if the stopwatch plugin is already added? And then do what? Leave it as is, or remove that one and add our own to the beginning of the stack?

@joelwurtz
Copy link
Member

Or just a check in the StopwatchPlugin to do nothing if the event is already started ? (there is a isStarted method in stopwatch)

@Nyholm
Copy link
Member Author

Nyholm commented Jul 25, 2016

Our (the automatic one) stopwatch plugin is the first to execute though.

@Nyholm
Copy link
Member Author

Nyholm commented Jul 25, 2016

But why would someone add their own stopwatch plugin? I we could figure out that use case it may be easier to know the appropriate action to take.

@Nyholm
Copy link
Member Author

Nyholm commented Jul 25, 2016

I answering my own question now. The reason you may want to add the stopwatch plugin may be because you want to change the order. Say you have one slow plugin in the beginning that you want to exclude for the stopwatch.

I believe we should check if the stopwatch is added and only prepend the plugin list if the stopwatch is missing. What do you think?

@sagikazarmark
Copy link
Member

Like that, but maybe we should only check our stopwatch plugin service. If someone creates a custom stopwatch plugin service, it might not use the same stopwatch instance. WDYT?

@Nyholm
Copy link
Member Author

Nyholm commented Jul 25, 2016

Agreed.

@dbu
Copy link
Collaborator

dbu commented Jul 26, 2016

looks good!

can you please rebase, there seems to be a conflict now.

@Nyholm
Copy link
Member Author

Nyholm commented Jul 26, 2016

Sorry,

I've now rebased the PR

@dbu dbu merged commit ba3eee7 into master Jul 26, 2016
@dbu dbu deleted the dev-stopwatch2 branch July 26, 2016 07:30
@dbu
Copy link
Collaborator

dbu commented Jul 26, 2016

thanks!

@Nyholm
Copy link
Member Author

Nyholm commented Jul 26, 2016

Thank you for merging

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.

Integrate with Symfony Debug Timeline
4 participants