Changeset 225898 in webkit
- Timestamp:
- Dec 14, 2017 1:49:37 AM (6 years ago)
- Location:
- trunk/Websites/perf.webkit.org
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Websites/perf.webkit.org/ChangeLog
r224551 r225898 1 2017-12-13 Dewei Zhu <dewei_zhu@apple.com> 2 3 Add a test freshness page. 4 https://bugs.webkit.org/show_bug.cgi?id=180126 5 6 Reviewed by Ryosuke Niwa. 7 8 Added a page to show freshness of a test. 9 The test freshness page reports on the same set of tests as the one shown in the summary page. 10 Use a logistic function to evaluate the freshness of the data points. 11 This function has the desired property which increase dramatically when it close to the center of the graph. 12 'acceptableLastDataPointDurationInHour' configs the center of the graph. 13 14 * public/include/manifest-generator.php: 15 * public/v3/components/freshness-indicator.js: Added. 16 (FreshnessIndicator): A cell of the test freshness table, color will transit from green to red. 17 (FreshnessIndicator.prototype.update): Update the the data point information and triggers 18 the cell to re-render if anything changes. 19 (FreshnessIndicator.prototype._renderIndicator): Re-render the indicator. 20 (FreshnessIndicator.prototype.render): Render the box color base on a logistic function. 21 (FreshnessIndicator.prototype._createIndicator): 22 (FreshnessIndicator.htmlTemplate): 23 (FreshnessIndicator.cssTemplate): 24 * public/v3/index.html: 25 * public/v3/main.js: Added test freshness page. 26 (main): 27 * public/v3/models/build-request.js: Refactored waitingTime function to make it reusable. 28 (BuildRequest.formatTimeInterval): Format time interval in million seconds to more user friendly text. 29 (BuildRequest.prototype.waitingTime): 30 * public/v3/pages/test-freshness-page.js: Added. 31 (TestFreshnessPage): 32 (TestFreshnessPage.prototype.name): 33 (TestFreshnessPage.prototype._loadConfig): Load config from summary page configurations. 34 (TestFreshnessPage.prototype.open): 35 (TestFreshnessPage.prototype._fetchTestResults): 36 (TestFreshnessPage.prototype.render): 37 (TestFreshnessPage.prototype._renderTable): 38 (TestFreshnessPage.prototype._isValidPlatformMetricCombination): Return whether a platform 39 and metric combination is valid. 40 (TestFreshnessPage.prototype._constructTableCell): 41 (TestFreshnessPage.cssTemplate): 42 (TestFreshnessPage.prototype.routeName): 43 * server-tests/api-manifest-tests.js: Added 'warningHourBaseline' so that we can config the 44 parameter of logistic funciton. 45 * unit-tests/build-request-tests.js: Added unit tests for formatTimeInterval. 46 1 47 2017-11-02 Dewei Zhu <dewei_zhu@apple.com> 2 48 -
trunk/Websites/perf.webkit.org/public/include/manifest-generator.php
r215987 r225898 45 45 'summaryPages' => config('summaryPages'), 46 46 'fileUploadSizeLimit' => config('uploadFileLimitInMB', 0) * 1024 * 1024, 47 'testAgeToleranceInHours' => config('testAgeToleranceInHours'), 47 48 ); 48 49 -
trunk/Websites/perf.webkit.org/public/v3/index.html
r222227 r225898 99 99 <script src="components/custom-configuration-test-group-form.js"></script> 100 100 <script src="components/instant-file-uploader.js"></script> 101 <script src="components/freshness-indicator.js"></script> 101 102 102 103 <script src="pages/page.js"></script> … … 118 119 <script src="pages/build-request-queue-page.js"></script> 119 120 <script src="pages/summary-page.js"></script> 121 <script src="pages/test-freshness-page.js"></script> 120 122 121 123 <script src="main.js"></script> -
trunk/Websites/perf.webkit.org/public/v3/main.js
r211196 r225898 48 48 buildRequestQueuePage.setParentPage(analysisCategoryPage); 49 49 50 const testHealthPage = new TestFreshnessPage(manifest.summaryPages, manifest.testAgeToleranceInHours); 51 50 52 var heading = new Heading(manifest.siteTitle); 51 heading.addPageGroup(summaryPages.concat([chartsPage, analysisCategoryPage ]));53 heading.addPageGroup(summaryPages.concat([chartsPage, analysisCategoryPage, testHealthPage])); 52 54 53 55 heading.setTitle(manifest.siteTitle); … … 62 64 router.addPage(buildRequestQueuePage); 63 65 router.addPage(analysisCategoryPage); 66 router.addPage(testHealthPage); 64 67 for (var page of dashboardPages) 65 68 router.addPage(page); -
trunk/Websites/perf.webkit.org/public/v3/models/build-request.js
r222219 r225898 85 85 createdAt() { return this._createdAt; } 86 86 87 waitingTime(referenceTime)88 {89 varunits = [87 static formatTimeInterval(intervalInMillionSeconds) { 88 let intervalInSeconds = intervalInMillionSeconds / 1000; 89 const units = [ 90 90 {unit: 'week', length: 7 * 24 * 3600}, 91 91 {unit: 'day', length: 24 * 3600}, … … 94 94 ]; 95 95 96 var diff = (referenceTime - this.createdAt()) / 1000;97 96 98 varindexOfFirstSmallEnoughUnit = units.length - 1;99 for ( vari = 0; i < units.length; i++) {100 if ( diff> 1.5 * units[i].length) {97 let indexOfFirstSmallEnoughUnit = units.length - 1; 98 for (let i = 0; i < units.length; i++) { 99 if (intervalInSeconds > 1.5 * units[i].length) { 101 100 indexOfFirstSmallEnoughUnit = i; 102 101 break; … … 104 103 } 105 104 106 varlabel = '';107 varlastUnit = false;108 for ( vari = indexOfFirstSmallEnoughUnit; !lastUnit; i++) {105 let label = ''; 106 let lastUnit = false; 107 for (let i = indexOfFirstSmallEnoughUnit; !lastUnit; i++) { 109 108 lastUnit = i == indexOfFirstSmallEnoughUnit + 1 || i == units.length - 1; 110 varlength = units[i].length;111 var valueForUnit = lastUnit ? Math.round(diff / length) : Math.floor(diff/ length);109 const length = units[i].length; 110 const valueForUnit = lastUnit ? Math.round(intervalInSeconds / length) : Math.floor(intervalInSeconds / length); 112 111 113 varunit = units[i].unit + (valueForUnit == 1 ? '' : 's');112 const unit = units[i].unit + (valueForUnit == 1 ? '' : 's'); 114 113 if (label) 115 114 label += ' '; 116 115 label += `${valueForUnit} ${unit}`; 117 116 118 diff = diff- valueForUnit * length;117 intervalInSeconds = intervalInSeconds - valueForUnit * length; 119 118 } 120 119 121 120 return label; 121 } 122 123 waitingTime(referenceTime) 124 { 125 return BuildRequest.formatTimeInterval(referenceTime - this.createdAt()); 122 126 } 123 127 -
trunk/Websites/perf.webkit.org/server-tests/api-manifest-tests.js
r215987 r225898 15 15 return TestServer.remoteAPI().getJSON('/api/manifest').then((manifest) => { 16 16 assert.deepEqual(Object.keys(manifest).sort(), ['all', 'bugTrackers', 'builders', 'dashboard', 'dashboards', 17 'elapsedTime', 'fileUploadSizeLimit', 'metrics', 'repositories', 'siteTitle', 'status', 'summaryPages', 'test s', 'triggerables']);17 'elapsedTime', 'fileUploadSizeLimit', 'metrics', 'repositories', 'siteTitle', 'status', 'summaryPages', 'testAgeToleranceInHours', 'tests', 'triggerables']); 18 18 19 19 assert.equal(typeof(manifest.elapsedTime), 'number'); … … 30 30 metrics: {}, 31 31 repositories: {}, 32 testAgeToleranceInHours: null, 32 33 tests: {}, 33 34 triggerables: {}, -
trunk/Websites/perf.webkit.org/unit-tests/build-request-tests.js
r215987 r225898 159 159 }); 160 160 161 describe('formatTimeInterval', () => { 162 it('should return "0 minutes" when formatting for 0 second in million seconds', () => { 163 assert.equal(BuildRequest.formatTimeInterval(0), '0 minutes'); 164 }); 165 166 it('should return "1 minute" when formatting for 60 seconds in million seconds', () => { 167 assert.equal(BuildRequest.formatTimeInterval(60 * 1000), '1 minute'); 168 }); 169 170 it('should return "1 minute" when formatting for 75 seconds in million seconds', () => { 171 assert.equal(BuildRequest.formatTimeInterval(75 * 1000), '1 minute'); 172 }); 173 174 it('should return "2 minutes" when formatting for 118 seconds in million seconds', () => { 175 assert.equal(BuildRequest.formatTimeInterval(118 * 1000), '2 minutes'); 176 }); 177 178 it('should return "75 minutes" when formatting for 75 minutes in million seconds', () => { 179 assert.equal(BuildRequest.formatTimeInterval(75 * 60 * 1000), '75 minutes'); 180 }); 181 182 it('should return "1 hour 58 minutes" when formatting for 118 minutes in million seconds', () => { 183 assert.equal(BuildRequest.formatTimeInterval(118 * 60 * 1000), '1 hour 58 minutes'); 184 }); 185 186 it('should return "3 hours 2 minutes" when formatting for 182 minutes in million seconds', () => { 187 assert.equal(BuildRequest.formatTimeInterval(182 * 60 * 1000), '3 hours 2 minutes'); 188 }); 189 190 it('should return "27 hours 14 minutes" when formatting for 27 hours 14 minutes in million seconds', () => { 191 assert.equal(BuildRequest.formatTimeInterval((27 * 3600 + 14 * 60) * 1000), '27 hours 14 minutes'); 192 }); 193 194 it('should return "2 days 3 hours" when formatting for 51 hours 14 minutes in million seconds', () => { 195 assert.equal(BuildRequest.formatTimeInterval((51 * 3600 + 14 * 60) * 1000), '2 days 3 hours'); 196 }); 197 198 it('should return "2 days 0 hours" when formatting for 48 hours 1 minutes in million seconds', () => { 199 assert.equal(BuildRequest.formatTimeInterval((48 * 3600 + 1 * 60) * 1000), '2 days 0 hours'); 200 }); 201 202 it('should return "2 days 2 hours" when formatting for 49 hours 59 minutes in million seconds', () => { 203 assert.equal(BuildRequest.formatTimeInterval((49 * 3600 + 59 * 60) * 1000), '2 days 2 hours'); 204 }); 205 206 it('should return "2 weeks 6 days" when formatting for 20 days 5 hours 21 minutes in million seconds', () => { 207 assert.equal(BuildRequest.formatTimeInterval(((20 * 24 + 5) * 3600 + 21 * 60) * 1000), '2 weeks 6 days'); 208 }); 209 }); 210 161 211 });
Note: See TracChangeset
for help on using the changeset viewer.