| 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 import json | 5 import json |
| 6 import logging | 6 import logging |
| 7 | 7 |
| 8 from metrics import Metric | |
| 9 | |
| 10 from telemetry.core import exceptions | 8 from telemetry.core import exceptions |
| 11 from telemetry.value import histogram_util | 9 from telemetry.value import histogram_util |
| 12 from telemetry.value import scalar | 10 from telemetry.value import scalar |
| 13 | 11 |
| 12 from metrics import Metric |
| 13 |
| 14 | 14 |
| 15 class StartupMetric(Metric): | 15 class StartupMetric(Metric): |
| 16 "A metric for browser startup time." | 16 "A metric for browser startup time." |
| 17 | 17 |
| 18 HISTOGRAMS_TO_RECORD = { | 18 HISTOGRAMS_TO_RECORD = { |
| 19 'messageloop_start_time' : | 19 'messageloop_start_time' : |
| 20 'Startup.BrowserMessageLoopStartTimeFromMainEntry', | 20 'Startup.BrowserMessageLoopStartTimeFromMainEntry', |
| 21 'window_display_time' : 'Startup.BrowserWindowDisplay', | 21 'window_display_time' : 'Startup.BrowserWindowDisplay', |
| 22 'open_tabs_time' : 'Startup.BrowserOpenTabs'} | 22 'open_tabs_time' : 'Startup.BrowserOpenTabs'} |
| 23 | 23 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 results.AddValue(scalar.ScalarValue( | 118 results.AddValue(scalar.ScalarValue( |
| 119 results.current_page, display_name, 'ms', measured_time)) | 119 results.current_page, display_name, 'ms', measured_time)) |
| 120 | 120 |
| 121 # Get tab load times. | 121 # Get tab load times. |
| 122 browser_main_entry_time_ms = self._GetBrowserMainEntryTime(tab) | 122 browser_main_entry_time_ms = self._GetBrowserMainEntryTime(tab) |
| 123 if (browser_main_entry_time_ms is None): | 123 if (browser_main_entry_time_ms is None): |
| 124 print "Outdated Chrome version, browser main entry time not supported." | 124 print "Outdated Chrome version, browser main entry time not supported." |
| 125 return | 125 return |
| 126 self._RecordTabLoadTimes(tab, browser_main_entry_time_ms, results) | 126 self._RecordTabLoadTimes(tab, browser_main_entry_time_ms, results) |
| OLD | NEW |