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

Unified Diff: tools/perf/measurements/startup.py

Issue 637153002: telemetry: Remove command line args from page test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Suppress pylint E1003 Created 6 years, 1 month 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
Index: tools/perf/measurements/startup.py
diff --git a/tools/perf/measurements/startup.py b/tools/perf/measurements/startup.py
index 6d26ee92a1a1b00e43ea42752d15bb2a18366dd9..bc0617d593f6e07930fdcf87fba1d247b7a3b6ad 100644
--- a/tools/perf/measurements/startup.py
+++ b/tools/perf/measurements/startup.py
@@ -9,30 +9,16 @@ from telemetry.page import page_test
class Startup(page_test.PageTest):
"""Performs a measurement of Chromium's startup performance.
- This test must be invoked with either --warm or --cold on the command line. A
- cold start means none of the Chromium files are in the disk cache. A warm
- start assumes the OS has already cached much of Chromium's content. For warm
- tests, you should repeat the page set to ensure it's cached.
+ Uses cold start if cold==True, otherwise uses warm start. A cold start means
+ none of the Chromium files are in the disk cache. A warm start assumes the OS
+ has already cached much of Chromium's content. For warm tests, you should
+ repeat the page set to ensure it's cached.
"""
- def __init__(self, action_name_to_run = ''):
+ def __init__(self, cold=False, action_name_to_run=''):
super(Startup, self).__init__(needs_browser_restart_after_each_page=True,
action_name_to_run=action_name_to_run)
-
- @classmethod
- def AddCommandLineArgs(cls, parser):
- parser.add_option('--cold', action='store_true',
- help='Clear the OS disk cache before performing the test')
- parser.add_option('--warm', action='store_true',
- help='Start up with everything already cached')
-
- @classmethod
- def ProcessCommandLineArgs(cls, parser, args):
- cls._cold = args.cold
- # TODO: Once the bots start running benchmarks, enforce that either --warm
- # or --cold is explicitly specified.
- # if args.warm == args.cold:
- # parser.error('You must specify either --warm or --cold')
+ self._cold = cold
def CustomizeBrowserOptions(self, options):
if self._cold:
@@ -55,14 +41,15 @@ class Startup(page_test.PageTest):
class StartWithUrl(Startup):
"""Performs a measurement of Chromium's performance starting with a URL.
- This test must be invoked with either --warm or --cold on the command line. A
- cold start means none of the Chromium files are in the disk cache. A warm
- start assumes the OS has already cached much of Chromium's content. For warm
- tests, you should repeat the page set to ensure it's cached.
+ Uses cold start if cold==True, otherwise uses warm start. A cold start means
+ none of the Chromium files are in the disk cache. A warm start assumes the OS
+ has already cached much of Chromium's content. For warm tests, you should
+ repeat the page set to ensure it's cached.
The startup URL is taken from the page set's startup_url. This
allows the testing of multiple different URLs in a single benchmark.
"""
- def __init__(self):
- super(StartWithUrl, self).__init__(action_name_to_run='RunNavigateSteps')
+ def __init__(self, cold=False):
+ super(StartWithUrl, self).__init__(cold=cold,
+ action_name_to_run='RunNavigateSteps')

Powered by Google App Engine
This is Rietveld 408576698