You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if your project makes use of the :doc:`EventDispatcher component </components/event_dispatcher/introduction>`, you can automate the profiling by using the corresponding
48
-
EventListeners :class:`Symfony\\Component\\Profiler\\EventListener\\HttpProfilerListener` and
Copy file name to clipboardExpand all lines: cookbook/profiler/data_collector.rst
+24-43Lines changed: 24 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,61 +17,40 @@ Creating a custom data collector is as simple as implementing the
17
17
interface DataCollectorInterface
18
18
{
19
19
/**
20
-
* Set the Token of the active profile.
20
+
* Returns the collected data.
21
21
*
22
-
* @param $token
23
-
*/
24
-
public function setToken($token);
25
-
26
-
/**
27
-
* Returns the name of the collector.
22
+
* @return ProfileDataInterface
28
23
*
29
-
* @return string The collector name
24
+
* @todo introduce in 3.0
30
25
*/
31
-
function getName();
26
+
public function getCollectedData();
32
27
}
33
28
34
-
The ``getName()`` method must return a unique name. This is used to access the
35
-
information later on (see :doc:`/cookbook/testing/profiling` for
36
-
instance).
37
-
38
-
And implementing either the :class:`Symfony\\Component\\Profiler\\DataCollector\\RuntimeDataCollectorInterface`::
29
+
if the data should be collected just prior to the Profile being saved add the :class:`Symfony\\Component\\Profiler\\DataCollector\\LateDataCollectorInterface`::
39
30
40
-
interface RuntimeDataCollectorInterface
31
+
interface LateDataCollectorInterface
41
32
{
42
-
/**
43
-
* Collects data when profiler is triggered.
44
-
*
45
-
* @return ProfileDataInterface
46
-
*/
47
-
public function collect();
48
33
}
49
34
50
-
or the :class:`Symfony\\Component\\Profiler\\DataCollector\\LateDataCollectorInterface`::
35
+
The ``getCollectedData()`` method is responsible for storing the data it wants to give
36
+
access to in a :class:`Symfony\\Component\\Profiler\\ProfileData\\ProfileDataInterface`::
0 commit comments