+2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
+
+ WebKitPerfMonitor: There should be a way to add all metrics of a suite without also adding subtests
+ https://bugs.webkit.org/show_bug.cgi?id=131157
+
+ Reviewed by Andreas Kling.
+
+ Split "all metrics" into all metrics of a test suite and all subtests of the suite.
+ This allows, for example, adding all metrics such as Arithmetic and Geometric for
+ a given test suite without also adding its subtests.
+
+ * public/index.html:
+ (init.showCharts):
+ (init):
+
2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
WebKitPerfMonitor: Tooltips cannot be pinned after using browser's back button
while (metricList.firstChild)
metricList.removeChild(metricList.firstChild);
- addOption(metricList, 'All metrics', OPTION_VALUE_FOR_ALL);
+ var metricsGroup = document.createElement('optgroup');
+ metricsGroup.label = 'Metrics';
+ metricList.appendChild(metricsGroup);
+ addOption(metricsGroup, 'All metrics', OPTION_VALUE_FOR_ALL);
for (var i = 0; i < tests.length; ++i) {
- if (tests[i].id != testList.value && (!tests[i].parentTest || tests[i].parentTest.id != testList.value))
+ if (tests[i].id == testList.value) {
+ var selectedTest = tests[i];
+ for (var j = 0; j < selectedTest.metrics.length; ++j) {
+ var fullName = selectedTest.metrics[j].fullName;
+ var relativeName = fullName.replace(selectedTest.fullName, '').replace(/^[:/]/, '');
+ addOption(metricsGroup, relativeName, fullName);
+ }
+ }
+ }
+ var subtestsGroup = document.createElement('optgroup');
+ subtestsGroup.label = 'Tests';
+ metricList.appendChild(subtestsGroup);
+ addOption(subtestsGroup, 'All subtests', OPTION_VALUE_FOR_ALL);
+ for (var i = 0; i < tests.length; ++i) {
+ if (!tests[i].parentTest || tests[i].parentTest.id != testList.value)
continue;
- var selectedTest = tests[i].id == testList.value ? tests[i] : tests[i].parentTest;
- for (var j = 0; j < tests[i].metrics.length; ++j) {
- var fullName = tests[i].metrics[j].fullName;
+ var subtest = tests[i];
+ var selectedTest = subtest.parentTest;
+ for (var j = 0; j < subtest.metrics.length; ++j) {
+ var fullName = subtest.metrics[j].fullName;
var relativeName = fullName.replace(selectedTest.fullName, '').replace(/^[:/]/, '');
- addOption(metricList, relativeName, fullName);
+ addOption(subtestsGroup, relativeName, fullName);
}
}
}
newChartList.push([allPlatforms[i].name, metricList.value]);
}
} else if (metricList.value === OPTION_VALUE_FOR_ALL) {
- for (var i = 0; i < tests.length; ++i) {
- if (tests[i].id != testList.value && (!tests[i].parentTest || tests[i].parentTest.id != testList.value))
+ var group = metricList.selectedOptions[0].parentNode;
+ var metricsToAdd = [];
+ for (var i = 0; i < group.children.length; i++) {
+ var metric = group.children[i].value;
+ if (metric == OPTION_VALUE_FOR_ALL)
continue;
- for (var j = 0; j < tests[i].metrics.length; ++j) {
- createChartFromListPair(platformList.value, tests[i].metrics[j].fullName);
- newChartList.push([platformList.value, tests[i].metrics[j].fullName]);
- }
+ createChartFromListPair(platformList.value, metric);
+ newChartList.push([platformList.value, metric]);
}
} else {
createChartFromListPair(platformList.value, metricList.value);