Extend perf dashboard to support multiple summary pages.
authordewei_zhu@apple.com <dewei_zhu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2016 21:54:38 +0000 (21:54 +0000)
committerdewei_zhu@apple.com <dewei_zhu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2016 21:54:38 +0000 (21:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=162594

Reviewed by Ryosuke Niwa.

Start support multiple summary pages instead of one.
Specify 'summaryPages' as key that map to a list of summaries which follows
current 'summary' format in 'config.json' but with 2 more properties:
   'name': specifying the name shows on perf dashboard,
   'route': specifying the path to this page.

* public/include/manifest.php:
* public/v3/main.js:
(main):
(main.): Deleted.
* public/v3/models/manifest.js:
(Manifest._didFetchManifest):
(Manifest):
* public/v3/pages/summary-page.js:
(SummaryPage):
(SummaryPage.prototype.routeName):

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

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/include/manifest.php
Websites/perf.webkit.org/public/v3/main.js
Websites/perf.webkit.org/public/v3/models/manifest.js
Websites/perf.webkit.org/public/v3/pages/summary-page.js

index 3d9ab61..008b59a 100644 (file)
@@ -1,3 +1,27 @@
+2016-09-27  Dewei Zhu  <dewei_zhu@apple.com>
+
+        Extend perf dashboard to support multiple summary pages.
+        https://bugs.webkit.org/show_bug.cgi?id=162594
+
+        Reviewed by Ryosuke Niwa.
+
+        Start support multiple summary pages instead of one.
+        Specify 'summaryPages' as key that map to a list of summaries which follows
+        current 'summary' format in 'config.json' but with 2 more properties:
+           'name': specifying the name shows on perf dashboard,
+           'route': specifying the path to this page.
+
+        * public/include/manifest.php:
+        * public/v3/main.js:
+        (main):
+        (main.): Deleted.
+        * public/v3/models/manifest.js:
+        (Manifest._didFetchManifest):
+        (Manifest):
+        * public/v3/pages/summary-page.js:
+        (SummaryPage):
+        (SummaryPage.prototype.routeName):
+
 2016-08-09  Ryosuke Niwa  <rniwa@webkit.org>
 
         Don't filter out the latest data point in chart data sampling
index d8b8be4..c7746e4 100644 (file)
@@ -41,7 +41,7 @@ class ManifestGenerator {
             'builders' => (object)$this->builders(),
             'bugTrackers' => (object)$this->bug_trackers($repositories_table),
             'dashboards' => (object)config('dashboards'),
-            'summary' => (object)config('summary'),
+            'summaryPages' => (object)config('summaryPages'),
         );
 
         $this->manifest['elapsedTime'] = (microtime(true) - $start_time) * 1000;
index 642751e..ae5dfc2 100644 (file)
@@ -20,7 +20,12 @@ function main() {
         var router = new PageRouter();
         var chartsToolbar = new ChartsToolbar;
 
-        var summaryPage = manifest.summary ? new SummaryPage(manifest.summary) : null;
+        var summaryPages = [];
+        if (manifest.summaryPages) {
+            for (var summaryPage of manifest.summaryPages)
+                summaryPages.push(new SummaryPage(summaryPage));
+        }
+
         var chartsPage = new ChartsPage(chartsToolbar);
         var analysisCategoryPage = new AnalysisCategoryPage();
 
@@ -34,13 +39,13 @@ function main() {
         buildRequestQueuePage.setParentPage(analysisCategoryPage);
 
         var heading = new Heading(manifest.siteTitle);
-        heading.addPageGroup([summaryPage, chartsPage, analysisCategoryPage].filter(function (page) { return page; }));
+        heading.addPageGroup(summaryPages.concat([chartsPage, analysisCategoryPage]));
 
         heading.setTitle(manifest.siteTitle);
         heading.addPageGroup(dashboardPages);
 
         var router = new PageRouter();
-        if(summaryPage)
+        for (var summaryPage of summaryPages)
             router.addPage(summaryPage);
         router.addPage(chartsPage);
         router.addPage(createAnalysisTaskPage);
@@ -50,9 +55,9 @@ function main() {
         for (var page of dashboardPages)
             router.addPage(page);
 
-        if (summaryPage)
-            router.setDefaultPage(summaryPage);
-        else if (dashboardPages)
+        if (summaryPages.length)
+            router.setDefaultPage(summaryPages[0]);
+        else if (dashboardPages.length)
             router.setDefaultPage(dashboardPages[0]);
         else
             router.setDefaultPage(chartsPage);
index b7ac86c..7df022e 100644 (file)
@@ -48,7 +48,7 @@ class Manifest {
         return {
             siteTitle: rawResponse.siteTitle,
             dashboards: rawResponse.dashboards, // FIXME: Add an abstraction around dashboards.
-            summary: rawResponse.summary,
+            summaryPages: rawResponse.summaryPages,
         }
     }
 }
index f736a5c..521a59b 100644 (file)
@@ -3,8 +3,9 @@ class SummaryPage extends PageWithHeading {
 
     constructor(summarySettings)
     {
-        super('Summary', null);
+        super(summarySettings.name, null);
 
+        this._route = summarySettings.route;
         this._table = {
             heading: summarySettings.platformGroups,
             groups: [],
@@ -26,7 +27,7 @@ class SummaryPage extends PageWithHeading {
         }
     }
 
-    routeName() { return 'summary'; }
+    routeName() { return `summary/${this._route}`; }
 
     open(state)
     {
@@ -37,7 +38,7 @@ class SummaryPage extends PageWithHeading {
         for (var group of this._configGroups)
             group.fetchAndComputeSummary(timeRange).then(this.render.bind(this));
     }
-    
+
     render()
     {
         Instrumentation.startMeasuringTime('SummaryPage', 'render');