<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[179710] trunk/Websites/perf.webkit.org</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/179710">179710</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2015-02-05 14:34:13 -0800 (Thu, 05 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>New perf dashboard should compare results to baseline and target
https://bugs.webkit.org/show_bug.cgi?id=141286

Reviewed by Chris Dumez.

Compare the selected value against baseline and target values as done in v1. e.g. &quot;5% below target&quot;
Also use d3.format to format the selected value to show four significant figures.

* public/v2/app.js:
(App.Pane.searchCommit):
(App.Pane._fetch): Create time series here via createChartData so that _computeStatus can use them
to compute the status text without having to recreate them.
(App.createChartData): Added.
(App.PaneController._updateDetails): Use 3d.format on current and old values.
(App.PaneController._computeStatus): Added. Computes the status text.
(App.PaneController._relativeDifferentToLaterPointInTimeSeries): Added.
(App.AnalysisTaskController._fetchedManifest): Use createChartData as done in App.Pane._fetch. Also
format the values using chartData.formatter.

* public/v2/chart-pane.css: Enlarge the status text. Show the status text in red if it's worse than
the baseline and in blue if it's better than the target.

* public/v2/data.js:
(TimeSeries.prototype.findPointAfterTime): Added.

* public/v2/index.html: Added a new tbody for the status text and the selected value. Also fixed
the bug that we were not showing the old value's unit.

* public/v2/interactive-chart.js:
(App.InteractiveChartComponent._constructGraphIfPossible): Use chartData.formatter. Also cleaned up
the code to show the baseline and the target lines.

