summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornednguyen@google.com <nednguyen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-18 22:29:34 +0000
committernednguyen@google.com <nednguyen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-18 22:29:34 +0000
commite93ee0eb33e2f5ea8e192a59ed94402f5c4e0301 (patch)
tree07a4bdc560bb4ece2dd9570a73ad26f8462beb22
parent4455c26bbe9b6d75774f89a2b22f02e5e890b910 (diff)
downloadchromium_src-e93ee0eb33e2f5ea8e192a59ed94402f5c4e0301.zip
chromium_src-e93ee0eb33e2f5ea8e192a59ed94402f5c4e0301.tar.gz
chromium_src-e93ee0eb33e2f5ea8e192a59ed94402f5c4e0301.tar.bz2
Switch typical_25.json to typical_25.py in session_restore benchmark.
Improve debugging message. BUG=364142 Review URL: https://codereview.chromium.org/243333002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264876 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--tools/perf/benchmarks/session_restore.py4
-rw-r--r--tools/perf/measurements/session_restore.py18
2 files changed, 13 insertions, 9 deletions
diff --git a/tools/perf/benchmarks/session_restore.py b/tools/perf/benchmarks/session_restore.py
index e4bc98e..a5f2a8c 100644
--- a/tools/perf/benchmarks/session_restore.py
+++ b/tools/perf/benchmarks/session_restore.py
@@ -11,7 +11,7 @@ from telemetry import test
class SessionRestoreColdTypical25(test.Test):
tag = 'cold'
test = session_restore.SessionRestore
- page_set = 'page_sets/typical_25.json'
+ page_set = 'page_sets/typical_25.py'
options = {'cold': True,
'pageset_repeat': 5}
@@ -19,6 +19,6 @@ class SessionRestoreColdTypical25(test.Test):
class SessionRestoreWarmTypical25(test.Test):
tag = 'warm'
test = session_restore.SessionRestore
- page_set = 'page_sets/typical_25.json'
+ page_set = 'page_sets/typical_25.py'
options = {'warm': True,
'pageset_repeat': 20}
diff --git a/tools/perf/measurements/session_restore.py b/tools/perf/measurements/session_restore.py
index 352aded..fffabcd 100644
--- a/tools/perf/measurements/session_restore.py
+++ b/tools/perf/measurements/session_restore.py
@@ -1,6 +1,7 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import collections
from measurements import startup
from metrics import cpu
@@ -35,15 +36,18 @@ class SessionRestore(startup.Startup):
pass
def ValidatePageSet(self, page_set):
- # Reject any pageset that contains more than one WPR archive.
- wpr_archives = {}
+ wpr_archive_names_to_page_urls = collections.defaultdict(list)
+ # Construct the map from pages' wpr archive names to pages' urls.
for page in page_set:
- if not page.is_local:
- wpr_archives[page_set.WprFilePathForPage(page)] = True
+ if page.is_local:
+ continue
+ wpr_archive_name = page_set.WprFilePathForPage(page)
+ wpr_archive_names_to_page_urls[wpr_archive_name].append(page.url)
- if len(wpr_archives.keys()) > 1:
+ # Reject any pageset that contains more than one WPR archive.
+ if len(wpr_archive_names_to_page_urls.keys()) > 1:
raise Exception("Invalid pageset: more than 1 WPR archive found.: " +
- ', '.join(wpr_archives.keys()))
+ repr(wpr_archive_names_to_page_urls))
def DidStartBrowser(self, browser):
self._cpu_metric = cpu.CpuMetric(browser)
@@ -58,4 +62,4 @@ class SessionRestore(startup.Startup):
startup_metric.StartupMetric().AddResults(tab, results)
- # TODO(jeremy): Measure time to load - first, last and frontmost tab here. \ No newline at end of file
+ # TODO(jeremy): Measure time to load - first, last and frontmost tab here.