Changeset 243510 in webkit
- Timestamp:
- Mar 26, 2019, 12:04:37 PM (7 years ago)
- Location:
- trunk/Websites/perf.webkit.org
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
public/api/measurement-set.php (modified) (1 diff)
-
server-tests/api-measurement-set-tests.js (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Websites/perf.webkit.org/ChangeLog
r243358 r243510 1 2019-03-25 Dewei Zhu <dewei_zhu@apple.com> 2 3 Primary cluster of measurement set should always contain latest point. 4 https://bugs.webkit.org/show_bug.cgi?id=196243 5 6 Reviewed by Ryosuke Niwa. 7 8 Fix a bug in measurement-set api that primary cluster may not contain latest data point as 9 'carry_over' row may not be updated. 10 11 * public/api/measurement-set.php: Should always keep 'carry_over' data points up to date. 12 * server-tests/api-measurement-set-tests.js: Added an unit test for this change. 13 Fixed a typo. 14 1 15 2019-03-21 Dewei Zhu <dewei_zhu@apple.com> 2 16 -
trunk/Websites/perf.webkit.org/public/api/measurement-set.php
r236454 r243510 154 154 if ($reached_end) 155 155 $this->queries[$name] = NULL; 156 else { 157 $this->next_cluster_results[$name] = array_slice($results_by_config[$name], -2); 158 } 156 $this->next_cluster_results[$name] = array_slice($results_by_config[$name], -2); 159 157 } 160 158 -
trunk/Websites/perf.webkit.org/server-tests/api-measurement-set-tests.js
r238164 r243510 108 108 }}]; 109 109 110 const reportWithAnc entRevision = [{110 const reportWithAncientRevision = [{ 111 111 "buildNumber": "126", 112 112 "buildTime": "2013-02-28T23:07:25Z", … … 125 125 "test1": { 126 126 "metrics": {"Time": { "current": [21, 22, 23, 24, 25] }} 127 } 128 } 129 }, 130 }}]; 131 132 const secondReportWithRevision = [{ 133 "buildNumber": "127", 134 "buildTime": "2013-02-28T23:07:25Z", 135 "revisions": { 136 "WebKit": { 137 "revision": "137794", 138 "timestamp": clusterTime(11.1).toISOString() 139 }, 140 }, 141 "builderName": "someBuilder", 142 "builderPassword": "somePassword", 143 "platform": "Mountain Lion", 144 "tests": { 145 "Suite": { 146 "tests": { 147 "test1": { 148 "metrics": {"Time": { "current": [21, 22, 23, 24, 25] }} 149 } 150 } 151 }, 152 }}]; 153 154 const thirdReportWithRevision = [{ 155 "buildNumber": "128", 156 "buildTime": "2013-02-28T23:07:25Z", 157 "revisions": { 158 "WebKit": { 159 "revision": "137795", 160 "timestamp": clusterTime(11.2).toISOString() 161 }, 162 }, 163 "builderName": "someBuilder", 164 "builderPassword": "somePassword", 165 "platform": "Mountain Lion", 166 "tests": { 167 "Suite": { 168 "tests": { 169 "test1": { 170 "metrics": {"Time": { "current": [21, 22, 23, 24, 25] }} 171 } 172 } 173 }, 174 }}]; 175 176 const reportBaselineWithRevision = [{ 177 "buildNumber": "129", 178 "buildTime": "2013-02-28T15:35:51Z", 179 "revisions": { 180 "WebKit": { 181 "revision": "144001", 182 "timestamp": clusterTime(13.35645364537).toISOString(), 183 }, 184 }, 185 "builderName": "someBuilder", 186 "builderPassword": "somePassword", 187 "platform": "Mountain Lion", 188 "tests": { 189 "Suite": { 190 "tests": { 191 "test1": { 192 "metrics": {"Time": { "baseline": [11, 12, 13, 14, 15] }} 193 } 194 } 195 }, 196 }}]; 197 198 const secondReportBaselineWithRevision = [{ 199 "buildNumber": "130", 200 "buildTime": "2013-02-28T23:01:25Z", 201 "revisions": { 202 "WebKit": { 203 "revision": "137784", 204 "timestamp": clusterTime(11.12).toISOString() 205 }, 206 }, 207 "builderName": "someBuilder", 208 "builderPassword": "somePassword", 209 "platform": "Mountain Lion", 210 "tests": { 211 "Suite": { 212 "tests": { 213 "test1": { 214 "metrics": {"Time": { "baseline": [21, 22, 23, 24, 25] }} 215 } 216 } 217 }, 218 }}]; 219 220 const thirdReportBaselineWithRevision = [{ 221 "buildNumber": "131", 222 "buildTime": "2013-02-28T23:01:25Z", 223 "revisions": { 224 "WebKit": { 225 "revision": "137884", 226 "timestamp": clusterTime(11.22).toISOString() 227 }, 228 }, 229 "builderName": "someBuilder", 230 "builderPassword": "somePassword", 231 "platform": "Mountain Lion", 232 "tests": { 233 "Suite": { 234 "tests": { 235 "test1": { 236 "metrics": {"Time": { "baseline": [21, 22, 23, 24, 25] }} 127 237 } 128 238 } … … 343 453 }); 344 454 455 it("should keep 'carry_over' points up to date", async () => { 456 const remote = TestServer.remoteAPI(); 457 await addBuilderForReport(reportWithRevision[0]); 458 await remote.postJSON('/api/report/', reportWithRevision); 459 await remote.postJSON('/api/report/', secondReportWithRevision); 460 await remote.postJSON('/api/report/', thirdReportWithRevision); 461 await remote.postJSON('/api/report/', reportBaselineWithRevision); 462 await remote.postJSON('/api/report/', secondReportBaselineWithRevision); 463 await remote.postJSON('/api/report/', thirdReportBaselineWithRevision); 464 const result = await queryPlatformAndMetricWithRepository('Mountain Lion', 'Time', 'WebKit'); 465 466 const response = await remote.getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`); 467 468 const currentRows = response['configurations']['current']; 469 assert.equal(currentRows.length, 2); 470 assert.deepEqual(format(response['formatMap'], currentRows[0]).buildNumber, 127); 471 assert.deepEqual(format(response['formatMap'], currentRows[1]).buildNumber, 128); 472 assert(format(response['formatMap'], currentRows[0]).commitTime < response.startTime); 473 assert(format(response['formatMap'], currentRows[1]).commitTime < response.startTime); 474 475 const baselineRows = response['configurations']['baseline']; 476 assert.equal(baselineRows.length, 2); 477 assert.deepEqual(format(response['formatMap'], baselineRows[0]).buildNumber, 131); 478 assert.deepEqual(format(response['formatMap'], baselineRows[1]).buildNumber, 129); 479 }); 480 345 481 it("should order results by build time when commit times are missing", () => { 346 482 const remote = TestServer.remoteAPI(); … … 419 555 const remote = TestServer.remoteAPI(); 420 556 return addBuilderForReport(reportWithBuildTime[0]).then(() => { 421 return remote.postJSON('/api/report/', reportWithAnc entRevision);557 return remote.postJSON('/api/report/', reportWithAncientRevision); 422 558 }).then(() => { 423 559 return remote.postJSON('/api/report/', reportWithNewRevision); … … 430 566 assert.equal(response['clusterCount'], 2, 'should have two clusters'); 431 567 assert.deepEqual(buildNumbers(response, 'current'), 432 [reportWithAnc entRevision[0]['buildNumber'], reportWithNewRevision[0]['buildNumber']]);568 [reportWithAncientRevision[0]['buildNumber'], reportWithNewRevision[0]['buildNumber']]); 433 569 }); 434 570 }); … … 439 575 return remote.postJSON('/api/report/', reportWithBuildTime); 440 576 }).then(() => { 441 return remote.postJSON('/api/report/', reportWithAnc entRevision);577 return remote.postJSON('/api/report/', reportWithAncientRevision); 442 578 }).then(() => { 443 579 return queryPlatformAndMetric('Mountain Lion', 'Time'); … … 448 584 let currentRows = response['configurations']['current']; 449 585 assert.equal(currentRows.length, 2, 'should contain two data points'); 450 assert.deepEqual(buildNumbers(response, 'current'), [reportWithAnc entRevision[0]['buildNumber'], reportWithBuildTime[0]['buildNumber']]);586 assert.deepEqual(buildNumbers(response, 'current'), [reportWithAncientRevision[0]['buildNumber'], reportWithBuildTime[0]['buildNumber']]); 451 587 }); 452 588 }); … … 456 592 let cachePrefix; 457 593 return addBuilderForReport(reportWithBuildTime[0]).then(() => { 458 return remote.postJSON('/api/report/', reportWithAnc entRevision);594 return remote.postJSON('/api/report/', reportWithAncientRevision); 459 595 }).then(() => { 460 596 return remote.postJSON('/api/report/', reportWithRevision);
Note:
See TracChangeset
for help on using the changeset viewer.