Make ARES-6 work from the CLI again
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Feb 2017 20:06:52 +0000 (20:06 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Feb 2017 20:06:52 +0000 (20:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=167895

Reviewed by Michael Saboff.

* ARES-6/driver.js:
(Driver.prototype.readyTrigger):
(Driver.prototype.disableTrigger):
* ARES-6/stats.js:
(Stats.prototype.toString.span.span):
(Stats.prototype.toString.return.span):
(Stats.prototype.toString):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211743 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/ARES-6/driver.js
PerformanceTests/ARES-6/stats.js
PerformanceTests/ChangeLog

index 1f5424c..ca9cbde 100644 (file)
@@ -46,14 +46,18 @@ class Driver {
     
     readyTrigger() 
     {
-        this._triggerCell.addEventListener('click', this._triggerLink);
-        this._triggerCell.classList.add('ready');
+        if (isInBrowser) {
+            this._triggerCell.addEventListener('click', this._triggerLink);
+            this._triggerCell.classList.add('ready');
+        }
     }
     
     disableTrigger() 
     {
-        this._triggerCell.removeEventListener('click', this._triggerLink);
-        this._triggerCell.classList.remove('ready');
+        if (isInBrowser) {
+            this._triggerCell.removeEventListener('click', this._triggerLink);
+            this._triggerCell.classList.remove('ready');
+        }
     }
     
     start(numIterations)
index 687dc3c..86138ff 100644 (file)
@@ -90,16 +90,24 @@ class Stats {
     {
         let result = this.result;
         
-        if (!result.n)
-            return `<span class="value">\&#10074;\&#10074;.\&#10074;\&#10074;</span><span class="units">ms</span>`;
+        if (!result.n) {
+            if (isInBrowser)
+                return `<span class="value">\&#10074;\&#10074;.\&#10074;\&#10074;</span><span class="units">ms</span>`;
+            return `${this._prefix}--.--ms`;
+        }
         
         if (result.mean != result.mean)
             return "ERROR";
         
-        if ("interval" in result)
-            return `<span class="value">${this._prefix}${result.mean.toFixed(2)}</span><span class="margin"> &plusmn;${result.interval.toFixed(2)}</span><span class="units">ms</span>`;
+        if ("interval" in result) {
+            if (isInBrowser)
+                return `<span class="value">${this._prefix}${result.mean.toFixed(2)}</span><span class="margin"> &plusmn;${result.interval.toFixed(2)}</span><span class="units">ms</span>`;
+            return `${this._prefix}${result.mean.toFixed(2)} +- ${result.interval.toFixed(2)} ms`;
+        }
 
-        return `<span class="value">${this._prefix}${result.mean.toFixed(2)}</span><span class="units">ms</span>`;
+        if (isInBrowser)
+            return `<span class="value">${this._prefix}${result.mean.toFixed(2)}</span><span class="units">ms</span>`;
+        return `${this._prefix}${result.mean.toFixed(2)} ms`;
     }
     
     _update()
index ad4e0e5..e0104be 100644 (file)
@@ -1,3 +1,18 @@
+2017-02-06  Saam Barati  <sbarati@apple.com>
+
+        Make ARES-6 work from the CLI again
+        https://bugs.webkit.org/show_bug.cgi?id=167895
+
+        Reviewed by Michael Saboff.
+
+        * ARES-6/driver.js:
+        (Driver.prototype.readyTrigger):
+        (Driver.prototype.disableTrigger):
+        * ARES-6/stats.js:
+        (Stats.prototype.toString.span.span):
+        (Stats.prototype.toString.return.span):
+        (Stats.prototype.toString):
+
 2017-02-06  Ryan Haddad  <ryanhaddad@apple.com>
 
         Skip ARES-6 on performance bots