* public/v2/manifest.js:
(App.Manifest.fetchRunsWithPlatformAndMetric): Added smallerIsBetter.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebsitesperfwebkitorgChangeLog">trunk/Websites/perf.webkit.org/ChangeLog</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicv2appjs">trunk/Websites/perf.webkit.org/public/v2/app.js</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicv2chartpanecss">trunk/Websites/perf.webkit.org/public/v2/chart-pane.css</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicv2datajs">trunk/Websites/perf.webkit.org/public/v2/data.js</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicv2indexhtml">trunk/Websites/perf.webkit.org/public/v2/index.html</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicv2interactivechartjs">trunk/Websites/perf.webkit.org/public/v2/interactive-chart.js</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicv2manifestjs">trunk/Websites/perf.webkit.org/public/v2/manifest.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebsitesperfwebkitorgChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/ChangeLog (179709 => 179710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/ChangeLog        2015-02-05 22:17:38 UTC (rev 179709)
+++ trunk/Websites/perf.webkit.org/ChangeLog        2015-02-05 22:34:13 UTC (rev 179710)
</span><span class="lines">@@ -1,5 +1,42 @@
</span><span class="cx"> 2015-02-05  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        New perf dashboard should compare results to baseline and target
+        https://bugs.webkit.org/show_bug.cgi?id=141286
+
+        Reviewed by Chris Dumez.
+
+        Compare the selected value against baseline and target values as done in v1. e.g. &quot;5% below target&quot;
+        Also use d3.format to format the selected value to show four significant figures.
+
+        * public/v2/app.js:
+        (App.Pane.searchCommit):
+        (App.Pane._fetch): Create time series here via createChartData so that _computeStatus can use them
+        to compute the status text without having to recreate them.
+        (App.createChartData): Added.
+        (App.PaneController._updateDetails): Use 3d.format on current and old values.
+        (App.PaneController._computeStatus): Added. Computes the status text.
+        (App.PaneController._relativeDifferentToLaterPointInTimeSeries): Added.
+        (App.AnalysisTaskController._fetchedManifest): Use createChartData as done in App.Pane._fetch. Also
+        format the values using chartData.formatter.
+
+        * public/v2/chart-pane.css: Enlarge the status text. Show the status text in red if it's worse than
+        the baseline and in blue if it's better than the target.
+
+        * public/v2/data.js:
+        (TimeSeries.prototype.findPointAfterTime): Added.
+
+        * public/v2/index.html: Added a new tbody for the status text and the selected value. Also fixed
+        the bug that we were not showing the old value's unit.
+
+        * public/v2/interactive-chart.js:
+        (App.InteractiveChartComponent._constructGraphIfPossible): Use chartData.formatter. Also cleaned up
+        the code to show the baseline and the target lines.
+
+        * public/v2/manifest.js:
+        (App.Manifest.fetchRunsWithPlatformAndMetric): Added smallerIsBetter.
+
+2015-02-05  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
</ins><span class="cx">         Unreviewed build fix.
</span><span class="cx"> 
</span><span class="cx">         * public/v2/app.js:
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicv2appjs"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/v2/app.js (179709 => 179710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/v2/app.js        2015-02-05 22:17:38 UTC (rev 179709)
+++ trunk/Websites/perf.webkit.org/public/v2/app.js        2015-02-05 22:34:13 UTC (rev 179710)
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx">         CommitLogs.fetchForTimeRange(repositoryId, null, null, keyword).then(function (commits) {
</span><span class="cx">             if (self.isDestroyed || !self.get('chartData') || !commits.length)
</span><span class="cx">                 return;
</span><del>-            var currentRuns = self.get('chartData').current.timeSeriesByCommitTime().series();
</del><ins>+            var currentRuns = self.get('chartData').current.series();
</ins><span class="cx">             if (!currentRuns.length)
</span><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="lines">@@ -329,7 +329,7 @@
</span><span class="cx">             App.Manifest.fetchRunsWithPlatformAndMetric(this.get('store'), platformId, metricId).then(function (result) {
</span><span class="cx">                 self.set('platform', result.platform);
</span><span class="cx">                 self.set('metric', result.metric);
</span><del>-                self.set('chartData', result.runs);
</del><ins>+                self.set('chartData', App.createChartData(result));
</ins><span class="cx">             }, function (result) {
</span><span class="cx">                 if (!result || typeof(result) === &quot;string&quot;)
</span><span class="cx">                     self.set('failure', 'Failed to fetch the JSON with an error: ' + result);
</span><span class="lines">@@ -365,6 +365,19 @@
</span><span class="cx">     }
</span><span class="cx"> });
</span><span class="cx"> 
</span><ins>+App.createChartData = function (data)
+{
+    var runs = data.runs;
+    return {
+        current: runs.current.timeSeriesByCommitTime(),
+        baseline: runs.baseline ? runs.baseline.timeSeriesByCommitTime() : null,
+        target: runs.target ? runs.target.timeSeriesByCommitTime() : null,
+        unit: data.unit,
+        formatter: data.useSI ? d3.format('.4s') : d3.format('.4g'),
+        smallerIsBetter: data.smallerIsBetter,
+    };
+}
+
</ins><span class="cx"> App.encodePrettifiedJSON = function (plain)
</span><span class="cx"> {
</span><span class="cx">     function numberIfPossible(string) {
</span><span class="lines">@@ -749,9 +762,11 @@
</span><span class="cx">                 buildURL = builder.urlFromBuildNumber(buildNumber);
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        var chartData = this.get('chartData');
</ins><span class="cx">         this.set('details', Ember.Object.create({
</span><del>-            currentValue: currentMeasurement.mean().toFixed(2),
-            oldValue: oldMeasurement &amp;&amp; selectedPoints ? oldMeasurement.mean().toFixed(2) : null,
</del><ins>+            status: this._computeStatus(currentPoint),
+            currentValue: chartData.formatter(currentMeasurement.mean()),
+            oldValue: oldMeasurement &amp;&amp; selectedPoints ? chartData.formatter(oldMeasurement.mean()) : null,
</ins><span class="cx">             buildNumber: buildNumber,
</span><span class="cx">             buildURL: buildURL,
</span><span class="cx">             buildTime: currentMeasurement.formattedBuildTime(),
</span><span class="lines">@@ -764,6 +779,40 @@
</span><span class="cx">         var points = this.get('selectedPoints');
</span><span class="cx">         this.set('cannotAnalyze', !this.get('newAnalysisTaskName') || !points || points.length &lt; 2);
</span><span class="cx">     }.observes('newAnalysisTaskName'),
</span><ins>+    _computeStatus: function (currentPoint)
+    {
+        var chartData = this.get('chartData');
+
+        var diffFromBaseline = this._relativeDifferentToLaterPointInTimeSeries(currentPoint, chartData.baseline);
+        var diffFromTarget = this._relativeDifferentToLaterPointInTimeSeries(currentPoint, chartData.target);
+
+        var label = '';
+        var className = '';
+        var formatter = d3.format('.3p');
+
+        var smallerIsBetter = chartData.smallerIsBetter;
+        if (diffFromBaseline !== undefined &amp;&amp; diffFromBaseline &gt; 0 == smallerIsBetter) {
+            label = formatter(Math.abs(diffFromBaseline)) + ' ' + (smallerIsBetter ? 'above' : 'below') + ' baseline';
+            className = 'worse';
+        } else if (diffFromTarget !== undefined &amp;&amp; diffFromTarget &lt; 0 == smallerIsBetter) {
+            label = formatter(Math.abs(diffFromTarget)) + ' ' + (smallerIsBetter ? 'below' : 'above') + ' target';
+            className = 'better';
+        } else if (diffFromTarget !== undefined)
+            label = formatter(Math.abs(diffFromTarget)) + ' until target';
+
+        return {className: className, label: label};
+    },
+    _relativeDifferentToLaterPointInTimeSeries: function (currentPoint, timeSeries)
+    {
+        if (!currentPoint || !timeSeries)
+            return undefined;
+        
+        var referencePoint = timeSeries.findPointAfterTime(currentPoint.time);
+        if (!referencePoint)
+            return undefined;
+
+        return (currentPoint.value - referencePoint.value) / referencePoint.value;
+    }
</ins><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -835,17 +884,18 @@
</span><span class="cx">         highlightedItems[start.measurement.id()] = true;
</span><span class="cx">         highlightedItems[end.measurement.id()] = true;
</span><span class="cx"> 
</span><ins>+        var chartData = App.createChartData(data);
</ins><span class="cx">         var formatedPoints = currentTimeSeries.seriesBetweenPoints(start, end).map(function (point, index) {
</span><span class="cx">             return {
</span><span class="cx">                 id: point.measurement.id(),
</span><span class="cx">                 measurement: point.measurement,
</span><span class="cx">                 label: 'Point ' + (index + 1),
</span><del>-                value: point.value + (runs.unit ? ' ' + runs.unit : ''),
</del><ins>+                value: chartData.formatter(point.value) + (data.unit ? ' ' + data.unit : ''),
</ins><span class="cx">             };
</span><span class="cx">         });
</span><span class="cx"> 
</span><span class="cx">         var margin = (end.time - start.time) * 0.1;
</span><del>-        this.set('chartData', runs);
</del><ins>+        this.set('chartData', chartData);
</ins><span class="cx">         this.set('chartDomain', [start.time - margin, +end.time + margin]);
</span><span class="cx">         this.set('highlightedItems', highlightedItems);
</span><span class="cx">         this.set('analysisPoints', formatedPoints);
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicv2chartpanecss"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/v2/chart-pane.css (179709 => 179710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/v2/chart-pane.css        2015-02-05 22:17:38 UTC (rev 179709)
+++ trunk/Websites/perf.webkit.org/public/v2/chart-pane.css        2015-02-05 22:34:13 UTC (rev 179710)
</span><span class="lines">@@ -210,6 +210,7 @@
</span><span class="cx"> .chart-pane .details-table td table td {
</span><span class="cx">     word-break: break-word;
</span><span class="cx">     border-top: solid 1px #ccc;
</span><ins>+    border-bottom: solid 1px #ccc;
</ins><span class="cx">     padding: 0.2rem;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -232,6 +233,14 @@
</span><span class="cx">     content: &quot; : &quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.chart-pane .details-table .status th {
+    visibility: hidden;
+}
+
+.chart-pane .details-table .status td {
+    font-size: 1rem;
+}
+
</ins><span class="cx"> .chart-pane .chart {
</span><span class="cx">     height: 100%;
</span><span class="cx"> }
</span><span class="lines">@@ -257,10 +266,6 @@
</span><span class="cx">     stroke-width: 1.5px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.chart .commit-time-line {
-    stroke: #999;
-}
-
</del><span class="cx"> .chart .dot {
</span><span class="cx">     fill: #666;
</span><span class="cx">     stroke: none;
</span><span class="lines">@@ -272,17 +277,23 @@
</span><span class="cx">     opacity: 0.8;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.chart path.area.baseline {
</del><ins>+.chart path.current {
+    stroke: #999;
+}
+
+.chart path.baseline {
</ins><span class="cx">     stroke: #f66;
</span><del>-    fill: #fdd;
-    opacity: 0.4;
</del><span class="cx"> }
</span><ins>+.chart-pane .status .worse {
+    color: #c33;
+}
</ins><span class="cx"> 
</span><del>-.chart path.area.target {
</del><ins>+.chart path.target {
</ins><span class="cx">     stroke: #66f;
</span><del>-    fill: #ddf;
-    opacity: 0.4;
</del><span class="cx"> }
</span><ins>+.chart-pane .status .better {
+    color: #33c;
+}
</ins><span class="cx"> 
</span><span class="cx"> .chart .axis,
</span><span class="cx"> .chart .domain {
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicv2datajs"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/v2/data.js (179709 => 179710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/v2/data.js        2015-02-05 22:17:38 UTC (rev 179709)
+++ trunk/Websites/perf.webkit.org/public/v2/data.js        2015-02-05 22:34:13 UTC (rev 179710)
</span><span class="lines">@@ -360,6 +360,11 @@
</span><span class="cx">     return this._series.find(function (point) { return point.measurement.id() == measurementId; });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+TimeSeries.prototype.findPointAfterTime = function (time)
+{
+    return this._series.find(function (point) { return point.time &gt;= time; });
+}
+
</ins><span class="cx"> TimeSeries.prototype.seriesBetweenPoints = function (startPoint, endPoint)
</span><span class="cx"> {
</span><span class="cx">     if (!startPoint.seriesIndex || !endPoint.seriesIndex)
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicv2indexhtml"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/v2/index.html (179709 => 179710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/v2/index.html        2015-02-05 22:17:38 UTC (rev 179709)
+++ trunk/Websites/perf.webkit.org/public/v2/index.html        2015-02-05 22:34:13 UTC (rev 179710)
</span><span class="lines">@@ -254,10 +254,21 @@
</span><span class="cx">                 {{/if}}
</span><span class="cx">             {{/each}}
</span><span class="cx">             &lt;/tbody&gt;
</span><del>-            &lt;tr&gt;&lt;th&gt;Current&lt;/th&gt;&lt;td&gt;{{details.currentValue}} {{chartData.unit}}
-            {{#if details.oldValue}}
-                (from {{details.oldValue}})
-            {{/if}}&lt;/td&gt;&lt;/tr&gt;
</del><ins>+            &lt;tbody class=&quot;status&quot;&gt;
+                &lt;tr&gt;
+                    &lt;th&gt;Current&lt;/th&gt;
+                    &lt;td&gt;
+                        {{details.currentValue}} {{chartData.unit}}
+                        {{#if details.oldValue}}
+                            (from {{details.oldValue}} {{chartData.unit}})
+                        {{/if}}
+                        {{#if details.status.label}}
+                            &lt;br&gt;
+                            &lt;span {{bind-attr class=details.status.className}}&gt;{{details.status.label}}&lt;/span&gt;
+                        {{/if}}
+                    &lt;/td&gt;
+                &lt;/tr&gt;
+            &lt;/tbody&gt;
</ins><span class="cx">             {{#if details.buildNumber}}
</span><span class="cx">                 &lt;tr&gt;
</span><span class="cx">                     &lt;th&gt;Build&lt;/th&gt;
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicv2interactivechartjs"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/v2/interactive-chart.js (179709 => 179710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/v2/interactive-chart.js        2015-02-05 22:17:38 UTC (rev 179709)
+++ trunk/Websites/perf.webkit.org/public/v2/interactive-chart.js        2015-02-05 22:34:13 UTC (rev 179710)
</span><span class="lines">@@ -66,8 +66,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (this.get('showYAxis')) {
</span><del>-            this._yAxis = d3.svg.axis().scale(this._y).orient(&quot;left&quot;).ticks(6).tickFormat(
-                chartData.useSI ? d3.format(&quot;s&quot;) : d3.format(&quot;.3g&quot;));
</del><ins>+            this._yAxis = d3.svg.axis().scale(this._y).orient(&quot;left&quot;).ticks(6).tickFormat(chartData.formatter);
</ins><span class="cx">             this._yAxisLabels = svg.append(&quot;g&quot;)
</span><span class="cx">                 .attr(&quot;class&quot;, &quot;y axis&quot;);
</span><span class="cx">         }
</span><span class="lines">@@ -100,31 +99,24 @@
</span><span class="cx">             this._highlights.remove();
</span><span class="cx">         this._highlights = null;
</span><span class="cx"> 
</span><del>-        this._currentTimeSeries = chartData.current.timeSeriesByCommitTime();
</del><ins>+        this._currentTimeSeries = chartData.current;
</ins><span class="cx">         this._currentTimeSeriesData = this._currentTimeSeries.series();
</span><del>-        this._baselineTimeSeries = chartData.baseline ? chartData.baseline.timeSeriesByCommitTime() : null;
-        this._targetTimeSeries = chartData.target ? chartData.target.timeSeriesByCommitTime() : null;
</del><ins>+        this._baselineTimeSeries = chartData.baseline;
+        this._targetTimeSeries = chartData.target;
</ins><span class="cx"> 
</span><span class="cx">         this._yAxisUnit = chartData.unit;
</span><span class="cx"> 
</span><del>-        var minMax = this._minMaxForAllTimeSeries();
-        var smallEnoughValue = minMax[0] - (minMax[1] - minMax[0]) * 10;
-        var largeEnoughValue = minMax[1] + (minMax[1] - minMax[0]) * 10;
-
-        // FIXME: Flip the sides based on smallerIsBetter-ness.
</del><span class="cx">         if (this._baselineTimeSeries) {
</span><del>-            var data = this._baselineTimeSeries.series();
-            this._areas.push(this._clippedContainer
</del><ins>+            this._paths.push(this._clippedContainer
</ins><span class="cx">                 .append(&quot;path&quot;)
</span><del>-                .datum(data.map(function (point) { return {time: point.time, value: point.value, interval: point.interval ? point.interval : [point.value, largeEnoughValue]}; }))
-                .attr(&quot;class&quot;, &quot;area baseline&quot;));
</del><ins>+                .datum(this._baselineTimeSeries.series())
+                .attr(&quot;class&quot;, &quot;baseline&quot;));
</ins><span class="cx">         }
</span><span class="cx">         if (this._targetTimeSeries) {
</span><del>-            var data = this._targetTimeSeries.series();
-            this._areas.push(this._clippedContainer
</del><ins>+            this._paths.push(this._clippedContainer
</ins><span class="cx">                 .append(&quot;path&quot;)
</span><del>-                .datum(data.map(function (point) { return {time: point.time, value: point.value, interval: point.interval ? point.interval : [smallEnoughValue, point.value]}; }))
-                .attr(&quot;class&quot;, &quot;area target&quot;));
</del><ins>+                .datum(this._targetTimeSeries.series())
+                .attr(&quot;class&quot;, &quot;target&quot;));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         this._areas.push(this._clippedContainer
</span><span class="lines">@@ -135,7 +127,7 @@
</span><span class="cx">         this._paths.push(this._clippedContainer
</span><span class="cx">             .append(&quot;path&quot;)
</span><span class="cx">             .datum(this._currentTimeSeriesData)
</span><del>-            .attr(&quot;class&quot;, &quot;commit-time-line&quot;));
</del><ins>+            .attr(&quot;class&quot;, &quot;current&quot;));
</ins><span class="cx"> 
</span><span class="cx">         this._dots.push(this._clippedContainer
</span><span class="cx">             .selectAll(&quot;.dot&quot;)
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicv2manifestjs"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/v2/manifest.js (179709 => 179710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/v2/manifest.js        2015-02-05 22:17:38 UTC (rev 179709)
+++ trunk/Websites/perf.webkit.org/public/v2/manifest.js        2015-02-05 22:34:13 UTC (rev 179710)
</span><span class="lines">@@ -281,12 +281,9 @@
</span><span class="cx">                 'Heap': 'bytes',
</span><span class="cx">                 'Allocations': 'bytes'
</span><span class="cx">             }[suffix];
</span><ins>+            var smallerIsBetter = unit != 'fps' &amp;&amp; unit != '/s'; // Assume smaller is better for unit-less metrics.
</ins><span class="cx"> 
</span><del>-            // FIXME: Include this information in JSON and process it in RunsData.fetchRuns
-            runs.unit = unit;
-            runs.useSI = unit == 'bytes';
-
-            return {platform: platform, metric: metric, runs: runs};
</del><ins>+            return {platform: platform, metric: metric, runs: runs, unit: unit, useSI: unit == 'bytes', smallerIsBetter: smallerIsBetter};
</ins><span class="cx">         });
</span><span class="cx">     },
</span><span class="cx"> }).create();
</span></span></pre>
</div>
</div>

</body>
</html>