WebKit Bugzilla
Attachment 349078 Details for
Bug 189135
: BenchmarkResults.format should support specifying depth of tests to show.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189135-20180906145931.patch (text/plain), 3.99 KB, created by
dewei_zhu
on 2018-09-06 14:59:32 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
dewei_zhu
Created:
2018-09-06 14:59:32 PDT
Size:
3.99 KB
patch
obsolete
>Subversion Revision: 235759 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 9fd756b43fdc2221d13692fc871c6887e4bc61e6..7d7fb66fa18d05a21751c513d15b7c96d00552e4 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,18 @@ >+2018-09-06 Dewei Zhu <dewei_zhu@apple.com> >+ >+ BenchmarkResults.format should support specifying depth of tests to show. >+ https://bugs.webkit.org/show_bug.cgi?id=189135 >+ >+ Reviewed by Ryosuke Niwa. >+ >+ Added the option to specify the depth of tests to show. >+ >+ * Scripts/webkitpy/benchmark_runner/benchmark_results.py: >+ (BenchmarkResults): >+ (BenchmarkResults.format): Added 'max_depth' option. >+ (BenchmarkResults._format_tests): Added unit tests for 'max_depth'. >+ >+ > 2018-09-06 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r235755. >diff --git a/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py b/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py >index d02dc1a16679810046ecdfa836faa25a218f4ff7..336daa6b4d7397644e0782d27c2a8d7d0a380a1d 100644 >--- a/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py >+++ b/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py >@@ -23,6 +23,7 @@ > import json > import math > import re >+import sys > > > class BenchmarkResults(object): >@@ -48,11 +49,11 @@ class BenchmarkResults(object): > self._lint_results(results) > self._results = self._aggregate_results(results) > >- def format(self, scale_unit=True, show_iteration_values=False): >- return self._format_tests(self._results, scale_unit, show_iteration_values) >+ def format(self, scale_unit=True, show_iteration_values=False, max_depth=sys.maxsize): >+ return self._format_tests(self._results, scale_unit, show_iteration_values, max_depth) > > @classmethod >- def _format_tests(cls, tests, scale_unit, show_iteration_values, indent=''): >+ def _format_tests(cls, tests, scale_unit, show_iteration_values, max_depth, indent=''): > output = '' > config_name = 'current' > for test_name in sorted(tests.keys()): >@@ -72,8 +73,8 @@ class BenchmarkResults(object): > if aggregator_name: > output += aggregator_name + ':' > output += ' ' + cls._format_values(metric_name, metric[aggregator_name][config_name], scale_unit, show_iteration_values) + '\n' >- if 'tests' in test: >- output += cls._format_tests(test['tests'], scale_unit, show_iteration_values, indent=(indent + ' ' * len(test_name))) >+ if 'tests' in test and max_depth > 1: >+ output += cls._format_tests(test['tests'], scale_unit, show_iteration_values, max_depth - 1, indent=(indent + ' ' * len(test_name))) > return output > > @classmethod >diff --git a/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results_unittest.py b/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results_unittest.py >index d4be43c82e373657565c10ca007c3ef23eb11e2e..bb06fde0e328866597a87cdfba2aa6d3c850d623 100644 >--- a/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results_unittest.py >+++ b/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results_unittest.py >@@ -55,6 +55,17 @@ SomeTest:Time:Arithmetic: 3.0ms stdev=33.3% > SubTest2:Time: 5.0ms stdev=20.0% > '''[1:]) > >+ def test_format_with_depth_limit(self): >+ result = BenchmarkResults({'SomeTest': { >+ 'metrics': {'Time': ['Total', 'Arithmetic']}, >+ 'tests': { >+ 'SubTest1': {'metrics': {'Time': {'current': [1, 2, 3]}}}, >+ 'SubTest2': {'metrics': {'Time': {'current': [4, 5, 6]}}}}}}) >+ self.assertEqual(result.format(max_depth=1), ''' >+SomeTest:Time:Arithmetic: 3.0ms stdev=33.3% >+ :Time:Total: 7.0ms stdev=28.6% >+'''[1:]) >+ > def test_format_values_with_large_error(self): > self.assertEqual(BenchmarkResults._format_values('Runs', [1, 2, 3]), '2.0/s stdev=50.0%') > self.assertEqual(BenchmarkResults._format_values('Runs', [10, 20, 30]), '20/s stdev=50.0%')
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
Flags:
rniwa
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189135
:
348999
| 349078