Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2311)

Unified Diff: tools/perf/metrics/startup_metric.py

Issue 546213005: Record the time to requestStart from the javascript timings API as part of the startup benchmark. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d762aed6499781dcc3825386b3693dd25fd97adb 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,15 @@ 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:
+ perf_timing['requestStart'] = 0 # Exclude from benchmark results
+ print 'requestStart is not supported by this browser'
+
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 +94,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',
+ foreground_tab_stats.request_start_ms - browser_main_entry_time_ms))
def AddResults(self, tab, results):
get_histogram_js = 'statsCollectionController.getBrowserHistogram("%s")'
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698