DevTools/OperationInstrument: Difference between revisions

m
 
(One intermediate revision by one other user not shown)
Line 47: Line 47:


===== Using ''<code>TimelineConsumers</code>'' =====  
===== Using ''<code>TimelineConsumers</code>'' =====  
A few static methods exist on the [https://dxr.mozilla.org/mozilla-central/source/docshell/base/timeline/TimelineConsumers.h?from=TimelineConsumers <code>TimelineConsumers</code>] class, like ''<code>AddMarkerForDocShell</code>'', ''<code>AddMarkerToDocShellsList</code>'', ''<code>AddMarkerToAllObservedDocShells</code>'' that give you fine grained control over creating the markers and what meta-data is attached to them.
A few static methods exist on the [https://dxr.mozilla.org/mozilla-central/source/docshell/base/timeline/TimelineConsumers.h?from=TimelineConsumers <code>TimelineConsumers</code>] class, like ''<code>AddMarkerForDocShell</code>'', ''<code>AddMarkerForDocShellsList</code>'', ''<code>AddMarkerForAllObservedDocShells</code>'' that give you fine grained control over creating the markers and what meta-data is attached to them.


Example:
Example:
Line 55: Line 55:
== 2. Telling the DevTools Frontend About the New Markers ==
== 2. Telling the DevTools Frontend About the New Markers ==


To get your new markers displayed in the performance tool's UI, edit the configuration data in '''<code>browser/devtools/performance/modules/markers.js</code>'''.
To get your new markers displayed in the performance tool's UI, edit the configuration data in '''<code>devtools/client/performance/modules/markers.js</code>'''.


Add a property to the '''<code>TIMELINE_BLUEPRINT</code>''' object. The property key should be the <code>const char *</code> literal that you added in step 1 ("Parse HTML" in our example). The new property should be an object with the following properties:
Add a property to the '''<code>TIMELINE_BLUEPRINT</code>''' object. The property key should be the <code>const char *</code> literal that you added in step 1 ("Parse HTML" in our example). The new property should be an object with the following properties:
Confirmed users
125

edits