Diff
Modified: trunk/Websites/perf.webkit.org/ChangeLog (184590 => 184591)
--- trunk/Websites/perf.webkit.org/ChangeLog 2015-05-19 21:37:49 UTC (rev 184590)
+++ trunk/Websites/perf.webkit.org/ChangeLog 2015-05-19 21:39:46 UTC (rev 184591)
@@ -1,3 +1,30 @@
+2015-05-19 Ryosuke Niwa <[email protected]>
+
+ Don't show unit (bytes) separaetly from SI suffixes (K, M, etc...)
+ https://bugs.webkit.org/show_bug.cgi?id=145181
+
+ Rubber-stamped by Chris Dumez.
+
+ Show 'MB' in each y-axis label instead of showing 'bytes' separately and suffixing each label with just 'M'
+ for clarity. This change also reduces the code complexity.
+
+ * public/index.html:
+ * public/v2/app.js:
+ (App.AnalysisTaskController._chartDataChanged):
+ (App.TestGroupPane._createConfigurationSummary):
+ * public/v2/data.js:
+ (RunsData.unitFromMetricName): Use 'B' instead of 'bytes' as the unit.
+
+ * public/v2/interactive-chart.js: Removed the support for showing units separately.
+ (App.InteractiveChartComponent._constructGraphIfPossible):
+ (App.InteractiveChartComponent._relayoutDataAndAxes)
+
+ * public/v2/manifest.js:
+ (App.Manifest._makeFormatter): Renamed from _formatBytes. Support more SI suffixes such as micro and mili.
+ Now takes the unit as the first argument. Adjust the base unit if it's 'ms'.
+ (App.Manifest._formatFetchedData): Removed unit and formatWithUnit now that all all formatters would
+ automatically include unit.
+
2015-05-18 Ryosuke Niwa <[email protected]>
REGRESSION: v2 UI reports a higher memory usage
Modified: trunk/Websites/perf.webkit.org/public/index.html (184590 => 184591)
--- trunk/Websites/perf.webkit.org/public/index.html 2015-05-19 21:37:49 UTC (rev 184590)
+++ trunk/Websites/perf.webkit.org/public/index.html 2015-05-19 21:39:46 UTC (rev 184591)
@@ -188,19 +188,6 @@
left: 5px;
}
-#dashboard .unit {
- display: none;
-}
-
-#charts .unit {
- font-size: small;
- width: 50px;
- text-align: center;
- position: absolute;
- bottom: 10px;
- left: 245px;
-}
-
#charts .arrow {
width: 20px;
height: 40px;
@@ -530,7 +517,6 @@
section.addClass(status.class);
section.find('.status tbody').html(buildLabelWithLinks(results.lastResult().build()));
section.find('.summaryTable tbody').html(summaryRows);
- section.find('.unit').html(results.unit());
if (results.smallerIsBetter()) {
section.find('.arrow .downwardArrowHead').show();
section.find('.arrow .upwardArrowHead').hide();
Modified: trunk/Websites/perf.webkit.org/public/v2/app.js (184590 => 184591)
--- trunk/Websites/perf.webkit.org/public/v2/app.js 2015-05-19 21:37:49 UTC (rev 184590)
+++ trunk/Websites/perf.webkit.org/public/v2/app.js 2015-05-19 21:39:46 UTC (rev 184591)
@@ -1228,7 +1228,7 @@
id: point.measurement.id(),
measurement: point.measurement,
label: 'Point ' + (index + 1),
- value: chartData.formatWithUnit(point.value),
+ value: chartData.formatter(point.value),
};
});
@@ -1529,7 +1529,7 @@
}),
value: point ? point.value : null,
valueRange: range,
- formattedValue: point ? testResults.formatWithUnit(point.value) : null,
+ formattedValue: point ? testResults.formatter(point.value) : null,
buildLabel: point ? 'Build ' + point.measurement.buildNumber() : null,
});
});
Modified: trunk/Websites/perf.webkit.org/public/v2/data.js (184590 => 184591)
--- trunk/Websites/perf.webkit.org/public/v2/data.js 2015-05-19 21:37:49 UTC (rev 184590)
+++ trunk/Websites/perf.webkit.org/public/v2/data.js 2015-05-19 21:39:46 UTC (rev 184591)
@@ -407,9 +407,9 @@
'Runs': '/s',
'Time': 'ms',
'Duration': 'ms',
- 'Malloc': 'bytes',
- 'Heap': 'bytes',
- 'Allocations': 'bytes',
+ 'Malloc': 'B',
+ 'Heap': 'B',
+ 'Allocations': 'B',
'Score': 'pt',
}[suffix];
return unit;
Modified: trunk/Websites/perf.webkit.org/public/v2/interactive-chart.js (184590 => 184591)
--- trunk/Websites/perf.webkit.org/public/v2/interactive-chart.js 2015-05-19 21:37:49 UTC (rev 184590)
+++ trunk/Websites/perf.webkit.org/public/v2/interactive-chart.js 2015-05-19 21:39:46 UTC (rev 184591)
@@ -113,8 +113,6 @@
this._targetTimeSeries = chartData.target;
this._movingAverageTimeSeries = chartData.movingAverage;
- this._yAxisUnit = chartData.unit;
-
if (this._baselineTimeSeries) {
this._paths.push(this._clippedContainer
.append("path")
@@ -312,14 +310,8 @@
return;
this._yAxisLabels.call(this._yAxis);
- if (this._yAxisUnitContainer)
- this._yAxisUnitContainer.remove();
var x = - 3.2 * this._rem;
var y = this._contentHeight / 2;
- this._yAxisUnitContainer = this._yAxisLabels.append("text")
- .attr("transform", "rotate(90 0 0) translate(" + y + ", " + (-x) + ")")
- .style("text-anchor", "middle")
- .text(this._yAxisUnit);
},
_updateHighlightPositions: function () {
if (!this._highlights)
Modified: trunk/Websites/perf.webkit.org/public/v2/manifest.js (184590 => 184591)
--- trunk/Websites/perf.webkit.org/public/v2/manifest.js 2015-05-19 21:37:49 UTC (rev 184590)
+++ trunk/Websites/perf.webkit.org/public/v2/manifest.js 2015-05-19 21:39:46 UTC (rev 184591)
@@ -315,29 +315,34 @@
};
});
},
- _formatBytes: function (sigFig, alwaysShowSign)
+ _makeFormatter: function (unit, sigFig, alwaysShowSign)
{
- var units = ['', 'K', 'M', 'G', 'T', 'P', 'E'];
- var threshold = sigFig >= 3 ? 1024 : 102.4;
+ var isMiliseconds = false;
+ if (unit == 'ms') {
+ isMiliseconds = true;
+ unit = 's';
+ }
+ var divisor = unit == 'bytes' ? 1024 : 1000;
+
+ var suffix = ['\u03BC', 'm', '', 'K', 'M', 'G', 'T', 'P', 'E'];
+ var threshold = sigFig >= 3 ? divisor : (divisor / 10);
return function (bytes) {
var i;
var sign = bytes >= 0 ? (alwaysShowSign ? '+' : '') : '-';
bytes = Math.abs(bytes);
-
- for (i = 0; bytes >= threshold; i++)
- bytes /= 1024;
- return sign + bytes.toPrecision(Math.max(2, sigFig)) + units[i];
+ for (i = isMiliseconds ? 1 : 2; bytes < 1; i--)
+ bytes *= divisor;
+ for (; bytes >= threshold; i++)
+ bytes /= divisor;
+ return sign + bytes.toPrecision(Math.max(2, sigFig)) + ' ' + suffix[i] + (unit || '');
}
},
_formatFetchedData: function (metricName, configurations)
{
var unit = RunsData.unitFromMetricName(metricName);
var smallerIsBetter = RunsData.isSmallerBetter(unit);
+ var deltaFormatterWithoutSign = this._makeFormatter(unit, 2, false);
- var isBytes = unit == 'bytes';
- var unitSuffix = unit ? ' ' + unit : '';
- var deltaFormatterWithoutSign = isBytes ? this._formatBytes(2, false) : d3.format('.2g');
-
var currentTimeSeries = configurations.current.timeSeriesByCommitTime(false);
var baselineTimeSeries = configurations.baseline ? configurations.baseline.timeSeriesByCommitTime(false) : null;
var targetTimeSeries = configurations.target ? configurations.target.timeSeriesByCommitTime(false) : null;
@@ -347,14 +352,12 @@
current: currentTimeSeries,
baseline: baselineTimeSeries,
target: targetTimeSeries,
- unit: unit,
- formatWithUnit: function (value) { return this.formatter(value) + unitSuffix; },
formatWithDeltaAndUnit: function (value, delta)
{
- return this.formatter(value) + (delta && !isNaN(delta) ? ' \u00b1 ' + deltaFormatterWithoutSign(delta) : '') + unitSuffix;
+ return this.formatter(value) + (delta && !isNaN(delta) ? ' \u00b1 ' + deltaFormatterWithoutSign(delta) : '');
},
- formatter: isBytes ? this._formatBytes(4, false) : d3.format('.4g'),
- deltaFormatter: isBytes ? this._formatBytes(2, true) : d3.format('+.2g'),
+ formatter: this._makeFormatter(unit, 4, false),
+ deltaFormatter: this._makeFormatter(unit, 2, true),
smallerIsBetter: smallerIsBetter,
showOutlier: function (show)
{