Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Unified Diff: tools/telemetry/telemetry/core/chrome/inspector_backend.py

Issue 12800004: [Telemetry] Add tab API function GetJavascriptStats(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed second round of review comments. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/chrome/inspector_memory.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/chrome/inspector_backend.py
diff --git a/tools/telemetry/telemetry/core/chrome/inspector_backend.py b/tools/telemetry/telemetry/core/chrome/inspector_backend.py
index 8a5f8b109626db87602ad599b574d918ff8ab880..ee5c06cf58a4c70bea2b2a2fd9329567155a8210 100644
--- a/tools/telemetry/telemetry/core/chrome/inspector_backend.py
+++ b/tools/telemetry/telemetry/core/chrome/inspector_backend.py
@@ -9,6 +9,7 @@ import sys
from telemetry.core import util
from telemetry.core import exceptions
from telemetry.core.chrome import inspector_console
+from telemetry.core.chrome import inspector_memory
from telemetry.core.chrome import inspector_page
from telemetry.core.chrome import inspector_runtime
from telemetry.core.chrome import inspector_timeline
@@ -30,6 +31,7 @@ class InspectorBackend(object):
self._next_request_id = 0
self._console = inspector_console.InspectorConsole(self)
+ self._memory = inspector_memory.InspectorMemory(self)
self._page = inspector_page.InspectorPage(self)
self._runtime = inspector_runtime.InspectorRuntime(self)
self._timeline = inspector_timeline.InspectorTimeline(self)
@@ -152,6 +154,16 @@ class InspectorBackend(object):
def message_output_stream(self, stream): # pylint: disable=E0202
self._console.message_output_stream = stream
+ # Memory public methods.
+
+ def GetDOMStats(self, timeout):
+ dom_counters = self._memory.GetDOMCounters(timeout)
+ return {
+ 'document_count': dom_counters['documents'],
+ 'node_count': dom_counters['nodes'],
+ 'event_listener_count': dom_counters['jsEventListeners']
+ }
+
# Page public methods.
def PerformActionAndWaitForNavigate(self, action_function, timeout):
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/chrome/inspector_memory.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698