OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 import collections | 4 import collections |
5 | 5 |
6 from measurements import startup | 6 from measurements import startup |
7 from metrics import cpu | 7 from metrics import cpu |
8 from metrics import startup_metric | 8 from metrics import startup_metric |
9 from telemetry.core import util | 9 from telemetry.core import util |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 self._cpu_metric.Start(None, None) | 59 self._cpu_metric.Start(None, None) |
60 | 60 |
61 def MeasurePage(self, page, tab, results): | 61 def MeasurePage(self, page, tab, results): |
62 tab.browser.foreground_tab.WaitForDocumentReadyStateToBeComplete() | 62 tab.browser.foreground_tab.WaitForDocumentReadyStateToBeComplete() |
63 | 63 |
64 # Record CPU usage from browser start to when the foreground page is loaded. | 64 # Record CPU usage from browser start to when the foreground page is loaded. |
65 self._cpu_metric.Stop(None, None) | 65 self._cpu_metric.Stop(None, None) |
66 self._cpu_metric.AddResults(tab, results, 'cpu_utilization') | 66 self._cpu_metric.AddResults(tab, results, 'cpu_utilization') |
67 | 67 |
68 startup_metric.StartupMetric().AddResults(tab, results) | 68 startup_metric.StartupMetric().AddResults(tab, results) |
69 | |
70 # TODO(jeremy): Measure time to load - first, last and frontmost tab here. | |
OLD | NEW |