Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] made sure that the debug event dispatcher is used everywhere #9168

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 1 commit into from
Oct 28, 2013

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Sep 29, 2013

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #6686, #7673
License MIT
Doc PR n/a

The removal of the Profiler dependency on the TraceableEventDispatcher (#9170) allows to remerge the patch from #9068 that fixes #6686.

This PR also cleans up how profiles are stored. A Profile is now always stored only once.

The fix will only be available on 2.4+ as the changes are too deep to be backported to 2.2 and 2.3.

@fabpot
Copy link
Member Author

fabpot commented Sep 29, 2013

#9169 must be merged first to fix the tests.

@fabpot
Copy link
Member Author

fabpot commented Sep 30, 2013

#9169 has been merged now.

@ghost
Copy link

ghost commented Sep 30, 2013

This causes everything to blow up for me and I get a weird error like before

LogicException: Event "__section__" is not started.
in C:\xampp\htdocs\core13\src\vendor\symfony\symfony\src\Symfony\Component\Stopwatch\Stopwatch.php line 276
at Section->stopEvent('__section__') in C:\xampp\htdocs\core13\src\vendor\symfony\symfony\src\Symfony\Component\Stopwatch\Stopwatch.php line 113
at Stopwatch->stop('__section__') in C:\xampp\htdocs\core13\src\vendor\symfony\symfony\src\Symfony\Component\Stopwatch\Stopwatch.php line 69
at Stopwatch->stopSection('29c39c') in C:\xampp\htdocs\core13\src\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher.php line 366
at TraceableEventDispatcher->postDispatch('kernel.response', object(FilterResponseEvent)) in C:\xampp\htdocs\core13\src\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher.php line 151
at TraceableEventDispatcher->dispatch('kernel.response', object(FilterResponseEvent)) in C:\xampp\htdocs\core13\src\index.php line 188

@fabpot
Copy link
Member Author

fabpot commented Sep 30, 2013

@Drak What you mean by "like before"?

"TraceableEventDispatcher.php line 366" -> is it the stopSection() from RESPONSE or TERMINATE?

@stof
Copy link
Member

stof commented Sep 30, 2013

@fabpot the logger, database (this one is extended in DoctrineBundle so we need to check how it would work) and swiftmailer (in the bundle) collectors should also implement this interface IMO, otherwise they are missing the data for logic happening in the terminate event

@fabpot
Copy link
Member Author

fabpot commented Sep 30, 2013

As the replacement of the default event dispatcher by the traceable one still causes problems on some apps (like Zikula), I've opened a new PR with just the refactoring part as it brings value by itself and is totally independent (see #9170).

fabpot added a commit that referenced this pull request Sep 30, 2013
…bpot)

This PR was merged into the master branch.

Discussion
----------

Decoupled TraceableEventDispatcher from the Profiler

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This PR removes the Profiler dependency on the TraceableEventDispatcher. That makes things more decoupled and cleaner. This PR also cleans up how profiles are stored; a Profile is now always stored only once.

I've created a `LateDataCollectorInterface` that is implemented for data collector that needs to get information from data that are available very late in the request process (when the request and the response are not even available anymore). The `lateCollect()` method is called just before the profile is stored.

We have 3 data collectors that implement that interface:

 * Time: As the traceable event dipsatcher gets inject timing information via the stopwatch about all events (including the `terminate` one), we need to get events from the stopwatch as late as possible.
 * Event: The traceable event dispatcher gathers all called listeners to determine non-called ones. To be able to accurately do that for all events (including the `terminate` one), we need to get the data as late as possible.
 * Memory: We want to get the memory as late as possible to get the most accurate number as possible

I'm not very happy with the name and as always, better suggestions would be much appreciated.

This is an extract from #9168

Commits
-------

5cedea2 [HttpKernel] added LateDataCollectorInterface
9c4bc9a [HttpKernel] decoupled TraceableEventDispatcher and Profiler
fabpot added a commit that referenced this pull request Oct 28, 2013
… is used everywhere (fabpot)

This PR was merged into the master branch.

Discussion
----------

[FrameworkBundle] made sure that the debug event dispatcher is used everywhere

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #6686, #7673
| License       | MIT
| Doc PR        | n/a

The removal of the Profiler dependency on the TraceableEventDispatcher (#9170) allows to remerge the patch from #9068 that fixes #6686.

This PR also cleans up how profiles are stored. A Profile is now always stored only once.

The fix will only be available on 2.4+ as the changes are too deep to be backported to 2.2 and 2.3.

Commits
-------

1e1835e [FrameworkBundle] made sure that the debug event dispatcher is used everywhere
@fabpot fabpot merged commit 1e1835e into symfony:master Oct 28, 2013
@fabpot fabpot deleted the traceable-ed-fi branch December 29, 2013 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[2.2.x] Webprofiler - Some called listeners are not shown
2 participants