<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:rniwa&#64;webkit.org" title="Ryosuke Niwa &lt;rniwa&#64;webkit.org&gt;"> <span class="fn">Ryosuke Niwa</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add PerfAutoRun to automate browser based performance benchmarks(e.g. Speedometer and JetStream)"
   href="https://bugs.webkit.org/show_bug.cgi?id=144038">bug 144038</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #251460 Flags</td>
           <td>review?
           </td>
           <td>review-
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add PerfAutoRun to automate browser based performance benchmarks(e.g. Speedometer and JetStream)"
   href="https://bugs.webkit.org/show_bug.cgi?id=144038#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add PerfAutoRun to automate browser based performance benchmarks(e.g. Speedometer and JetStream)"
   href="https://bugs.webkit.org/show_bug.cgi?id=144038">bug 144038</a>
              from <span class="vcard"><a class="email" href="mailto:rniwa&#64;webkit.org" title="Ryosuke Niwa &lt;rniwa&#64;webkit.org&gt;"> <span class="fn">Ryosuke Niwa</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=251460&amp;action=diff" name="attach_251460" title="Patch">attachment 251460</a> <a href="attachment.cgi?id=251460&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=251460&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=251460&amp;action=review</a>

This patch needs a change log entry.  Run Tools/Scripts/prepare-ChangeLogs --bug=144038 and fill up the description.
r- because of this.

Can we also rename to something more redescriptive like BenchmarkRunner?

Also, I think we should put this code somewhere under Tools/Scripts/webkitpy.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/PerfAutoRun.py:2
&gt; +# coding : utf-8</span >

I don't think we want add these coding encoding since we don't do that elsewhere as Chris has already pointed out.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/PerfAutoRun.py:32
&gt; +    parser.add_argument(
&gt; +        '--platform',
&gt; +        dest='platform',
&gt; +        default='osx',
&gt; +        choices=[
&gt; +            'osx',
&gt; +            'ios',
&gt; +            'windows'],
&gt; +        required=True)</span >

Why don't we just put this in single line?
All these line breaks are rather making the code harder to read.
See other code in webkitpy.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/BaseBenchmarkHandle.py:2
&gt; +# coding : utf-8</span >

Ditto about coding.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/BaseBenchmarkHandle.py:7
&gt; +class BaseBenchmarkHandle(object):</span >

Why do we need this class at all?
It seems like we just need GenericBenchmarkHandle.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/BenchmarkHandleFactory.py:7
&gt; +from ..GenericHandleFactory import GenericHandleFactory</span >

Why don't we add a wrapper script in Tools/Scripts/, e.g. run-benchmark-in-browser
so that we don't have to prefix these imports with &quot;..&quot;.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/BenchmarkHandleFactory.py:17
&gt; +    handles = json.load(
&gt; +        open(
&gt; +            os.path.join(
&gt; +                os.path.dirname(__file__),
&gt; +                handleFileName),
&gt; +            'r'))</span >

Again, we don't normally line break between each parenthesis like this.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/BenchmarkHandles.json:8
&gt; +  &quot;GenericBenchmarkHandle&quot;: {
&gt; +    &quot;moduleName&quot;: &quot;GenericBenchmarkHandle&quot;, 
&gt; +    &quot;filePath&quot;: &quot;BenchmarkHandle.GenericBenchmarkHandle&quot;
&gt; +  }, 
&gt; +  &quot;JetStreamBenchmarkHandle&quot;: {
&gt; +    &quot;moduleName&quot;: &quot;JetStreamBenchmarkHandle&quot;, 
&gt; +    &quot;filePath&quot;: &quot;BenchmarkHandle.JetStreamBenchmarkHandle&quot;</span >

Please do use 4-space indentation everywhere per our style guileline.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/GenericBenchmarkHandle.py:18
&gt; +class GenericBenchmarkHandle(BaseBenchmarkHandle):</span >

I don't think we need to suffix all these classes with &quot;Handle&quot;.
Just like &quot;Manager&quot;, &quot;Controller&quot;, etc… these suffixes don't really convey extra information.
Here, GenericBenchmark tells us just as much as GenericBenchmarkHandle.
Also, handle usually refers to a pointer like object such as a file handle so I don't think we want to use it here.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/GenericBenchmarkHandle.py:19
&gt; +    def prepareBenchmark(self, benchmarkPath, patch):</span >

Why don't we call this just &quot;prepare&quot; since the class name already says GenericBenchmarkHandle.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/GenericBenchmarkHandle.py:23
&gt; +    def copyBenchmark(self, benchmarkPath):</span >

copyBenchmark sounds very generic.  Why don't we say that we're copying to a temporary location.
e.g. _copyBenchmarkToTempDir?
Also, we normally prefix private/protected method names with underscore.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/GenericBenchmarkHandle.py:24
&gt; +        self.webroot = tempfile.mkdtemp()</span >

we should be consistent in naming conventions.
either webRoot or web_root (the latter is PEP 8 style we use elsewhere for local variables and methods).

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/GenericBenchmarkHandle.py:29
&gt; +        self.dest = os.path.join(
&gt; +            self.webroot,
&gt; +            os.path.split(
&gt; +                benchmarkPath)[1])</span >

Seriously, all these line breaks are driving me nuts.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/GenericBenchmarkHandle.py:35
&gt; +    def applyPatch(self, patch):</span >

_applyPatch.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/GenericBenchmarkHandle.py:37
&gt; +            oldCwd = os.getcwd()</span >

Please use a descriptive name such as oldWorkingDirectory. &quot;cwd&quot; stands for current working directory
so oldCwd doesn't make much semantic sense.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/GenericBenchmarkHandle.py:39
&gt; +            retNum = subprocess.call(</span >

I'd call this exitCode instead.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/GenericBenchmarkHandle.py:44
&gt; +                logger.info(
&gt; +                    'Cannot apply patch, will skip current benchmarkPath')</span >

It seems like this is an error, not an informative log, to me.

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/BenchmarkHandle/GenericBenchmarkHandle.py:50
&gt; +    def clearBenchmark(self):
&gt; +        logger.info('Cleanning Benchmark')</span >

Why don't we call this clean?

<span class="quote">&gt; Tools/Scripts/PerfAutoRun/Utilities/ResultWrapper/ResultWrapperFactory.py:29
&gt; +if __name__ == '__main__':
&gt; +    merger = ResultWrapperFactory.create(['MergeResultWrapper'])
&gt; +    d1 = {</span >

Are these supposed to tests?
We usually put them in a separate tests directory.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>