run_benchmark should have an option to specify the number of runs
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 May 2015 06:42:45 +0000 (06:42 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 May 2015 06:42:45 +0000 (06:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145091

Reviewed by Stephanie Lewis.

Added --count option.

* Scripts/run-benchmark:
(main):
* Scripts/webkitpy/benchmark_runner/benchmark_runner.py:
(BenchmarkRunner.__init__):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184431 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/run-benchmark
Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py

index 8c496d5e202e3951f2083cd8e3ce8a2e8a42ffdf..3073940e42209472df85fe7f9252a115d463381e 100644 (file)
@@ -1,3 +1,17 @@
+2015-05-15  Ryosuke Niwa  <rniwa@webkit.org>
+
+        run_benchmark should have an option to specify the number of runs
+        https://bugs.webkit.org/show_bug.cgi?id=145091
+
+        Reviewed by Stephanie Lewis.
+
+        Added --count option.
+
+        * Scripts/run-benchmark:
+        (main):
+        * Scripts/webkitpy/benchmark_runner/benchmark_runner.py:
+        (BenchmarkRunner.__init__):
+
 2015-05-15  Timothy Horton  <timothy_horton@apple.com>
 
         Temporarily disable failing API test.
index 77fc4724457a1ea69a0b51ab569174a32d334ab9..16255da6526c371aa7c85b98f27ad8d25fb4af83 100755 (executable)
@@ -27,6 +27,7 @@ def main():
     parser.add_argument('--browser', dest='browser', required=True, choices=BrowserDriverFactory.available_browsers())
     parser.add_argument('--debug', action='store_true')
     parser.add_argument('--local-copy', dest='localCopy', help='Path to a local copy of the benchmark. e.g. PerformanceTests/SunSpider/')
+    parser.add_argument('--count', dest='countOverride', type=int, help='Number of times to run the benchmark. e.g. 5')
     args = parser.parse_args()
 
     if args.debug:
@@ -35,7 +36,7 @@ def main():
     _log.debug('\toutput file name\t: %s' % args.output)
     _log.debug('\tbuild directory\t: %s' % args.buildDir)
     _log.debug('\tplan name\t: %s', args.plan)
-    runner = BenchmarkRunner(args.plan, args.localCopy, args.buildDir, args.output, args.platform, args.browser)
+    runner = BenchmarkRunner(args.plan, args.localCopy, args.countOverride, args.buildDir, args.output, args.platform, args.browser)
     return runner.execute()
 
 
index e45091061a217586b8e90f7e83ef69ec63e8089c..faeb85223ca55a6361f44c0ab1e31121a4b507d3 100644 (file)
@@ -23,7 +23,7 @@ _log = logging.getLogger(__name__)
 
 class BenchmarkRunner(object):
 
-    def __init__(self, planFile, localCopy, buildDir, outputFile, platform, browser):
+    def __init__(self, planFile, localCopy, countOverride, buildDir, outputFile, platform, browser):
         _log.info('Initializing benchmark running')
         try:
             planFile = self._findPlanFile(planFile)
@@ -32,6 +32,8 @@ class BenchmarkRunner(object):
                 self.plan = json.load(fp)
                 if localCopy:
                     self.plan['local_copy'] = localCopy
+                if countOverride:
+                    self.plan['count'] = countOverride
                 self.browserDriver = BrowserDriverFactory.create([platform, browser])
                 self.httpServerDriver = HTTPServerDriverFactory.create([self.plan['http_server_driver']])
                 self.buildDir = os.path.abspath(buildDir) if buildDir else None