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 | 4 |
5 import collections | 5 import collections |
6 | 6 |
| 7 from telemetry.core import util |
| 8 from telemetry.value import histogram |
| 9 from telemetry.value import histogram_util |
| 10 |
7 from measurements import startup | 11 from measurements import startup |
8 from metrics import cpu | 12 from metrics import cpu |
9 from metrics import startup_metric | 13 from metrics import startup_metric |
10 from telemetry.core import util | 14 |
11 from telemetry.value import histogram | |
12 from telemetry.value import histogram_util | |
13 | 15 |
14 _HISTOGRAMS = [ | 16 _HISTOGRAMS = [ |
15 { | 17 { |
16 'name': 'SessionRestore.ForegroundTabFirstLoaded', | 18 'name': 'SessionRestore.ForegroundTabFirstLoaded', |
17 'display_name': 'SessionRestore_ForegroundTabFirstLoaded', | 19 'display_name': 'SessionRestore_ForegroundTabFirstLoaded', |
18 }, | 20 }, |
19 { | 21 { |
20 'name': 'SessionRestore.AllTabsLoaded', | 22 'name': 'SessionRestore.AllTabsLoaded', |
21 'display_name': 'SessionRestore_AllTabsLoaded', | 23 'display_name': 'SessionRestore_AllTabsLoaded', |
22 }, | 24 }, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 self._cpu_metric.Stop(None, None) | 74 self._cpu_metric.Stop(None, None) |
73 self._cpu_metric.AddResults(tab, results, 'cpu_utilization') | 75 self._cpu_metric.AddResults(tab, results, 'cpu_utilization') |
74 | 76 |
75 for h in _HISTOGRAMS: | 77 for h in _HISTOGRAMS: |
76 histogram_data = histogram_util.GetHistogram( | 78 histogram_data = histogram_util.GetHistogram( |
77 histogram_util.BROWSER_HISTOGRAM, h['name'], tab) | 79 histogram_util.BROWSER_HISTOGRAM, h['name'], tab) |
78 | 80 |
79 results.AddValue(histogram.HistogramValue( | 81 results.AddValue(histogram.HistogramValue( |
80 page, h['display_name'], 'ms', raw_value_json=histogram_data, | 82 page, h['display_name'], 'ms', raw_value_json=histogram_data, |
81 important=False)) | 83 important=False)) |
OLD | NEW |