| Summary: | BenchmarkResults.format should support specifying depth of tests to show. | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | dewei_zhu | ||||||
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | dewei_zhu, ews-watchlist, glenn, rniwa | ||||||
| Priority: | P2 | ||||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Bug Depends on: | 189367 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
dewei_zhu
2018-08-29 17:49:32 PDT
Created attachment 348999 [details]
Patch
Comment on attachment 348999 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=348999&action=review r=me with the suggested change. > Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py:78 > - output += cls._format_tests(test['tests'], scale_unit, show_iteration_values, indent=(indent + ' ' * len(test_name))) > + output += cls._format_tests(test['tests'], scale_unit, show_iteration_values, None if max_depth is None else max_depth - 1, indent=(indent + ' ' * len(test_name))) This is such a convoluted way of doing this. Please just check: "if 'tests' in test and max_depth > 1" above. Comment on attachment 348999 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=348999&action=review >> Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py:78 >> + output += cls._format_tests(test['tests'], scale_unit, show_iteration_values, None if max_depth is None else max_depth - 1, indent=(indent + ' ' * len(test_name))) > > This is such a convoluted way of doing this. > Please just check: "if 'tests' in test and max_depth > 1" above. I don't think this will handle the case when max_depth is None. It would have been much easier if Python have something similar to Infinity in JavaScript. Also, due to the check on line 56, it ensures max_depth can either be None or integer larger than 0. I can try to simplify it by using "max_depth - 1 if max_depth else None" Comment on attachment 348999 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=348999&action=review > Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py:52 > + def format(self, scale_unit=True, show_iteration_values=False, max_depth=None): > + return self._format_tests(self._results, scale_unit, show_iteration_values, max_depth) Just use max_depth=sys.maxsize here. Created attachment 349078 [details]
Patch
|