WebKit Bugzilla
Attachment 356545 Details for
Bug 192385
: Add "-o/--output" option to startup.py and new_tab.py benchmark scripts to save the results in json format.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192385-20181204152223.patch (text/plain), 7.07 KB, created by
Suresh Koppisetty
on 2018-12-04 15:22:24 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Suresh Koppisetty
Created:
2018-12-04 15:22:24 PST
Size:
7.07 KB
patch
obsolete
>Subversion Revision: 238874 >diff --git a/PerformanceTests/ChangeLog b/PerformanceTests/ChangeLog >index 5d89525740e97c16feb154087968a42952d1a14c..1e07679eaa8c5fb306503c95521d1e9db6cbec91 100644 >--- a/PerformanceTests/ChangeLog >+++ b/PerformanceTests/ChangeLog >@@ -1,3 +1,52 @@ >+2018-12-04 Suresh Koppisetty <skoppisetty@apple.com> >+ >+ Add "-o/--output" option to startup.py and new_tab.py benchmark scripts to save the results in json format. >+ https://bugs.webkit.org/show_bug.cgi?id=192385 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Sample json output for new tab benchmark script after running for 2 iterations and 2 groups. Values are in milliseconds. >+ { >+ "NewTabBenchmark": { >+ "metrics": { >+ "Time": { >+ "current": [ >+ [ >+ 410.2939453125, >+ 307.81494140625 >+ ], >+ [ >+ 340.616943359375, >+ 265.94384765625 >+ ] >+ ] >+ } >+ } >+ } >+ } >+ >+ Sample json output for startup time benchmark script after running for 2 iterations. Values are in milliseconds. >+ { >+ "StartupBenchmark": { >+ "metrics": { >+ "Time": { >+ "current": [ >+ [ >+ 1415.2099609375, >+ 1439.552978515625 >+ ] >+ ] >+ } >+ } >+ } >+ } >+ >+ * LaunchTime/launch_time.py: >+ * LaunchTime/new_tab.py: >+ (NewTabBenchmark.get_test_name): >+ * LaunchTime/startup.py: >+ (StartupBenchmark.get_test_name): >+ > 2018-11-07 Caio Lima <ticaiolima@gmail.com> > > [BigInt] Add support to BigInt into ValueAdd >diff --git a/PerformanceTests/LaunchTime/launch_time.py b/PerformanceTests/LaunchTime/launch_time.py >index 53a5a3b728364955c0565816916332999c9643ed..e95fde87a1a6e60c41168c5f5dcb5c830d8a724c 100644 >--- a/PerformanceTests/LaunchTime/launch_time.py >+++ b/PerformanceTests/LaunchTime/launch_time.py >@@ -5,6 +5,7 @@ import logging > from math import sqrt > from operator import mul > import os >+import json > from subprocess import call, check_output > import sys > import threading >@@ -83,6 +84,8 @@ class LaunchTimeBenchmark: > self._app_name = None > self._verbose = False > self._feedback_in_browser = False >+ self._save_results_to_json = False >+ self._json_results_path = None > self._do_not_ignore_first_result = False > self._iterations = 5 > self._browser_bundle_path = '/Applications/Safari.app' >@@ -110,6 +113,8 @@ class LaunchTimeBenchmark: > help="print each iteration's time") > self.argument_parser.add_argument('-f', '--feedback-in-browser', action='store_true', > help="show benchmark results in browser (default: {})".format(self._feedback_in_browser)) >+ self.argument_parser.add_argument('-o', '--output', type=self._json_results_path, >+ help='saves benchmark results in json format (default: {})'.format(self._json_results_path)) > self.will_parse_arguments() > > args = self.argument_parser.parse_args() >@@ -121,6 +126,9 @@ class LaunchTimeBenchmark: > self._verbose = args.verbose > if args.feedback_in_browser is not None: > self._feedback_in_browser = args.feedback_in_browser >+ if args.output: >+ self._save_results_to_json = True >+ self._json_results_path = args.output > path_len = len(self._browser_bundle_path) > start_index = self._browser_bundle_path.rfind('/', 0, path_len) > end_index = self._browser_bundle_path.rfind('.', 0, path_len) >@@ -248,6 +256,9 @@ class LaunchTimeBenchmark: > > try: > group_means = [] >+ if self._save_results_to_json: >+ resultsDict = {self.get_test_name(): {"metrics": {"Time": {"current": []}}}} >+ > results_by_iteration_number = [[] for _ in range(self._iterations)] > > group = 1 >@@ -273,6 +284,9 @@ class LaunchTimeBenchmark: > if not self._verbose: > print '' > >+ if self._save_results_to_json: >+ resultsDict[self.get_test_name()]["metrics"]["Time"]["current"].append(results) >+ > mean, stdev = self._compute_results(results) > self.log_verbose('RESULTS:\n') > self.log_verbose('mean: {} ms\n'.format(mean)) >@@ -289,6 +303,10 @@ class LaunchTimeBenchmark: > if self._feedback_in_browser: > self.launch_browser() > >+ if self._save_results_to_json and self._json_results_path: >+ with open(self._json_results_path, "w") as jsonFile: >+ json.dump(resultsDict, jsonFile, indent=4, separators=(',', ': ')) >+ > means_by_iteration_number = [] > if len(results_by_iteration_number) > 1 and not self._do_not_ignore_first_result: > results_by_iteration_number = results_by_iteration_number[1:] >@@ -319,3 +337,6 @@ class LaunchTimeBenchmark: > > def did_parse_arguments(self, args): > pass >+ >+ def get_test_name(self): >+ return "LaunchTimeBenchmark" >diff --git a/PerformanceTests/LaunchTime/new_tab.py b/PerformanceTests/LaunchTime/new_tab.py >index d5c5d19133f9613e7b4eabfb0b3c3749635b8b2c..5574e8ab3ed175044f0a60b0f2a0d3a69e070744 100755 >--- a/PerformanceTests/LaunchTime/new_tab.py >+++ b/PerformanceTests/LaunchTime/new_tab.py >@@ -57,6 +57,9 @@ class NewTabBenchmark(LaunchTimeBenchmark): > def group_init(self): > self.launch_browser() > >+ def get_test_name(self): >+ return "NewTabBenchmark" >+ > def will_parse_arguments(self): > self.argument_parser.add_argument('-g', '--groups', type=int, > help='number of groups of iterations to run (default: {})'.format(self.iteration_groups)) >diff --git a/PerformanceTests/LaunchTime/startup.py b/PerformanceTests/LaunchTime/startup.py >index 39a6fc32a5a63f97945878399963b85c28b7b1fb..e8844cd899f0fb37cfc7b8be9cc9fd6aca5a61e2 100755 >--- a/PerformanceTests/LaunchTime/startup.py >+++ b/PerformanceTests/LaunchTime/startup.py >@@ -24,6 +24,9 @@ class StartupBenchmark(LaunchTimeBenchmark): > self.quit_browser() > return result > >+ def get_test_name(self): >+ return "StartupBenchmark" >+ > @staticmethod > def ResponseHandler(startup_benchmark): > class Handler(DefaultLaunchTimeHandler):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192385
: 356545 |
356552