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

Unified Diff: tools/perf/metrics/stats_table_util.py

Issue 23112028: [Telemetry] Add support for capturing V8 object stats to Telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stats_table_android
Patch Set: Created 7 years, 4 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
Index: tools/perf/metrics/stats_table_util.py
diff --git a/tools/perf/metrics/stats_table_util.py b/tools/perf/metrics/stats_table_util.py
new file mode 100644
index 0000000000000000000000000000000000000000..fb8af223d1a82ec920fac5ae2ed2983635bb828e
--- /dev/null
+++ b/tools/perf/metrics/stats_table_util.py
@@ -0,0 +1,23 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""This is a helper module to get and manipulate stats table data.
+
+The status table data is the same data as is visible from "chrome://stats" and
+relies on --enable-stats-table being set.
+More information can be found at: chromium/src/base/metrics/stats_table.h
+
+Stats table data is collected with the window.statsCollectionController object.
+"""
+
+import json
+
+
+def GetStatsTable(tab):
+ """Get the full stats table from the browser."""
+ stats_table_json = tab.EvaluateJavaScript(
+ 'statsCollectionController.getStatsTable()')
+ if stats_table_json:
+ return json.loads(stats_table_json)
+ return None

Powered by Google App Engine
This is Rietveld 408576698