WebKitPerfMonitor: There should be a way to add all metrics of a suite without also...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Apr 2014 16:39:11 +0000 (16:39 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Apr 2014 16:39:11 +0000 (16:39 +0000)
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):

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

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/index.html

index b4b2cb0..4768ffd 100644 (file)
@@ -1,5 +1,20 @@
 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
         https://bugs.webkit.org/show_bug.cgi?id=131155
 
index ea4be80..bb902b1 100644 (file)
@@ -954,15 +954,33 @@ function init() {
             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);
                 }
             }
         }
@@ -1018,13 +1036,14 @@ function init() {
                     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);