Chromium Code Reviews| Index: tools/perf/metrics/startup_metric.py |
| diff --git a/tools/perf/metrics/startup_metric.py b/tools/perf/metrics/startup_metric.py |
| index 6e6298d702de4f516b7fd95d0346d9ac1d28af40..af05c8f89aec401c83a3407ff4ef6bf944c74061 100644 |
| --- a/tools/perf/metrics/startup_metric.py |
| +++ b/tools/perf/metrics/startup_metric.py |
| @@ -47,7 +47,7 @@ class StartupMetric(Metric): |
| tab_load_times = [] |
| TabLoadTime = collections.namedtuple( |
| 'TabLoadTime', |
| - ['load_start_ms', 'load_duration_ms']) |
| + ['load_start_ms', 'load_duration_ms', 'request_start_ms']) |
| def RecordTabLoadTime(t): |
| try: |
| @@ -65,9 +65,14 @@ class StartupMetric(Metric): |
| print "Page: ", tab_title, " didn't finish loading." |
| return |
| + perf_timing = t.EvaluateJavaScript('window.performance.timing') |
| + if 'requestStart' not in perf_timing: |
| + raise Exception("requestStart not in window performance timings") |
|
pasko
2014/09/17 13:25:08
this would abort execution of all tests. Even if a
azarchs
2014/09/17 13:57:16
Done.
|
| + |
| tab_load_times.append(TabLoadTime( |
| int(result['load_start_ms']), |
| - int(result['load_duration_ms']))) |
| + int(result['load_duration_ms']), |
| + int(perf_timing['requestStart']))) |
| except util.TimeoutException: |
| # Low memory Android devices may not be able to load more than |
| # one tab at a time, so may timeout when the test attempts to |
| @@ -88,6 +93,10 @@ class StartupMetric(Metric): |
| results.AddValue(scalar.ScalarValue( |
| results.current_page, 'foreground_tab_load_complete', 'ms', |
| foreground_tab_load_complete)) |
| + if (foreground_tab_stats.request_start_ms > 0): |
| + results.AddValue(scalar.ScalarValue( |
| + results.current_page, 'foreground_tab_request_start', 'ms', |
|
pasko
2014/09/17 13:25:08
why absolute value and not the relative one? Loadi
azarchs
2014/09/17 13:57:16
The value reported here is relative to the process
|
| + foreground_tab_stats.request_start_ms - browser_main_entry_time_ms)) |
| def AddResults(self, tab, results): |
| get_histogram_js = 'statsCollectionController.getBrowserHistogram("%s")' |