OLD | NEW |
(Empty) | |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 """This is a helper module to get and manipulate stats table data. |
| 6 |
| 7 The status table data is the same data as is visible from "chrome://stats" and |
| 8 relies on --enable-stats-table being set. |
| 9 More information can be found at: chromium/src/base/metrics/stats_table.h |
| 10 |
| 11 Stats table data is collected with the window.statsCollectionController object. |
| 12 """ |
| 13 |
| 14 import json |
| 15 |
| 16 |
| 17 def GetStatsTable(tab): |
| 18 """Get the full stats table from the browser.""" |
| 19 stats_table_json = tab.EvaluateJavaScript( |
| 20 'statsCollectionController.getStatsTable()') |
| 21 if stats_table_json: |
| 22 return json.loads(stats_table_json) |
| 23 return None |
OLD | NEW |