Commit d2c56521 authored by rmcilroy's avatar rmcilroy Committed by Commit bot

[RuntimeStats] Show all entries which are in at least one version.

Previously the runtime stats tool would only show entries which were in
the baseline version. This change adds any entries which exist in any
version to the comparison table, which would otherwise not appear anywhere
unless that version was selected as the baseline version.

NOTRY=true

Review-Url: https://codereview.chromium.org/2683863004
Cr-Commit-Position: refs/heads/master@{#43045}
parent 9b35d8f5
......@@ -448,12 +448,6 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
var tbody = document.createElement('tbody');
var referencePage = selectedPage;
page.forEachSorted(selectedPage, (parentEntry, entry, referenceEntry) => {
// Filter out entries that do not exist in the first column for the default
// view.
if (baselineVersion === undefined && referenceEntry &&
referenceEntry.time == 0) {
return;
}
var tr = document.createElement('tr');
tbody.appendChild(tr);
tr.entry = entry;
......@@ -517,7 +511,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
td(tr, count(entry.count, false), 'value count');
} else {
td(tr, '-', 'position');
td(tr, '-', 'name');
td(tr, referenceEntry.name, 'name');
td(tr, '-', 'value time');
td(tr, '-', 'value time');
td(tr, '-', 'value count');
......@@ -546,7 +540,8 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
if (needsPageSwitch) showPage(entry.page);
var childNodes = $('column_0').querySelector('.list tbody').childNodes;
for (var i = 0; i < childNodes.length; i++) {
if (childNodes[i].entry.name == entry.name) {
if (childNodes[i].entry !== undefined &&
childNodes[i].entry.name == entry.name) {
rowIndex = i;
break;
}
......@@ -1687,24 +1682,29 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
return true;
}
forEach(fun) {
if (baselineVersion === undefined) {
this.entries.forEach(fun);
return;
// Show also all entries which are in at least one version.
var dummyEntryNames = new Set();
versions.forEach((version) => {
var groupEntry = version.getEntry(this);
if (groupEntry != this) {
for (var entry of groupEntry.entries) {
if (this.page.get(entry.name) == undefined) {
dummyEntryNames.add(entry.name);
}
}
}
// If we have a baslineVersion to compare against show also all entries
// from the other group.
var tmpEntries = baselineVersion.getEntry(this)
.entries.filter((entry) => {
return this.page.get(entry.name) == undefined
});
// The compared entries are sorted by absolute impact.
tmpEntries = tmpEntries.map((entry) => {
var tmpEntry = new Entry(0, entry.name, 0, 0, 0, 0, 0, 0);
var tmpEntries = [];
for (var name of dummyEntryNames) {
var tmpEntry = new Entry(0, name, 0, 0, 0, 0, 0, 0);
tmpEntry.page = this.page;
return tmpEntry;
});
tmpEntries.push(tmpEntry);
};
// Concatenate our real entries.
tmpEntries = tmpEntries.concat(this.entries);
// The compared entries are sorted by absolute impact.
tmpEntries.sort((a, b) => {
return a.time - b.time
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment