Bug 106172 - Extract a class to represent a test result to simplify PerfTest.parse_output and PageLoadPerfTest._run_with_driver
Summary: Extract a class to represent a test result to simplify PerfTest.parse_output ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 97510
  Show dependency treegraph
 
Reported: 2013-01-05 02:14 PST by Ryosuke Niwa
Modified: 2013-01-07 10:29 PST (History)
7 users (show)

See Also:


Attachments
Patch (22.78 KB, patch)
2013-01-05 02:34 PST, Ryosuke Niwa
tony: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-01-05 02:14:28 PST
Right now, PerfTest.parse_output is a God-function that parses text output of DriverOutput and creates the dictionary PerfTestRunner and the perf-o-matic expects.
PageLoadPerfTest._run_with_driver has a similar problem.

Extract a class that represents a test result in order to simplify these two functions.
Comment 1 Ryosuke Niwa 2013-01-05 02:34:40 PST
Created attachment 181432 [details]
Patch
Comment 2 Tony Chang 2013-01-07 09:57:17 PST
Comment on attachment 181432 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=181432&action=review

> Tools/Scripts/webkitpy/performance_tests/perftest.py:56
> +    allowed_metrics = ('Time', 'Malloc', 'JSHeap')

Nit: I think we normally use ALL_CAPS for constants. Also, this looks like it is only used in the class so you could _ prefix it.

> Tools/Scripts/webkitpy/performance_tests/perftest.py:59
> +    def __init__(self, metric, unit=None, iterations=None):
> +        self._metric = metric

Nit: Maybe assert here that metric is in allowed_metrics?

> Tools/Scripts/webkitpy/performance_tests/perftest.py:245
> +                current_metric = metric_match.group('metric').replace(' ', '')

It's a bit unfortunate that we use "JS Heap" in one place and "JSHeap" in another.  Maybe we can clean this up in a follow up.
Comment 3 Ryosuke Niwa 2013-01-07 10:29:17 PST
Committed r138955: <http://trac.webkit.org/changeset/138955>