| Index: tools/perf/measurements/startup.py
|
| diff --git a/tools/perf/measurements/startup_warm.py b/tools/perf/measurements/startup.py
|
| similarity index 58%
|
| rename from tools/perf/measurements/startup_warm.py
|
| rename to tools/perf/measurements/startup.py
|
| index 7c346b5c50e2d34323210a7dc3b14410f25b1fe0..484b5fdae0d2e6146d9a623a95de2b8fe415229f 100644
|
| --- a/tools/perf/measurements/startup_warm.py
|
| +++ b/tools/perf/measurements/startup.py
|
| @@ -6,9 +6,15 @@ import json
|
|
|
| from telemetry.page import page_measurement
|
|
|
| +class Startup(page_measurement.PageMeasurement):
|
| + """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.
|
| + """
|
|
|
| -class StartupWarm(page_measurement.PageMeasurement):
|
| - """Test how long Chrome takes to load when warm."""
|
| HISTOGRAMS_TO_RECORD = {
|
| 'messageloop_start_time' :
|
| 'Startup.BrowserMessageLoopStartTimeFromMainEntry',
|
| @@ -16,10 +22,27 @@ class StartupWarm(page_measurement.PageMeasurement):
|
| 'open_tabs_time' : 'Startup.BrowserOpenTabs'}
|
|
|
| def __init__(self):
|
| - super(StartupWarm, self).__init__(needs_browser_restart_after_each_run=True,
|
| - discard_first_result=True)
|
| + super(Startup, self).__init__(needs_browser_restart_after_each_run=True)
|
| + self._cold = False
|
| +
|
| + def AddCommandLineOptions(self, 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')
|
|
|
| def CustomizeBrowserOptions(self, options):
|
| + # TODO: Once the bots start running benchmarks, enforce that either --warm
|
| + # or --cold is explicitly specified.
|
| + # assert options.warm != options.cold, \
|
| + # "You must specify either --warm or --cold"
|
| + self._cold = options.cold
|
| +
|
| + if self._cold:
|
| + options.clear_sytem_cache_for_browser_and_profile_on_start = True
|
| + else:
|
| + self.discard_first_result = True
|
| +
|
| options.AppendExtraBrowserArg('--enable-stats-collection-bindings')
|
|
|
| # Old commandline flags used for reference builds.
|
| @@ -35,7 +58,6 @@ class StartupWarm(page_measurement.PageMeasurement):
|
| 'statsCollectionController :'
|
| 'domAutomationController).getBrowserHistogram("%s")')
|
|
|
| -
|
| for display_name, histogram_name in self.HISTOGRAMS_TO_RECORD.iteritems():
|
| result = tab.EvaluateJavaScript(get_histogram_js % histogram_name)
|
| result = json.loads(result)
|
|
|