1 2016-05-04 Dewei Zhu <dewei_zhu@apple.com>
3 Summary page should show warnings when current or baseline data is missing.
4 https://bugs.webkit.org/show_bug.cgi?id=157339
6 Reviewed by Ryosuke Niwa.
8 Set summary page to be the default page of v3 UI.
9 Show warning icon when either baseline or current data is missing.
10 Make fetchBetween returns a promise.
11 Update unit tests for MeasurementSet.fetchBetween since it returns a promise now.
12 Add a workaround to skip some platform and metric configurations.
14 * public/v3/components/ratio-bar-graph.js:
16 (RatioBarGraph.prototype.update): Add showWarningIcon flag to indicate whether we should show warning icon.
17 (RatioBarGraph.prototype.render): Show warning icon when showWarningIcon is true.
18 (RatioBarGraph.cssTemplate): Add style for warning icon.
19 * public/v3/components/warning-icon.js: Add warning icon.
21 (WarningIcon.cssTemplate):
22 * public/v3/index.html:
24 (main): Set summary page to be the default page of v3 UI.
25 * public/v3/models/measurement-set.js:
27 (MeasurementSet.prototype.fetchBetween): Returns a promise. Fix the bug in previous implementation that we miss
28 some callbacks sometimes. Basically, we will fetch primary cluster first, then secondary clusters. For each
29 secondary cluster fetch, we will always invoke callback even when it fails.
30 (MeasurementSet.prototype._fetchSecondaryClusters): Deleted.
31 (MeasurementSet.prototype._fetch.else.url.api.measurement.set platform): Deleted.
32 * public/v3/pages/summary-page.js:
33 (SummaryPage): Add a variable for excluded configurations.
34 (SummaryPage.prototype._createConfigurationGroup): Pass excluded configurations while building config groups.
35 (SummaryPage.prototype._constructTable): Remove the logic for unified header since it breaks consistency of the table appearance.
36 (SummaryPage.prototype.this._renderQueue.push): Show warning message when baseline/current data is missing.
37 (SummaryPageConfigurationGroup): Add a variable to keep track of the warnings while computing summary.
38 (SummaryPageConfigurationGroup.prototype.warnings): A getter for warnings.
39 (SummaryPageConfigurationGroup._computeSummary): Fix a bug in calculating ratios. We should always use
40 current/baseline for ratio and present the difference between ratio and 1 in the summary page.
41 (SummaryPageConfigurationGroup.set then): Deleted.
42 (SummaryPageConfigurationGroup.set var): Deleted.
43 * unit-tests/measurement-set-tests.js: Add a helper function to wait for fetchBetween. Update unit tests since fetchBetween returns a promise now.
44 (promise.set fetchBetween):
46 (set fetchBetween): Deleted.
48 2016-04-26 Ryosuke Niwa <rniwa@webkit.org>
50 Chart status should always be computed against prior values
51 https://bugs.webkit.org/show_bug.cgi?id=157014
53 Reviewed by Darin Adler.
55 Compare the current value against the last baseline or target value that appear before the current value in time
56 so that the comparison stay the same even when new baseline and target values are reported. Also include the compared
57 baseline or target value in the label for clarity.
59 * public/v3/components/chart-status-view.js:
60 (ChartStatusView.prototype._computeChartStatus):
61 (ChartStatusView.prototype._computeChartStatus.labelForDiff):
62 (ChartStatusView.prototype._findLastPointPriorToTime): Extracted from _relativeDifferenceToLaterPointInTimeSeries.
63 Now finds the last point before the current point's time if there is any, or the last point in baseline / target.
64 (ChartStatusView.prototype._relativeDifferenceToLaterPointInTimeSeries): Deleted.
65 * public/v3/models/metric.js:
66 (Metric.prototype.makeFormatter): Don't use SI units for unit-less metrics.
68 2016-04-13 Ryosuke Niwa <rniwa@webkit.org>
70 REGRESSION(r199444): Perf dashboard always fetches all measurement sets
71 https://bugs.webkit.org/show_bug.cgi?id=156534
73 Reviewed by Darin Adler.
75 The bug was cased by SummaryPage's constructor fetching all measurement sets. Since each page is always
76 constructed in main(), this resulted in all measurement sets being fetched on all pages.
78 * public/v3/pages/summary-page.js:
80 (SummaryPage.prototype.open): Fetch measurement set JSONs here.
81 (SummaryPage.prototype._createConfigurationGroup): Renamed from _createConfigurationGroupAndStartFetchingData.
83 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
85 Add a summary page to v3 UI
86 https://bugs.webkit.org/show_bug.cgi?id=156531
88 Reviewed by Stephanie Lewis.
90 Add new "Summary" page, which shows the average difference (better or worse) from the baseline across
91 multiple platforms and tests by a single number.
93 * public/include/manifest.php:
94 (ManifestGenerator::generate): Include "summary" in manifest.json.
95 * public/shared/statistics.js:
96 (Statistics.mean): Added.
97 (Statistics.median): Added.
98 * public/v3/components/ratio-bar-graph.js: Added.
99 (RatioBarGraph): Shows a horizontal bar graph that visualizes the relative difference (e.g. 3% better).
100 (RatioBarGraph.prototype.update):
101 (RatioBarGraph.prototype.render):
102 (RatioBarGraph.cssTemplate):
103 (RatioBarGraph.htmlTemplate):
104 * public/v3/index.html:
106 (main): Instantiate SummaryPage and add it to the navigation bar and the router.
107 * public/v3/models/manifest.js:
108 (Manifest._didFetchManifest): Let "summary" pass through from manifest.json to main().
109 * public/v3/models/measurement-set.js:
110 (MeasurementSet.prototype._failedToFetchJSON): Invoke the callback with an error or true in order for
111 the callback can detect a failure.
112 (MeasurementSet.prototype._invokeCallbacks): Ditto.
113 * public/v3/pages/charts-page.js:
114 (ChartsPage.createStateForConfigurationList): Added to add a hyperlink from summary page to charts page.
115 * public/v3/pages/summary-page.js: Added.
116 (SummaryPage): Added.
117 (SummaryPage.prototype.routeName): Added.
118 (SummaryPage.prototype.open): Added.
119 (SummaryPage.prototype.render): Added.
120 (SummaryPage.prototype._createConfigurationGroupAndStartFetchingData): Added.
121 (SummaryPage.prototype._constructTable): Added.
122 (SummaryPage.prototype._constructRatioGraph): Added.
123 (SummaryPage.htmlTemplate): Added.
124 (SummaryPage.cssTemplate): Added.
125 (SummaryPageConfigurationGroup): Added. Represents a set of platforms and tests shown in a single cell.
126 (SummaryPageConfigurationGroup.prototype.ratio): Added.
127 (SummaryPageConfigurationGroup.prototype.label): Added.
128 (SummaryPageConfigurationGroup.prototype.changeType): Added.
129 (SummaryPageConfigurationGroup.prototype.configurationList): Added.
130 (SummaryPageConfigurationGroup.prototype.fetchAndComputeSummary): Added.
131 (SummaryPageConfigurationGroup.prototype._computeSummary): Added.
132 (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio): Added. Invoked for each time series in
133 the set, and stores the computed ratio of the current values to the baseline in this._setToRatio.
134 The results are aggregated by _computeSummary as a single number later.
135 (SummaryPageConfigurationGroup._medianForTimeRange): Added.
136 (SummaryPageConfigurationGroup._fetchData): A thin wrapper to make MeasurementSet.fetchBetween promise
137 friendly since MeasurementSet doesn't support Promise at the moment (but it should!).
138 * server-tests/api-manifest.js: Updated a test case.
140 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
142 Make sync-buildbot.js fault safe
143 https://bugs.webkit.org/show_bug.cgi?id=156498
145 Reviewed by Chris Dumez.
147 Fixed a bug that sync-buildbot.js will continue to schedule build requests from multiple test groups
148 if multiple test groups are simultaneously in-progress on the same builder. Also fixed a bug that if
149 a build request had failed without leaving a trace (i.e. no entry on any of the builders we know of),
150 sync-buildbot.js throws an exception.
152 * server-tests/tools-buildbot-triggerable-tests.js: Added test cases.
153 * tools/js/buildbot-syncer.js:
154 (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Renamed. Optionally takes the slave name.
155 When this parameter is specified, schedule the request only if the specified slave is available.
156 * tools/js/buildbot-triggerable.js:
157 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Always use
158 scheduleRequestInGroupIfAvailable to schedule a new build request. Using scheduleRequest for non-first
159 build requests was problematic when there were multiple test groups with pending requests because then
160 we would schedule those pending requests without checking whether there is already a pending job or if
161 we have previously scheduled a job. Also fallback to use any syncer / builder when groupInfo.syncer is
162 not set even if the next request was not the first one in the test group since we can't determine on
163 which builder preceding requests are processed in such cases.
164 * unit-tests/buildbot-syncer-tests.js:
166 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
168 Replace script runner to use mocha.js tests
169 https://bugs.webkit.org/show_bug.cgi?id=156490
171 Reviewed by Chris Dumez.
173 Replaced run-tests.js, which was a whole test harness for running legacy tests by tools/run-tests.py
174 which is a thin wrapper around mocha.js.
176 * run-tests.js: Removed.
178 * tools/run-tests.py: Added.
181 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
183 New syncing script sometimes schedules a build request on a wrong builder
184 https://bugs.webkit.org/show_bug.cgi?id=156489
186 Reviewed by Stephanie Lewis.
188 The bug was caused by _scheduleNextRequestInGroupIfSlaveIsAvailable scheduling the next build request on
189 any available syncer regardless of whether the request is the first one in the test group or not because
190 BuildRequest.order was returning a string instead of a number.
192 Also fixed a bug that BuildbotTriggerable.syncOnce was re-ordering test groups by their id's instead of
193 respecting the order in which the perf dashboard returned.
195 * public/v3/models/build-request.js:
196 (BuildRequest.prototype.order): Force the order to be a number.
197 * server-tests/api-build-requests-tests.js: Assert the order as numbers.
198 * server-tests/resources/mock-data.js:
199 (MockData.addAnotherMockTestGroup): Changed the test group id to 601, which is after the first mock data.
200 The old number was masking a bug in BuildbotTriggerable that it was re-ordering test groups by their id's
201 instead of using the order set forth by the perf dashboard.
202 (MockData.mockTestSyncConfigWithSingleBuilder):
203 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for scheduling two build requests in
204 a single call to syncOnce. Each build request should be scheduled on the same builder as the previous build
205 requests in the same test group.
206 * tools/js/buildbot-triggerable.js:
207 (BuildbotTriggerable.prototype.syncOnce): Order test groups by groupOrder, which is the index at which first
208 build request in the group appeared.
209 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Don't re-order build requests
210 as they're already sorted on the server side.
211 (BuildbotTriggerable._testGroupMapForBuildRequests): Added groupOrder to test group info
213 2016-04-09 Ryosuke Niwa <rniwa@webkit.org>
215 Build fix. Don't treat a build number 0 as a pending build.
217 * tools/js/buildbot-syncer.js:
218 (BuildbotBuildEntry.prototype.isPending):
220 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
222 Escape builder names in url* and pathFor* methods of BuildbotSyncer
223 https://bugs.webkit.org/show_bug.cgi?id=156427
225 Reviewed by Darin Adler.
227 The build fix in r199251 breaks other usage of RemoteAPI. Fix it properly by escaping builder names in
228 various methods of BuildbotSyncer.
230 Also fixed a typo in the logging and a bug that the new syncing script never updated "scheduled" to "running".
232 * server-tests/resources/mock-data.js:
233 (MockData.mockTestSyncConfigWithTwoBuilders): Renamed "some-builder-2" to "some builder 2" to test the
234 new escaping behavior in tools-buildbot-triggerable-tests.js and buildbot-syncer-tests.js.
236 * server-tests/tools-buildbot-triggerable-tests.js: Added tests for status url, and added a new test case
237 for updating "scheduled" to "running".
239 * tools/js/buildbot-syncer.js:
240 (BuildbotBuildEntry.buildRequestStatusIfUpdateIsNeeded): Update the status to "running" when the request's
241 status is "scheduled" and the buildbot's build is currently in progress.
242 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Escape the builder name.
243 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto.
244 (BuildbotSyncer.prototype.pathForForceBuild): Ditto.
245 (BuildbotSyncer.prototype.url): Ditto.
246 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
248 * tools/js/buildbot-triggerable.js:
249 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers):
250 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Fixed a typo. We are
251 scheduling new build requests, not syncing them.
252 * tools/js/remote.js:
253 (RemoteAPI.sendHttpRequest): Reverted r199251.
254 * unit-tests/buildbot-syncer-tests.js:
256 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
258 Build fix. We need to escape the path or http.request would fail.
260 * tools/js/remote.js:
262 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
264 Fix various bugs in the new syncing script
265 https://bugs.webkit.org/show_bug.cgi?id=156393
267 Reviewed by Darin Adler.
269 * server-tests/resources/common-operations.js: Added. This file was supposed to be added in r199191.
270 (addBuilderForReport):
272 (connectToDatabaseInEveryTest):
274 * tools/js/buildbot-triggerable.js:
275 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
276 builder as this dramatically increases the amount of log we generate.
277 * tools/js/parse-arguments.js:
278 (parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
279 * tools/js/remote.js:
280 (RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
281 (RemoteAPI.prototype.configure): Added more validations with nice error messages.
282 (RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
283 the right port in configure instead based on the scheme.
284 * tools/sync-buildbot.js:
285 (syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
286 and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
287 properly in Manifest.fetch() because we do need to "forget" about some tests and platforms in some cases.
288 For now, delete all v3 model objects and start over in each syncing cycle.
289 * unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.
291 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
293 sync-buildbot.js doesn't mark disappeared builds as failed
294 https://bugs.webkit.org/show_bug.cgi?id=156386
296 Reviewed by Chris Dumez.
298 Fix a bug that new syncing script doesn't mark builds that it scheduled but doesn't appear when queried
299 by buildbot's JSON API. These are builds that got canceled by humans (e.g. buildbot was restarted, data
300 loss, pending build was canceled, etc...)
302 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case.
303 * tools/js/buildbot-triggerable.js:
304 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added a set of build requests we've matched
305 against BuildbotBuildEntry's. Mark build requests that didn't have any entry but supposed to be in either
306 'scheduled' or 'running' status as failed.
308 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
310 A/B testing bots should prioritize user created test groups
311 https://bugs.webkit.org/show_bug.cgi?id=156375
313 Reviewed by Chris Dumez.
315 Order build requests preferring user created ones over ones automatically created by detect-changes.js.
317 Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new
318 build request on a builder/slave even when we had previously scheduled another build request.
320 * public/include/build-requests-fetcher.php:
321 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on
322 author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js.
323 Since we're using ascending order, this would put user created test groups first.
324 * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case
325 for testing that build requests for an user created test group shows up first.
326 * server-tests/resources/mock-data.js:
327 (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name.
328 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests
329 for an user created test group shows up first.
330 * tools/js/buildbot-syncer.js:
331 (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already
332 scheduled new build requests. Don't schedule more requests on these slaves.
333 (BuildbotSyncer.prototype.scheduleRequest):
334 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null
335 when slaveList is not specified) to _slavesWithNewRequests.
336 (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request
337 we have previously scheduled should be included in one of the entires now.
338 * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug.
339 (sampleiOSConfig): Added a second slave for new test cases.
341 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
343 Migrate legacy perf dashboard tests to mocha.js based tests
344 https://bugs.webkit.org/show_bug.cgi?id=156335
346 Reviewed by Chris Dumez.
348 Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise
349 for most of asynchronous operations, refactored the tests to use Promises as well, and added more
350 assertions where appropriate.
352 Also consolidated common helper functions into server-tests/resources/common-operations.js.
353 Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were
354 taking an array of reports while others were taking a single report. New shared implementation in
355 common-operations.js now takes a single report.
357 Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout.
358 Most of tests are passing under 100ms on my computer so 1s should be plenty still.
360 * run-tests.js: Removed.
361 * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js.
362 (reportsForDifferentPlatforms):
363 * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js.
364 (.addBuilder): Moved to common-operations.js.
365 * server-tests/api-build-requests-tests.js:
366 * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps.
367 * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js.
368 (.queryPlatformAndMetric):
370 * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js.
371 * server-tests/api-report-tests.js: Moved from tests/api-report.js.
374 (.reportWithSameSubtestName):
375 * server-tests/resources/common-operations.js: Added.
376 (addBuilderForReport): Extracted from tests.
377 (addSlaveForReport): Ditto.
378 (connectToDatabaseInEveryTest): Added.
379 (submitReport): Extracted from admin-platforms-tests.js.
380 * server-tests/resources/test-server.js:
381 (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start
382 its own Apache instance (that would certainly will fail).
383 * server-tests/tools-buildbot-triggerable-tests.js:
385 * tools/js/database.js:
386 (Database.prototype.selectAll): Added.
387 (Database.prototype.selectFirstRow): Added.
388 (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments.
390 2016-04-05 Ryosuke Niwa <rniwa@webkit.org>
392 New buildbot syncing scripts that supports multiple builders and slaves
393 https://bugs.webkit.org/show_bug.cgi?id=156269
395 Reviewed by Chris Dumez.
397 Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves.
398 The old python script (sync-with-buildbot.py) could only support a single builder and slave
399 for each platform, test pair.
401 The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added
402 throughout the codebase and tests have been refactored.
404 BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible
405 for syncing everything on each builder (on a buildbot).
407 Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored
408 test helpers and mocks as needed.
410 * public/v3/models/build-request.js:
411 (BuildRequest.prototype.status): Added.
412 (BuildRequest.prototype.isScheduled): Added.
413 * public/v3/models/metric.js:
414 (Metric.prototype.fullName): Added.
415 * public/v3/models/platform.js:
416 (Platform): Added the map based on platform name.
417 (Platform.findByName): Added.
418 * public/v3/models/test.js:
419 (Test.topLevelTests):
420 (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would
421 find the test whose name is "B" which has a parent test named "A".
422 (Test.prototype.fullName): Added.
423 * server-tests/api-build-requests-tests.js:
424 (addMockData): Moved to resources/mock-data.js.
425 (addAnotherMockTestGroup): Ditto.
426 * server-tests/resources/mock-data.js: Added.
427 (MockData.resetV3Models): Added.
428 (MockData.addMockData): Moved from api-build-requests-tests.js.
429 (MockData.addAnotherMockTestGroup): Ditto.
430 (MockData.mockTestSyncConfigWithSingleBuilder): Added.
431 (MockData.mockTestSyncConfigWithTwoBuilders): Added.
432 (MockData.pendingBuild): Added.
433 (MockData.runningBuild): Added.
434 (MockData.finishedBuild): Added.
435 * server-tests/resources/test-server.js:
437 (TestServer.prototype.remoteAPI):
438 (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit.
439 (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever.
440 (TestServer.prototype._waitForPid): Increase the timeout.
441 (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards.
442 * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce.
444 (MockLogger.prototype.log): Added.
445 (MockLogger.prototype.error): Added.
446 * tools/detect-changes.js:
447 (parseArgument): Moved to js/parse-arguments.js.
448 * tools/js/buildbot-syncer.js:
449 (BuildbotBuildEntry):
450 (BuildbotBuildEntry.prototype.syncer): Added.
451 (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status
452 for a build request (of the matching build request ID) if it needs to be updated in the server.
453 (BuildbotSyncer): This class
454 (BuildbotSyncer.prototype.addTestConfiguration): Added.
455 (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations.
456 (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on
458 (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request.
459 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for
460 the specified build request on the first slave that's available.
461 (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object.
462 Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it.
463 (BuildbotSyncer.prototype._pullRecentBuilds):
464 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now
465 only returns the path instead of the full URL since RemoteAPI takes a path, not full URL.
466 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON.
467 (BuildbotSyncer.prototype.pathForForceBuild): Added.
468 (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL.
469 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
470 (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test
471 configurations associated with it, find the one matching for this request.
472 (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it.
473 (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of
474 slave names present on this builder.
475 * tools/js/buildbot-triggerable.js: Added.
476 (BuildbotTriggerable): Added.
477 (BuildbotTriggerable.prototype.name): Added.
478 (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls
479 existing build requests from the perf dashboard, pulls buildbot for pending and running/completed
480 builds on each builder (represented by each syncer), schedules build requests on buildbot if there
481 is any builder/slave available, and updates the status of build requests in the database.
482 (BuildbotTriggerable.prototype._validateRequests): Added.
483 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added.
484 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added.
485 (BuildbotTriggerable._testGroupMapForBuildRequests): Added.
486 * tools/js/database.js:
487 * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js.
489 * tools/js/remote.js:
490 (RemoteAPI): Now optionally takes the server configuration.
491 (RemoteAPI.prototype.url): Added.
492 (RemoteAPI.prototype.getJSON): Removed the code for specifying request content.
493 (RemoteAPI.prototype.getJSONWithStatus): Ditto.
494 (RemoteAPI.prototype.postJSON): Added.
495 (RemoteAPI.prototype.postFormUrlencodedData): Added.
496 (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth.
497 * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host.
498 * tools/sync-buildbot.js: Added.
499 (main): Added. Parse the arguments and start the loop.
501 * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as
502 scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed.
504 (smallConfiguration): Added.
505 (smallPendingBuild): Added.
506 (smallInProgressBuild): Added.
507 (smallFinishedBuild): Added.
508 (createSampleBuildRequest): Create a unique build request for each platform.
509 (samplePendingBuild): Optionally specify build time and slave name.
510 (sampleInProgressBuild): Optionally specify slave name.
511 (sampleFinishedBuild): Ditto.
512 * unit-tests/resources/mock-remote-api.js:
513 (assert.notReached.assert.notReached):
514 (MockRemoteAPI.url): Added.
515 (MockRemoteAPI.postFormUrlencodedData): Added.
516 (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus.
517 (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we
518 need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI.
519 (MockRemoteAPI.inject):
520 (MockRemoteAPI.reset): Added.
522 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
524 Simplify API of Test model by removing Test.setParentTest
525 https://bugs.webkit.org/show_bug.cgi?id=156055
527 Reviewed by Joseph Pecoraro.
529 Removed Test.setParentTest. Keep track of the child-parent relationship using the static map instead.
531 Now each test only stores parent's id and uses the ID static map in Test.parentTest().
533 * public/v3/models/manifest.js:
534 (Manifest._didFetchManifest.buildObjectsFromIdMap): Removed the code to create the map of child-parent
535 relationship and call setParentTest.
536 * public/v3/models/test.js:
537 (Test): Updated a static map by the name of "childTestMap" to store itself. We should probably sort
538 child tests using some fixed criteria in the future instead of relying on the creation order but
539 preserve the old code's ordering for now.
540 (Test.prototype.parentTest): Look up the static map by the parent test's id.
541 (Test.prototype.onlyContainsSingleMetric):
542 (Test.prototype.setParentTest): Deleted.
543 (Test.prototype.childTests): Look up the child test map.
545 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
547 BuildRequest should have associated platform and test
548 https://bugs.webkit.org/show_bug.cgi?id=156054
550 Reviewed by Joseph Pecoraro.
552 Added methods to retrieve the platform and the test associated with a build request with tests.
554 * public/v3/models/build-request.js:
556 (BuildRequest.prototype.platform): Added.
557 (BuildRequest.prototype.test): Added.
558 * server-tests/api-build-requests-tests.js:
559 * server-tests/api-manifest.js: Fixed a typo. This tests /api/manifest, not /api/build-requests.
560 * unit-tests/buildbot-syncer-tests.js:
561 (.createSampleBuildRequest): Now takes Platform and Test objects to avoid hitting assertions in
562 BuildRequest's constructor.
564 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
566 BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
567 https://bugs.webkit.org/show_bug.cgi?id=156008
569 Reviewed by Darin Adler.
571 Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.
573 Now, new syncing scripts must be able to figure out the build slave the first build requests in
574 a given test group had used in order to schedule subsequent build requests in the test group.
576 For this purpose, /api/build-requests has been modified to return all build requests whose test
577 group had not finished yet. A test group is finished if all build requests in the test group had
578 finished (completed, failed, or canceled).
580 * public/include/build-requests-fetcher.php:
581 (BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
582 groups that have not been finished.
583 * public/v3/models/build-request.js:
585 (BuildRequest.prototype.testGroupId): Added.
586 (BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
587 (BuildRequest.fetchForTriggerable): Added.
588 (BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
590 * public/v3/models/manifest.js:
591 (Manifest.fetch): Use the full path from root so that it works in server tests.
592 * public/v3/models/test-group.js:
593 (TestGroup.hasPending):
594 (TestGroup._createModelsFromFetchedTestGroups):
595 * server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
596 is present in the response returned by /api/build-requests iff any build request in the group had not
599 (.addAnotherMockTestGroup): Added.
600 * unit-tests/test-groups-tests.js:
602 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
604 Make dependency injection in unit tests more explicit
605 https://bugs.webkit.org/show_bug.cgi?id=156006
607 Reviewed by Joseph Pecoraro.
609 Make the dependency injection of model objects in unit tests explicit so that server tests that create
610 "real" model objects won't create these mock objects. Now each test that uses mock model objects would call
611 MockModels.inject() to inject before / beforeEach and access each object using a property on MockModels
612 instead of them being implicitly defined on the global object.
614 Similarly, MockRemoteAPI now only replaces global.RemoteAPI during each test so that server tests can use
615 real RemoteAPI to access the test Apache server.
617 * unit-tests/analysis-task-tests.js:
618 * unit-tests/buildbot-syncer-tests.js:
619 (createSampleBuildRequest):
620 * unit-tests/measurement-adaptor-tests.js:
621 * unit-tests/measurement-set-tests.js:
622 * unit-tests/resources/mock-remote-api.js:
623 (MockRemoteAPI.getJSONWithStatus):
624 (MockRemoteAPI.inject): Added. Override RemoteAPI on the global object during each test.
625 * unit-tests/resources/mock-v3-models.js:
626 (MockModels.inject): Added. Create mock model objects before each test, and clear all static maps of
627 various v3 model classes (to remove all singleton objects for those model classes).
628 * unit-tests/test-groups-tests.js:
630 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
632 BuildbotSyncer should be able to fetch JSON from buildbot
633 https://bugs.webkit.org/show_bug.cgi?id=155921
635 Reviewed by Joseph Pecoraro.
637 Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot
638 with lots of unit tests as this has historically been a source of subtle bugs in the old script.
640 New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that
641 the state of some builds may change between each HTTP request. In the old script, we fetched the list
642 of the pending builds, and requested -1, -2, etc... builds for N times. But between each request,
643 a pending build may start running or an in-progress build finish and shift the offset by one. The new
644 script avoids this problem by first requesting all pending builds, then all in-progress and finished
645 builds in a single HTTP request. The results are then merged so that entries for in-progress and
646 finished builds would override the entries for pending builds if they overlap.
648 Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes
649 the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js).
651 * server-tests/api-build-requests-tests.js:
652 * server-tests/api-manifest.js:
653 * tools/js/buildbot-syncer.js:
654 (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as
655 we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished
656 builds as 'currentStep' is always defined but null in those builds.
657 (BuildbotBuildEntry.prototype.buildNumber): Added.
658 (BuildbotBuildEntry.prototype.isPending): Added.
659 (BuildbotBuildEntry.prototype.hasFinished): Added.
660 (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds.
661 (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds.
662 (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added.
663 (BuildbotSyncer.prototype.urlForBuildJSON): Added.
664 (BuildbotSyncer.prototype.url): Added.
665 (BuildbotSyncer.prototype.urlForBuildNumber): Added.
666 * tools/js/remote.js:
667 (RemoteAPI.prototype.getJSON): Renamed from fetchJSON.
668 (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus.
669 * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node.
670 * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot
671 (samplePendingBuild):
672 (sampleInProgressBuild): Added.
673 (sampleFinishedBuild): Added.
674 * unit-tests/resources/mock-remote-api.js:
675 (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus.
677 2016-03-24 Ryosuke Niwa <rniwa@webkit.org>
679 Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
680 https://bugs.webkit.org/show_bug.cgi?id=155863
682 Reviewed by Joseph Pecoraro.
684 Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability
685 added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed
686 /admin/regenerate-manifest since it has been superseded by /api/manifest.
688 This patch also extracts manifest.js out of main.js so that it could be used and tested without the
691 * public/admin/regenerate-manifest.php: Deleted.
692 * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with
693 a trailing backslash.
694 * public/include/manifest.php:
695 (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories.
696 * public/v3/index.html:
699 * public/v3/models/bug-tracker.js:
700 (BugTracker.prototype.newBugUrl): Added.
701 (BugTracker.prototype.repositories): Added.
702 * public/v3/models/manifest.js: Added. Extracted from main.js.
703 (Manifest.fetch): Moved from main.js' fetchManifest.
704 (Manifest._didFetchManifest): Moved from main.js' didFetchManifest.
705 * public/v3/models/platform.js:
706 (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of
707 the same name. This is tested by the newly added test cases.
708 * server-tests/api-build-requests-tests.js:
709 * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js
710 with additional assertions for v3 UI model objects.
711 * server-tests/resources/test-server.js:
712 (TestServer.prototype.start):
713 (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API.
714 Also no longer takes dataDirectory as an argument since it's always the same.
715 (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data.
716 (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests.
717 (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an
718 unintended side effect of slowing down unit tests even through they don't need Postgres or Apache.
719 * tests/admin-regenerate-manifest.js: Removed.
720 * tools/js/database.js:
721 * tools/js/v3-models.js:
723 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
725 Add mocha server tests for /api/build-requests
726 https://bugs.webkit.org/show_bug.cgi?id=155831
728 Reviewed by Chris Dumez.
730 Added the new mocha.js based server-tests for /api/build-requests. The new harness automatically:
731 - starts a new Apache instance
732 - switches the database during testing via setting an environmental variable
733 - backups and restores public/data directory during testing
735 As a result, developer no longer has to manually setup Apache, edit config.json manually to use
736 a testing database, or run /api/manifest.php to re-generate the manifest file after testing.
738 This patch also makes ID resolution optional on /api/build-requests so that v3 model based syncing
739 scripts can re-use the same code as the v3 UI to process the JSON. tools/sync-with-buildbot.py has
740 been modified to use this option (useLegacyIdResolution).
742 * config.json: Added configurations for the test httpd server.
743 * init-database.sql: Don't error when tables and types don't exist (when database is empty).
744 * public/api/build-requests.php:
745 (main): Made the ID resolution optional with useLegacyIdResolution. Also removed "updates" from the
746 results JSON since it's never used.
747 * public/include/build-requests-fetcher.php:
748 (BuildRequestsFetcher::__construct):
749 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Fixed the bug that we would include the same
750 commit multiple times for each root set.
751 * public/include/db.php:
752 (config): If present, use ORG_WEBKIT_PERF_CONFIG_PATH instead of Websites/perf.webkit.org/config.json.
753 * server-tests: Added.
754 * server-tests/api-build-requests-tests.js: Added. Tests for /api/build-requests.
756 * server-tests/resources: Added.
757 * server-tests/resources/test-server.conf: Added. Apache configuration file for testing.
758 * server-tests/resources/test-server.js: Added.
760 (TestSever.prototype.start): Added.
761 (TestSever.prototype.stop): Added.
762 (TestSever.prototype.remoteAPI): Added. Configures RemoteAPI to be used with the test sever.
763 (TestSever.prototype.database): Added. Returns Database configured to use the test database.
764 (TestSever.prototype._constructTestConfig): Creates config.json for testing. The file is generated by
765 _start and db.php's config() reads it from the environmental variable: ORG_WEBKIT_PERF_CONFIG_PATH.
766 (TestSever.prototype._ensureDataDirectory): Renames public/data to public/original-data if exists,
767 and creates a new empty public/data.
768 (TestSever.prototype._restoreDataDirectory): Deletes public/data and renames public/original-data
770 (TestSever.prototype._ensureTestDatabase): Drops the test database if exists and creates a new one.
771 (TestSever.prototype.initDatabase): Run init-database.sql to start each test with a consistent state.
772 (TestSever.prototype._executePgsqlCommand): Executes a postgres command line tool such as psql.
773 (TestSever.prototype._determinePgsqlDirectory): Finds the directory that contains psql.
774 (TestSever.prototype._startApache): Starts an Apache instance for testing.
775 (TestSever.prototype._stopApache): Stops the Apache instance for testing.
776 (TestSever.prototype._waitForPid): Waits for the Apache pid file to appear or disappear.
777 (before): Start the test server at the beginning.
778 (beforeEach): Re-initialize all tables before each test.
779 (after): Stop the test server at the end.
780 * tools/js/config.js:
781 (Config.prototype.path):
782 (Config.prototype.serverRoot): Added. The path to Websites/perf.webkit.org/public/.
783 (Config.prototype.pathFromRoot): Added. Resolves a path from Websites/perf.webkit.org.
784 * tools/js/database.js:
785 (Database): Now optionally takes the database name to use a different database during testing.
786 (Database.prototype.connect):
787 (Database.prototype.query): Added.
788 (Database.prototype.insert): Added.
789 (tableToPrefixMap): Maps table name to its prefix. Used by Database.insert.
790 * tools/js/remote.js: Added.
791 (RemoteAPI): Added. This is node.js equivalent of RemoteAPI in public/v3/remote.js.
792 (RemoteAPI.prototype.configure): Added.
793 (RemoteAPI.prototype.fetchJSON): Added.
794 (RemoteAPI.prototype.fetchJSONWithStatus): Added.
795 (RemoteAPI.prototype.sendHttpRequest): Added.
796 * tools/sync-with-buildbot.py:
797 (main): Use useLegacyIdResolution as this script relies on the legacy behavior.
798 * unit-tests/checkconfig.js: pg was never directly used in this test.
800 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
802 Delete a file that was supposed to be removed in r198614 for real.
804 * unit-tests/resources/v3-models.js: Removed.
806 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
808 Add a model for parsing buildbot JSON with unit tests
809 https://bugs.webkit.org/show_bug.cgi?id=155814
811 Reviewed by Joseph Pecoraro.
813 Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests.
814 They will be used in the new syncing scripts to improve A/B testing.
816 * public/v3/models/build-request.js:
818 * tools/js/buildbot-syncer.js: Added.
819 (BuildbotBuildEntry): Added.
820 (BuildbotBuildEntry.prototype.slaveName): Added.
821 (BuildbotBuildEntry.prototype.buildRequestId): Added.
822 (BuildbotBuildEntry.prototype.isInProgress): Added.
823 (BuildbotSyncer): Added.
824 (BuildbotSyncer.prototype.testPath): Added.
825 (BuildbotSyncer.prototype.builderName): Added.
826 (BuildbotSyncer.prototype.platformName): Added.
827 (BuildbotSyncer.prototype.fetchPendingRequests): Added.
828 (BuildbotSyncer.prototype._propertiesForBuildRequest): Added.
829 (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added.
830 (BuildbotSyncer._loadConfig): Added.
831 (BuildbotSyncer._validateAndMergeConfig): Added.
832 (BuildbotSyncer._validateAndMergeProperties): Added.
833 * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js.
834 (beforeEach): Deleted since this only defined inside mocha.
835 * unit-tests/analysis-task-tests.js:
836 * unit-tests/buildbot-syncer-tests.js: Added.
838 (createSampleBuildRequest):
839 (.smallConfiguration):
840 * unit-tests/measurement-adaptor-tests.js:
841 * unit-tests/measurement-set-tests.js:
842 * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js.
844 * unit-tests/test-groups-tests.js:
847 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
849 Add unit tests for test-group.js
850 https://bugs.webkit.org/show_bug.cgi?id=155781
852 Reviewed by Joseph Pecoraro.
854 Added unit tests for test-group.js that would have caught regressions fixed in r198503.
856 * public/v3/components/chart-pane-base.js:
857 (ChartPaneBase.prototype._renderAnnotations): Added a forgotten break statement.
858 * public/v3/models/build-request.js:
859 (BuildRequest.prototype.setResult):
861 * public/v3/models/test-group.js:
862 * unit-tests/measurement-set-tests.js: Use ./resources/v3-models.js to reduce the code duplication.
863 * unit-tests/resources/v3-models.js: Import more stuff from v3 models.
865 * unit-tests/test-groups-tests.js: Added. Added some unit tests for TestGroup.
867 (.testGroupWithStatusList):
869 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
875 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
877 Commit log viewer repaints too frequently after r198499
878 https://bugs.webkit.org/show_bug.cgi?id=155732
880 Reviewed by Joseph Pecoraro.
882 The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
883 if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
884 and avoiding work in the commit log viewer when the requested repository and the revision range were
885 the same as those of the last request.
887 * public/v3/components/commit-log-viewer.js:
889 (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
890 identical to the one we already have to avoid repaints and issuing multiple network requests.
891 * public/v3/components/interactive-time-series-chart.js:
892 (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
893 indicator hadn't changed.
894 * public/v3/pages/chart-pane.js:
895 (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
896 the URL. We need to check whether the lock state had changed. The old condition was also redundant
897 since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
899 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
901 Fix A/B testing after r198503.
903 * public/include/build-requests-fetcher.php:
905 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
907 Analysis task page is broken after r198479
908 https://bugs.webkit.org/show_bug.cgi?id=155735
910 Rubber-stamped by Chris Dumez.
912 * public/api/measurement-set.php:
913 (AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
914 * public/include/build-requests-fetcher.php:
915 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
916 * public/v3/models/commit-log.js:
917 (CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
918 * public/v3/models/root-set.js:
919 (RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
920 we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
921 find the repository with "[object]" as the ID.
922 * public/v3/models/test-group.js:
923 (TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.
925 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
927 v3 UI sometimes don't update the list of revisions on the commit log viewer
928 https://bugs.webkit.org/show_bug.cgi?id=155729
930 Rubber-stamped by Chris Dumez.
932 Fixed multiple bugs that were affecting the list of blame range and commit logs for the range weren't
933 updated in some cases on v3 UI. Also, the commit log viewer state is now a part of the URL state so
934 opening and closing the commit log viewer will persist across page loads.
936 Also fixed a regression from r198479 that Test object can't be created for a top level test.
938 * public/v3/components/chart-pane-base.js:
939 (ChartPaneBase.prototype.configure):
940 (ChartPaneBase.prototype._mainSelectionDidChange): Fixed the bug that the list of blame range nor the
941 commit log viewer don't get updated when the selected range changes.
942 (ChartPaneBase.prototype._indicatorDidChange):
943 (ChartPaneBase.prototype._didFetchData):
944 (ChartPaneBase.prototype._updateStatus): Extracted from _indicatorDidChange and _didFetchData.
945 (ChartPaneBase.prototype._requestOpeningCommitViewer): Renamed from _openCommitViewer.
947 * public/v3/components/chart-status-view.js:
948 (ChartStatusView.prototype.updateStatusIfNeeded): Fixed the bug that the blame range doesn't get set
949 on the initial page load when the selection range is set but the chart data hadn't been fetched yet.
951 * public/v3/components/commit-log-viewer.js:
952 (CommitLogViewer.prototype.view): Fixed the bug that we don't clear out the old list of commits while
953 loading the next set of commits to show as it looked as if the list was never updated.
954 (CommitLogViewer.prototype.render): Fixed the bug that the view always show the last repository name
955 even if there were nothing being fetched or commits to show.
957 * public/v3/components/pane-selector.js:
958 (PaneSelector.prototype.focus): Removed superfluous call to console.log.
960 * public/v3/models/data-model.js:
961 (DataModelObject.listForStaticMap): Generalized the code for all to fix the bug in Test.
962 (DataModelObject.all):
964 * public/v3/models/test.js:
965 (Test): Fixed the bug that this code was relying on the static map to be an array.
966 (Test.topLevelTests): Use newly added listForStaticMap to convert the dictionary to an array.
968 * public/v3/pages/chart-pane-status-view.js:
969 (ChartPaneStatusView): Always initialize _usedRevisionRange as a triple to simplify code elsewhere.
970 (ChartPaneStatusView.prototype.render): Invoke _revisionCallback when user clicks on a repository
971 expansion mark (>>). Also fixed click handler from the row since this made selecting revision range
972 on the view cumbersome. Now user has to explicitly click on the expansion mark (>>).
973 (ChartPaneStatusView.prototype._setRevisionRange): Now takes shouldNotify, from, and to as arguments
974 as this function must not invoke_revisionCallback inside _updateRevisionListForNewCurrentRepository.
975 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Use newly added setCurrentRepository
976 instead of manually invoking setCurrentRepository and updateRevisionListWithNotification.
977 (ChartPaneStatusView.prototype.setCurrentRepository): Fixed the bug that we weren't updating the
979 (ChartPaneStatusView.prototype.updateRevisionList): Renamed from updateRevisionListWithNotification
980 since we no longer call _revisionCallback. In general, callbacks are only meant to communicate user
981 initiated actions, and not program induced updates like this API so this was a bad pattern anyway.
982 ChartPane now explicitly updates the commit log viewer instead of relying on this function calling
983 _requestOpeningCommitViewer implicitly.
984 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Extracted from
985 updateRevisionListWithNotification so that setCurrentRepository can also call this function.
987 * public/v3/pages/chart-pane.js:
988 (ChartPane.prototype._requestOpeningCommitViewer): Overrides ChartPaneBase's method. Open the same
989 repository in other panes via ChartsPage.setOpenRepository.
990 (ChartPane.prototype.setOpenRepository): This method is called when the user selected a repository in
991 another pane. Open the same repository in this pane if it wasn't already open.
993 * public/v3/pages/charts-page.js:
994 (ChartsPage): Added this._currentRepositoryId.
995 (ChartsPage.prototype.serializeState): Serialize _currentRepositoryId.
996 (ChartsPage.prototype.updateFromSerializedState): Set the commit log viewer's
997 (ChartsPage.prototype.setOpenRepository): Added.
999 * tests/api-measurement-set.js: Fixed a test after r198479.
1001 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
1003 V3 Perf Dashboard should automatically select initial range when creating a new task
1004 https://bugs.webkit.org/show_bug.cgi?id=155677
1006 Reviewed by Joseph Pecoraro.
1008 Select the entire range of points for which the analysis task is created by default so that creating
1009 a test group to confirm the regression / progression is easy.
1011 * public/v3/pages/analysis-task-page.js:
1012 (AnalysisTaskPage): Added a boolean flag which indicates the user had modified main chart's selection.
1013 * public/v3/pages/analysis-task-page.js:
1014 (AnalysisTaskPage.prototype.render): Set the main chart's selection to the entire range of points in
1015 the analysis task if the user had never modified selection.
1016 (AnalysisTaskPage.prototype._chartSelectionDidChange): This callback is invoked only when the user had
1017 modified the selection so set _selectionWasModifiedByUser true here unconditionally.
1019 2016-03-19 Ryosuke Niwa <rniwa@webkit.org>
1021 Associated commits don't immediately show up on an analysis task page
1022 https://bugs.webkit.org/show_bug.cgi?id=155692
1024 Reviewed by Darin Adler.
1026 The bug was caused by resolveCommits in AnalysisTask._constructAnalysisTasksFromRawData not being
1027 able to find the matching commit log if the commit log had been created by the charts which don't
1028 set the remote identifiers on each CommitLog objects.
1030 Fixed the bug by modifying /api/measurement-set to include the commit ID, and making CommitLog
1031 use the real database ID as its ID instead of a fake ID we create from repository and revision.
1033 Also added a bunch of Mocha unit tests for AnalysisTask.fetchAll.
1035 * public/api/measurement-set.php:
1036 (MeasurementSetFetcher::execute_query): Fetch commit_id.
1037 (MeasurementSetFetcher::format_run): Use pass-by-reference to avoid making a copy of the row.
1038 (MeasurementSetFetcher::parse_revisions_array): Include commit_id as the first item in the result.
1039 * public/v3/instrumentation.js:
1040 * public/v3/models/analysis-task.js:
1041 (AnalysisTask): Fixed a bug that _buildRequestCount and _finishedBuildRequestCount could be kept
1042 as strings and hasPendingRequests() could return a wrong result because it would perform string
1043 inequality instead of numerical inequality.
1044 (AnalysisTask.prototype.updateSingleton): Ditto.
1045 (AnalysisTask.prototype.dissociateCommit):
1046 (AnalysisTask._constructAnalysisTasksFromRawData):
1047 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Use findById now that CommitLog
1048 objects all use the same id as the database id.
1049 * public/v3/models/commit-log.js:
1051 (CommitLog.prototype.remoteId): Deleted since we no longer create a fake id for commit logs for
1053 (CommitLog.findByRemoteId): Deleted.
1054 (CommitLog.ensureSingleton): Deleted.
1055 (CommitLog.fetchBetweenRevisions):
1057 * public/v3/models/data-model.js:
1058 (DataModelObject.clearStaticMap): Added to aid unit testing.
1059 (DataModelObject.ensureNamedStaticMap): Fixed a typo. Each map is a dictionary, not an array.
1060 * public/v3/models/metric.js:
1061 * public/v3/models/platform.js:
1062 * public/v3/models/root-set.js:
1063 (RootSet): Updated per the interface change in CommitLog.ensureSingleton.
1064 (MeasurementRootSet): Updated per /api/measurement-set change. Use the first value as the id.
1065 * public/v3/models/test.js:
1066 * unit-tests/analysis-task-tests.js: Added.
1067 (sampleAnalysisTask):
1068 (measurementCluster):
1069 * unit-tests/checkconfig.js: Added some assertion message to help aid diagnosing the failure.
1070 * unit-tests/measurement-adaptor-tests.js: Updated the sample data per the API change in
1071 /api/measurement-set and also added assertions for commit log ids.
1072 * unit-tests/measurement-set-tests.js:
1074 * unit-tests/resources: Added.
1075 * unit-tests/resources/mock-remote-api.js: Added. Extracted from measurement-set-tests.js to be
1076 used in analysis-task-tests.js.
1077 (assert.notReached.assert.notReached):
1078 (global.RemoteAPI.getJSON):
1079 (global.RemoteAPI.getJSONWithStatus):
1081 * unit-tests/resources/v3-models.js: Added. Extracted from measurement-set-tests.js to be used in
1082 analysis-task-tests.js and added more imports as needed.
1086 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1088 Build fix after r198464.
1090 * public/v3/components/analysis-results-viewer.js:
1091 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
1093 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1095 Build fix after r198234.
1097 * public/api/commits.php:
1098 (main): Typo: fetch_latest_reported -> fetch_last_reported.
1099 * public/include/commit-log-fetcher.php:
1100 (CommitLogFetcher::format_single_commit): commits should be an array.
1102 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1104 Perf Dashboard v3 confuses better and worse on A/B task page
1105 https://bugs.webkit.org/show_bug.cgi?id=155675
1106 <rdar://problem/25208723>
1108 Reviewed by Joseph Pecoraro.
1110 The analysis results viewer on v3 UI sometimes treats regressions as progressions and vice versa when
1111 the first set (i.e. set A) of the revisions used in an A/B testing never appears in the original graph,
1112 and its latest commit time matches that of the second set, which appears in the original graph.
1114 Because the analysis results viewer compares results in the increasing row number, this results in
1115 B to be compared to A instead of A to be compared to B. Fixed the bug by preventing the wrong ordering
1116 to occur in _buildRowsForPointsAndTestGroups by always inserting a root set A before B when B appears
1117 and A doesn't appear in the original graph.
1119 * public/v3/components/analysis-results-viewer.js:
1120 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Remember the succeeding root set B
1121 when creating an entry for root set A.
1122 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Fixed the bug. Also un-duplicated
1123 the code to create a new row.
1124 (AnalysisResultsViewer.RootSetInTestGroup): Now takes a succeeding root set. e.g. it's B for A and
1125 undefined for B in A/B testing.
1126 (AnalysisResultsViewer.RootSetInTestGroup.prototype.succeedingRootSet): Added.
1127 * public/v3/components/time-series-chart.js:
1128 (TimeSeriesChart.computeTimeGrid): Fixed the bug that we would end up showing 0 AM instead of dates
1129 when both dates and months change.
1131 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1133 Add unit tests for measurement-set.js and measurement-adapter.js
1134 https://bugs.webkit.org/show_bug.cgi?id=155673
1136 Reviewed by Daniel Bates.
1138 Add tests which were supposed to be added in r198462.
1140 * unit-tests/measurement-adaptor-tests.js: Added.
1141 * unit-tests/measurement-set-tests.js: Added.
1142 (assert.notReached): Added.
1143 (global.RemoteAPI.getJSON): Added.
1144 (global.RemoteAPI.getJSONWithStatus): Added. A mock.
1146 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1148 Add unit tests for measurement-set.js and measurement-adapter.js
1149 https://bugs.webkit.org/show_bug.cgi?id=155673
1151 Reviewed by Darin Adler.
1153 Added mocha unit tests for MeasurementSet and MeasurementAdapter classes along with the necessary
1154 refactoring to run these tests in node.
1156 getJSON and getJSONStatus are now under RemoteAPI so that unit tests can mock them.
1158 Removed the dependency on v2 UI's TimeSeries and Measurement class by adding a new implementation
1159 of TimeSeries in v3 and removing the dependency on Measurement in chart-pane-status-view.js with
1160 new helper methods on Build and CommitLog.
1162 Many js files now use 'use strict' (node doesn't support class syntax in non-strict mode) and
1163 module.exports to export symbols in node's require function.
1165 * public/v3/index.html:
1166 * public/v3/main.js:
1167 * public/v3/models/analysis-results.js:
1168 (AnalysisResults.fetch):
1169 * public/v3/models/analysis-task.js:
1170 (AnalysisTask.fetchAll):
1171 * public/v3/models/builder.js:
1173 (Build.prototype.builder): Added. Used by ChartPaneStatusView.
1174 (Build.prototype.buildNumber): Ditto.
1175 (Build.prototype.buildTime): Ditto.
1176 * public/v3/models/commit-log.js:
1177 (CommitLog.prototype.diff): Ditto.
1178 (CommitLog.fetchBetweenRevisions):
1179 * public/v3/models/data-model.js:
1180 (DataModelObject.cachedFetch):
1181 * public/v3/models/measurement-adaptor.js:
1182 (MeasurementAdaptor.prototype.applyToAnalysisResults): Renamed from adoptToAnalysisResults.
1183 (MeasurementAdaptor.prototype.applyTo): Renamed from adoptToSeries. Now shares a lot more
1184 code with applyToAnalysisResults. The code to set 'series' and 'seriesIndex' has been moved
1185 to TimeSeries.append. 'measurement' is no longer needed as this patch removes its only use
1186 in ChartPaneStatusView.
1187 * public/v3/models/measurement-cluster.js:
1188 (MeasurementCluster.prototype.addToSeries): Use TimeSeries.append instead of directly mutating
1190 * public/v3/models/measurement-set.js:
1191 (Array.prototype.includes): Added a polyfill for node.
1192 (MeasurementSet.prototype._fetchSecondaryClusters): Removed a bogus assertion. When fetchBetween
1193 is called with a mixture of clusters that have been fetched and not fetched, this assertion fails.
1194 (MeasurementSet.prototype._fetch):
1195 (TimeSeries.prototype.findById): Moved to time-series.js.
1196 (TimeSeries.prototype.dataBetweenPoints): Ditto.
1197 (TimeSeries.prototype.firstPoint): Ditto.
1198 (TimeSeries.prototype.fetchedTimeSeries): Moved the code to extend the last point to TimeSeries'
1200 * public/v3/models/repository.js:
1201 * public/v3/models/root-set.js:
1202 (MeasurementRootSet): Ignore repositories that had not been defined (e.g. it could be added after
1203 manifest.json had been downloaded but before a given root set is created for an A/B testing).
1204 * public/v3/models/time-series.js:
1205 (TimeSeries): Added.
1206 (TimeSeries.prototype.append): Added.
1207 (TimeSeries.prototype.extendToFuture): Added.
1208 (TimeSeries.prototype.firstPoint): Moved from measurement-set.js.
1209 (TimeSeries.prototype.lastPoint): Added.
1210 (TimeSeries.prototype.previousPoint): Added.
1211 (TimeSeries.prototype.nextPoint): Added.
1212 (TimeSeries.prototype.findPointByIndex): Added.
1213 (TimeSeries.prototype.findById): Moved from measurement-set.js.
1214 (TimeSeries.prototype.findPointAfterTime): Added.
1215 (TimeSeries.prototype.dataBetweenPoints): Moved from measurement-set.js.
1216 * public/v3/pages/chart-pane-status-view.js:
1217 (ChartPaneStatusView.prototype.render): Use newly added helper functions on Build.
1218 (ChartPaneStatusView.prototype._formatTime): Added.
1219 (ChartPaneStatusView.prototype.setCurrentRepository):
1220 (ChartPaneStatusView.prototype.computeChartStatusLabels): Rewrote the code using RootSet object on
1221 currentPoint and previousPoint instead of Measurement class from v2 UI. Also sort the results using
1222 sortByNamePreferringOnesWithURL.
1223 * public/v3/remote.js:
1224 (RemoteAPI.getJSON): Moved under RemoteAPI.
1225 (RemoteAPI.getJSONWithStatus): Ditto.
1227 (PrivilegedAPI.requestCSRFToken):
1229 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1231 Add unit tests for config.json and statistics.js
1232 https://bugs.webkit.org/show_bug.cgi?id=155626
1234 Reviewed by Darin Adler.
1236 Added mocha unit tests for statistics.js and validating config.json. For segmentations, I've extracted
1237 real data from our internal perf dashboard.
1239 Also fixed some bugs covered by these new tests.
1241 * public/shared/statistics.js:
1242 (Statistics.movingAverage): Fixed a bug that forwardWindowSize was never used.
1243 (Statistics.exponentialMovingAverage): Fixed the bug that the moving average starts at 0. It should
1244 start at the first value instead.
1245 (.splitIntoSegmentsUntilGoodEnough): Fixed the bug that we may try to segment a time series into
1246 more parts than there are data points. Clearly, that doesn't make any sense.
1247 (.findOptimalSegmentation): Renamed local variables so that they're more descriptive, and rewrote
1248 the debugging code was the old code was emitting some useless data. Also fixed the bug that the length
1249 of "segmentation" was off by one (we need segmentCount + 1 elements in the array sine we always
1250 include the start of the first segment = 0 and the end of the last segment = values.length).
1251 (.SampleVarianceUpperTriangularMatrix):
1252 (Statistics): Modernized the export code.
1254 * tools/js/config.js: Added.
1256 (Config.prototype.configFilePath): Added.
1257 (Config.prototype.value): Added.
1258 (Config.prototype.path): Added.
1259 * tools/js/database.js: Added.
1261 (Database.prototype.connect): Added.
1262 (Database.prototype.disconnect): Added.
1263 * unit-tests: Added.
1264 * unit-tests/checkconfig.js: Added. Validates config.json. This is useful while setting up
1265 a local instance of the perf dashboard.
1266 * unit-tests/statistics-tests.js: Added.
1267 (assert.almostEqual): Added. Asserts that two floating values are within a given significant digits.
1272 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1274 Fix a typo which was supposed to be fixed in r198351.
1276 * public/v3/pages/analysis-task-page.js:
1277 (AnalysisTaskPage.prototype.render):
1279 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1281 An analysis task should be closed if a progression cause is identified
1282 https://bugs.webkit.org/show_bug.cgi?id=155549
1284 Reviewed by Chris Dumez.
1286 Since a progression is desirable, we should close an analysis task once its cause is identified.
1288 Also fix some typos.
1290 * init-database.sql: Fixed a typo.
1291 * public/api/analysis-tasks.php:
1292 * public/v3/models/analysis-task.js:
1293 (AnalysisTask.prototype.dissociateBug): Renamed from dissociateBug.
1294 * public/v3/pages/analysis-task-page.js:
1295 (AnalysisTaskPage.prototype.render):
1296 (AnalysisTaskPage.prototype._dissociateBug): Renamed from _dissociateBug.
1297 (AnalysisTaskPage.prototype._dissociateCommit): Fixed the typo in the alert.
1299 2016-03-16 Ryosuke Niwa <rniwa@webkit.org>
1301 Analysis task page should allow specifying commits that caused or fixed a regression or a progression
1302 https://bugs.webkit.org/show_bug.cgi?id=155529
1304 Reviewed by Chris Dumez.
1306 Added the capability to associate revisions that caused or fixed a progression or a regression for which
1307 an analysis task was created. Added task_commits that stores this relationship and added the backend
1308 support to retrieve this table in /api/analysis-tasks and an privileged API to update this table at
1309 /privileged-api/associate-commit.
1311 Also extracted a new component, MutableListView, out of AnalysisTaskPage to render and manipulate a list
1312 of mutable items, and used it to render the list of associated bugs and commits. The view takes a list of
1313 kinds (e.g. repositories or bug trackers), and accepts a pair of a kind and arbitrary text as a new item
1316 * init-database.sql: Added task_commits table.
1318 * public/api/analysis-tasks.php:
1320 (fetch_associated_data_for_tasks): Renamed from fetch_and_push_bugs_to_tasks now that it also fetches
1321 the list of commits associated with each analysis task by calling CommitLogFetcher::fetch_for_tasks.
1322 Also fixe the bug that we were not taking
1323 (format_task): No longer sets 'category' since the computation of category now depends on the list of
1324 commits associated with this analysis task which aren't available until fetch_associated_data_for_tasks.
1325 (determine_category): Added. Categorize any analysis tasks with "fixes" commits as "closed" and "causes"
1326 commits as "identified".
1328 * public/include/commit-log-fetcher.php:
1329 (CommitLogFetcher::__construct): Remove the unused instance variable.
1330 (CommitLogFetcher::fetch_for_tasks): Added. Fetches all commits associated with a list of analysis tasks.
1331 Assumes the caller (fetch_associated_data_for_tasks) had setup "fixes" and "causes" fields on each task.
1333 * public/privileged-api/associate-commit.php: Added. Updates task_commits table to associate or disassociate
1334 a commit with an analysis task. When the specified analysis task and the specified commit are already
1335 associated, we simply update the table instead of adding a duplicating entry or error. For dissociation,
1336 the front-end specifies the commit ID.
1339 * public/v3/index.html:
1340 * public/v3/components/mutable-list-view.js: Added. Used by the list associated bugs and commits.
1341 (MutableListView): Added.
1342 (MutableListView.prototype.setList): Added.
1343 (MutableListView.prototype.setKindList): Added.
1344 (MutableListView.prototype.setAddCallback): Added. This callback is invoked when the user tries to add
1345 a new item to the list.
1346 (MutableListView.prototype.render): Added.
1347 (MutableListView.prototype._submitted): Added.
1348 (MutableListView.cssTemplate):
1349 (MutableListView.htmlTemplate):
1350 (MutableListItem): Added. RemovalLink could be a hyperlink or a callback and gets involved when the user
1351 tries to delete this item.
1352 (MutableListItem.prototype.content):
1354 * public/v3/models/analysis-task.js:
1355 (AnalysisTask): Added the support of the list of commits that fixed and caused changes.
1356 (AnalysisTask.prototype.updateSingleton): Ditto.
1357 (AnalysisTask.prototype.causes): Added.
1358 (AnalysisTask.prototype.fixes): Added.
1359 (AnalysisTask.prototype.associateCommit): Added. Use the API added at /privileged-api/associate-commit
1360 to associate a new commit with this analysis task. Each commit has either caused or fixed the change.
1361 (AnalysisTask.prototype.dissociateCommit): Added. Use the same API to disassociate each commit.
1362 (AnalysisTask._constructAnalysisTasksFromRawData): Find all commits associated with each analysis task.
1363 Because commit log objects use a fake ID fdue to /api/measurement-set not providing commit IDs, we must
1364 use CommitLog.findByRemoteId to find each commit instead of usual CommitLog.findById.
1365 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Added.
1367 * public/v3/models/build-request.js:
1368 (BuildRequest.prototype.hasFinished): Renamed from hasCompleted since it was confusing for this._status
1369 being "completed" wasn't a necessary condition for this function to return true.
1371 * public/v3/models/commit-log.js:
1372 (CommitLog): Added the static map for actual commit ID instead of a fake ID created in ensureSingleton.
1373 (CommitLog.prototype.remoteId): Added. Returns the real commit ID.
1374 (CommitLog.findByRemoteId): Added. Finds an CommitLog object using the real ID.
1376 * public/v3/models/test-group.js:
1377 (TestGroup.prototype.hasFinished): Renamed from hasCompleted to match the rename in BuildRequest.
1379 * public/v3/pages/analysis-task-page.js:
1380 (AnalysisTaskPage): Added lists for the commits that fixed and caused the change using MutableListView.
1381 Also adopted MutableListView for the list of associated bugs.
1382 (AnalysisTaskPage.prototype.render): Added the code to populate the newly added lists.
1383 (AnalysisTaskPage.prototype._makeCommitListItem): Added.
1384 (AnalysisTaskPage.prototype._associateBug): Now this is a callback from MutableListView.
1385 (AnalysisTaskPage.prototype._associateCommit): Added.
1386 (AnalysisTaskPage.prototype._dissociateCommit): Added.
1387 (AnalysisTaskPage.htmlTemplate):
1388 (AnalysisTaskPage.cssTemplate):
1390 * public/v3/remote.js:
1391 (getJSON): Spit out the entire responseText when JSON failed to parse to make debugging easier.
1393 2016-03-15 Ryosuke Niwa <rniwa@webkit.org>
1395 Extract the code to format commit logs into its own PHP file
1396 https://bugs.webkit.org/show_bug.cgi?id=155514
1398 Rubber-stamped by Chris Dumez.
1400 Extracted CommitLogFetcher out of /api/commits so that it could be used in analysis-tasks.php
1401 in the future to support associating cause/fix for each analysis task.
1403 * public/api/commits.php:
1404 * public/include/commit-log-fetcher.php: Added.
1406 (CommitLogFetcher::__construct): Added.
1407 (CommitLogFetcher::repository_id_from_name): Added.
1408 (CommitLogFetcher::fetch_between): Added.
1409 (CommitLogFetcher::fetch_oldest): Added.
1410 (CommitLogFetcher::fetch_latest): Added.
1411 (CommitLogFetcher::fetch_last_reported): Added.
1412 (CommitLogFetcher::fetch_revision): Added.
1413 (CommitLogFetcher::commit_for_revision): Added.
1414 (CommitLogFetcher::format_single_commit): Added.
1415 (CommitLogFetcher::format_commit): Added.
1417 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1419 Build fix after r196870.
1421 * public/include/report-processor.php:
1423 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1425 Add Size metric to perf dashboard
1426 https://bugs.webkit.org/show_bug.cgi?id=155266
1428 Reviewed by Chris Dumez.
1430 Added the "Size" metric and use bytes as its unit.
1432 * public/js/helper-classes.js:
1434 * public/v2/data.js:
1435 (RunsData.unitFromMetricName):
1437 2016-02-20 Ryosuke Niwa <rniwa@webkit.org>
1439 Add the support for universal slave password
1440 https://bugs.webkit.org/show_bug.cgi?id=154476
1442 Reviewed by David Kilzer.
1444 Added the support for universalSlavePassword.
1447 * public/include/report-processor.php:
1448 (ReportProcessor::process):
1449 (ReportProcessor::authenticate_and_construct_build_data): Extracted from process().
1451 2016-02-19 Ryosuke Niwa <rniwa@webkit.org>
1453 Analysis tasks page complains about missing repository but with a wrong name
1454 https://bugs.webkit.org/show_bug.cgi?id=154468
1456 Reviewed by Chris Dumez.
1458 Fixed the bug by using the right variable in the template literal.
1460 * public/v3/components/customizable-test-group-form.js:
1461 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use querySelector here since Chrome doesn't have
1462 getElementsByClassName on ShadowRoot.
1463 * public/v3/pages/analysis-task-page.js:
1464 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Use name which is the name of
1467 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1469 Revert an unintended change made in the previous commit.
1471 * init-database.sql:
1473 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1475 Perf dashboard should let user cancel pending A/B testing and hide failed ones
1476 https://bugs.webkit.org/show_bug.cgi?id=154433
1478 Reviewed by Chris Dumez.
1480 Added a button to hide a test group in the details view (the bottom table) in the analysis task page, and
1481 "Show hidden tests" link to show the hidden test groups on demand. When a test group is hidden, all pending
1482 requests in the group will also be canceled since a common scenario of using this feature is that the user
1483 had triggered an useless A/B testing; e.g. all builds will fail, wrong, etc... We can revisit and add the
1484 capability to just cancel the pending requests and leaving the group visible later if necessary.
1486 Run `ALTER TYPE build_request_status_type ADD VALUE 'canceled';` to add the new type.
1488 * init-database.sql: Added testgroup_hidden column to analysis_test_groups table and added 'canceled'
1489 as a value to build_request_status_type table.
1490 * public/api/test-groups.php:
1491 (format_test_group): Added 'hidden' field in the JSON result.
1492 * public/privileged-api/update-test-group.php:
1493 (main): Added the support for updating testgroup_hidden column. When this column is set to true, also
1494 cancel all pending build requests (by setting its request_status to 'canceled' which will be ignore by
1495 the syncing script).
1496 * public/v3/components/test-group-results-table.js:
1497 (TestGroupResultsTable.prototype.setTestGroup): Reset _renderedTestGroup here so that the next call to
1498 render() will update the table; e.g. when build requests' status change from 'Pending' to 'Canceled'.
1499 * public/v3/models/build-request.js:
1500 (BuildRequest.prototype.hasCompleted): A build request is considered complete/finished if it's canceled.
1501 (BuildRequest.prototype.hasPending): Added.
1502 (BuildRequest.prototype.statusLabel): Handle 'canceled' status.
1503 * public/v3/models/test-group.js:
1505 (TestGroup.prototype.updateSingleton): Added to update 'hidden' field.
1506 (TestGroup.prototype.isHidden): Added.
1507 (TestGroup.prototype.hasPending): Added.
1508 (TestGroup.prototype.hasPending): Added.
1509 (TestGroup.prototype.updateHiddenFlag): Added. Uses the privileged API to update testgroup_hidden column.
1510 The JSON API also updates the status of the 'pending' build requests in the group to 'canceled'.
1511 * public/v3/pages/analysis-task-page.js:
1512 (AnalysisTaskPage): Added _showHiddenTestGroups and _filteredTestGroups as instance variables.
1513 (AnalysisTaskPage.prototype._didFetchTestGroups):
1514 (AnalysisTaskPage.prototype._showAllTestGroups): Added.
1515 (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState): Extracted from _didFetchTestGroups.
1516 (AnalysisTaskPage.prototype._renderTestGroupList): Use the filtered list of test groups to show the list
1517 of test groups. When all test groups are shown, we would first show the hidden ones after the regular ones.
1518 (AnalysisTaskPage.prototype._createTestGroupListItem): Extracted from _renderTestGroupList.
1519 (AnalysisTaskPage.prototype._renderTestGroupDetails): Update the text inside the button to hide the test
1520 group. Also show a warning text that the pending requests will be canceled if there are any.
1521 (AnalysisTaskPage.prototype._hideCurrentTestGroup): Added.
1522 (AnalysisTaskPage.cssTemplate): Updated the style.
1524 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1526 The rows in the analysis results table should be expandable
1527 https://bugs.webkit.org/show_bug.cgi?id=154427
1529 Reviewed by Chris Dumez.
1531 Added "(Expand)" link between rows that have hidden points. Upon click it inserts the hidden rows.
1533 We insert around five rows at a time when there are hundreds of hidden points but we also avoid leaving
1534 behind expandable rows of less than two rows.
1536 Also fixed a bug in CustomizableTestGroupForm that getElementsById would throw in the shipping Safari
1537 because getElementsById doesn't exist on Element.prototype by using class name instead.
1539 * public/v3/components/analysis-results-viewer.js:
1540 (AnalysisResultsViewer):
1541 (AnalysisResultsViewer.prototype.setCurrentTestGroup): Removed superfluous call to render().
1542 (AnalysisResultsViewer.prototype.setPoints): Always show the start and the end points.
1543 (AnalysisResultsViewer.prototype.buildRowGroups):
1544 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Add an instance of ExpandableRow which
1545 shows a "(Expand)" link to show hidden rows here.
1546 (AnalysisResultsViewer.prototype._expandBetween): Added. Expands rows between two points.
1547 (AnalysisResultsViewer.cssTemplate): Added rules for "(Expand)" links.
1548 (AnalysisResultsViewer.ExpandableRow): Added.
1549 (AnalysisResultsViewer.ExpandableRow.prototype.resultContent): Added. Overrides what's in the results column.
1550 (AnalysisResultsViewer.ExpandableRow.prototype.heading): Added. Generates "(Expand)" link.
1552 * public/v3/components/customizable-test-group-form.js:
1553 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use getElementsByClassName instead of
1555 (CustomizableTestGroupForm.prototype._classForLabelAndRepository): Renamed from _idForLabelAndRepository.
1556 (CustomizableTestGroupForm._constructRevisionRadioButtons): Set class name instead of id.
1558 * public/v3/components/results-table.js:
1559 (ResultsTable.prototype.render): Don't generate radio buttons to select a row when root set is missing;
1560 e.g. for rows that show "(Expand)" links.
1562 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1564 Statistically significant A/B testing results should be color coded in details view
1565 https://bugs.webkit.org/show_bug.cgi?id=154414
1567 Reviewed by Chris Dumez.
1569 Color code the statistically significant comparisions in TestGroupResultsTable as done in the analysis
1572 * public/v3/components/customizable-test-group-form.js:
1573 (CustomizableTestGroupForm.cssTemplate): Build fix after r196768.
1574 * public/v3/components/test-group-results-table.js:
1575 (TestGroupResultsTable.prototype.buildRowGroups): Add the status as a class name.
1576 (TestGroupResultsTable.cssTemplate): Added styles to color-code statistically significant results.
1578 2016-02-17 Ryosuke Niwa <rniwa@webkit.org>
1580 v3 UI should allow custom revisions for A/B testing
1581 https://bugs.webkit.org/show_bug.cgi?id=154379
1583 Reviewed by Chris Dumez.
1585 Added the capability to customize revisions selected in the overview chart and the results viewer.
1587 Newly added CustomizableTestGroupForm is responsible for allowing users to modify the set of revisions in
1588 a new A/B testing group. Unlike TestGroupForm which doesn't know anything about which revisions are selected
1589 for each project/repository, CustomizableTestGroupForm is aware of the list of revisions used in each set.
1591 The list of revisions used in each set is represented by RootSet if users had not customized them, and
1592 CustomRootSet otherwise; the latter was added since regular RootSet object requires CommitLog and other
1593 DataModelObjects which are hard to create without corresponding database entries.
1595 * public/v3/components/customizable-test-group-form.js: Added.
1596 (CustomizableTestGroupForm): Added.
1597 (CustomizableTestGroupForm.prototype.setRootSetMap): Added.
1598 (CustomizableTestGroupForm.prototype._submitted): Overrides the superclass' method.
1599 (CustomizableTestGroupForm.prototype._customize): Ditto. Unlike TestGroupForm's callback, this class'
1600 callback passes in a root set map as the third argument.
1601 (CustomizableTestGroupForm.prototype._computeRootSetMap): Added. Returns this._rootSetMap, which is set by
1602 AnalysisTaskPage if user had not customized the root sets. Otherwise return a new map with CustomRootSet's.
1603 (CustomizableTestGroupForm.prototype.render): Added. Creates a table to allow customization of root sets.
1604 (CustomizableTestGroupForm._constructRevisionRadioButtons): Added.
1605 (CustomizableTestGroupForm._createRadioButton): Added.
1606 (CustomizableTestGroupForm.cssTemplate): Added.
1607 (CustomizableTestGroupForm.formContent): Added. This method is called by TestGroupForm.htmlTemplate.
1608 * public/v3/components/test-group-form.js:
1609 (TestGroupForm): Updated the various methods to not directly mutate DOM. Store the state in instance
1610 variables and update DOM in render() as done elsewhere.
1611 (TestGroupForm.prototype.setNeedsName): Deleted. We no longer need this flag since TestGroupForm which is
1612 used for retries never needs a name and CustomizableTestGroupForm which is used to create a new test group
1613 always requires a name.
1614 (TestGroupForm.prototype.setDisabled):
1615 (TestGroupForm.prototype.setLabel):
1616 (TestGroupForm.prototype.setRepetitionCount):
1617 (TestGroupForm.prototype.render): Added.
1618 (TestGroupForm.prototype._submitted): Moved the code to prevent the default action has been moved to the
1619 constructor since this method is overridden by CustomizableTestGroupForm.
1620 (TestGroupForm.cssTemplate): Added.
1621 (TestGroupForm.htmlTemplate):
1622 (TestGroupForm.formContent): Extracted from htmlTemplate.
1623 * public/v3/index.html:
1624 * public/v3/models/repository.js:
1625 (Repository.sortByNamePreferringOnesWithURL): Added.
1626 * public/v3/models/root-set.js:
1627 (RootSet.prototype.revisionForRepository): Added so that _createTestGroupAfterVerifyingRootSetList can retrieve
1628 the revision information from CustomRootSet without going through CommitLog objects since CustomRootSet doesn't
1629 have associated CommitLog objects.
1630 (CustomRootSet): Added. Used by CustomizableTestGroupForm to create a custom root map since regular RootSet
1631 requires CommitLog and other related objects which are hard to create without database entries.
1632 (CustomRootSet.prototype.setRevisionForRepository): Added.
1633 (CustomRootSet.prototype.repositories): Added.
1634 (CustomRootSet.prototype.revisionForRepository): Added.
1635 * public/v3/pages/analysis-task-page.js:
1637 (AnalysisTaskPage.prototype.render): Removed the reference to v2 UI since v3 UI is now strictly more powerful
1638 than v2 UI. Also update the root set maps in each form here.
1639 (AnalysisTaskPage.prototype._retryCurrentTestGroup): No longer takes unused name argument as it got removed
1641 (AnalysisTaskPage.prototype._chartSelectionDidChange): No longer updates the disabled-ness here since it's now
1642 done in render() via setRootSetMap().
1643 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Now takes rootSetMap as an argument.
1644 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): No longer updates the disabled-ness here
1645 since it's now done in render() via setRootSetMap().
1646 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Now takes rootSetMap as an argument.
1647 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Take a dictionary of root set labels
1648 such as A and B, which maps to a RootSet or a newly-added CustomRootSet.
1649 (AnalysisTaskPage.htmlTemplate): Use customizable-test-group-form for creating a new A/B testing group. Retry
1650 form will continue to use TestGroupForm since customizing revisions is non-sensical in retries.
1651 (AnalysisTaskPage.cssTemplate): Updated the style.
1653 2016-02-16 Ryosuke Niwa <rniwa@webkit.org>
1655 v3 UI has the capability to schedule an A/B testing in a specific range
1656 https://bugs.webkit.org/show_bug.cgi?id=154329
1658 Reviewed by Chris Dumez.
1660 Extended AnalysisTaskChartPane and ResultsTable so that users can select a range of points in either
1661 the overview chart pane and the results viewer table. Extracted TestGroupForm out of the analysis task
1662 page and used right below those two components in the analysis task page.
1664 * public/v3/components/results-table.js:
1666 (ResultsTable.prototype.setRangeSelectorLabels): Added.
1667 (ResultsTable.prototype.setRangeSelectorCallback): Added.
1668 (ResultsTable.prototype.selectedRange): Added.
1669 (ResultsTable.prototype._rangeSelectorClicked): Added.
1670 (ResultsTable.prototype.render): Generate radio boxes to select a range.
1672 * public/v3/components/test-group-form.js:
1674 (TestGroupForm.prototype.setStartCallback): Added.
1675 (TestGroupForm.prototype.setNeedsName): Added.
1676 (TestGroupForm.prototype.setDisabled): Added.
1677 (TestGroupForm.prototype.setLabel): Added.
1678 (TestGroupForm.prototype.setRepetitionCount): Added.
1679 (TestGroupForm.prototype._submitted): Added.
1680 (TestGroupForm.htmlTemplate): Extracted from AnalysisTaskPage.htmlTemplate.
1682 * public/v3/index.html:
1684 * public/v3/pages/analysis-task-page.js:
1685 (AnalysisTaskChartPane.prototype._mainSelectionDidChange): Added. Delegates the work to AnalysisTaskPage.
1686 (AnalysisTaskChartPane.prototype.selectedPoints): Added.
1688 (AnalysisTaskPage.prototype.title):
1689 (AnalysisTaskPage.prototype.render):
1690 (AnalysisTaskPage.prototype._renderTestGroupDetails): Use TestGroupForm's methods instead of mutating DOM.
1691 (AnalysisTaskPage.prototype._retryCurrentTestGroup):
1692 (AnalysisTaskPage.prototype._chartSelectionDidChange): Added.
1693 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Added.
1694 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Added.
1695 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Added.
1696 (AnalysisTaskPage.prototype._createRetryNameForTestGroup):
1697 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Extracted from _retryCurrentTestGroup
1698 so that we can call it in _createNewTestGroupFromChart and _createNewTestGroupFromViewer.
1699 (AnalysisTaskPage.htmlTemplate):
1701 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1703 Extract the code specific to v2 UI out of shared statistics.js
1704 https://bugs.webkit.org/show_bug.cgi?id=154277
1706 Reviewed by Chris Dumez.
1708 Extracted statistics-strategies.js out of statistics.js for v2 UI and detect-changes.js. The intent is to
1709 deprecate this file once we implement refined statistics tools in v3 UI and adopt it in detect-changes.js.
1711 * public/shared/statistics.js:
1712 (Statistics.movingAverage): Extracted from the "Simple Moving Average" strategy.
1713 (Statistics.cumultaiveMovingAverage): Extracted from the "Cumulative Moving Average" strategy.
1714 (Statistics.exponentialMovingAverage): Extracted from the "Exponential Moving Average" strategy.
1715 Use a temporary "movingAverage" to keep the last moving average instead of relying on the previous
1716 entry in "averages" array to avoid special casing an array of length 1 and starting the loop at i = 1.
1717 (Statistics.segmentTimeSeriesGreedyWithStudentsTTest): Extracted from "Segmentation: Recursive t-test"
1718 strategy. Don't create the list of averages to match segmentTimeSeriesByMaximizingSchwarzCriterion here.
1719 It's done in newly added averagesFromSegments.
1720 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Extracted from
1721 "Segmentation: Schwarz criterion" strategy.
1722 (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Just store the start index to match
1724 (App.Pane.updateStatisticsTools):
1725 (App.Pane._computeMovingAverageAndOutliers):
1726 * public/v2/data.js:
1727 * public/v2/index.html:
1728 * public/v2/statistics-strategies.js: Added.
1729 (StatisticsStrategies.MovingAverageStrategies): Added.
1730 (averagesFromSegments): Extracted from "Segmentation: Schwarz criterion" strategy. Now used by both
1731 "Segmentation: Recursive t-test" and "Segmentation: Schwarz criterion" strategies.
1732 (StatisticsStrategies.EnvelopingStrategies): Moved from Statistics.EnvelopingStrategies.
1733 (StatisticsStrategies.TestRangeSelectionStrategies): Moved from Statistics.TestRangeSelectionStrategies.
1734 (createWesternElectricRule): Moved from statistics.js.
1735 (countValuesOnSameSide): Ditto.
1736 (StatisticsStrategies.executeStrategy): Moved from Statistics.executeStrategy.
1737 * tools/detect-changes.js:
1738 (computeRangesForTesting):
1740 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1742 v1 UI and v2 UI should share statistics.js
1743 https://bugs.webkit.org/show_bug.cgi?id=154262
1745 Reviewed by Chris Dumez.
1747 Share statistics.js between v1 and v2 UI.
1749 * public/index.html:
1750 * public/js/shared.js: Deleted.
1751 * public/js/statistics.js: Removed.
1752 * public/shared: Added.
1753 * public/shared/statistics.js: Moved from Websites/perf.webkit.org/public/v2/js/statistics.js.
1754 * public/v2/index.html:
1755 * public/v2/js/statistics.js: Removed.
1756 * public/v3/index.html:
1757 * tools/detect-changes.js:
1759 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1761 v3 UI sometimes shows same dates twice on the x-axis of time series charts
1762 https://bugs.webkit.org/show_bug.cgi?id=154210
1764 Reviewed by Chris Dumez.
1766 The bug was caused by the label generation code in TimeSeriesChart.computeTimeGrid never emitting hours.
1768 Use hours instead of dates as labels when the current time's date is same as the previous label's date.
1769 Always include dates before entering this mode to avoid just having hours as labels on the entire x-axis.
1771 * public/v3/components/time-series-chart.js:
1772 (TimeSeriesChart.prototype._renderXAxis): Slightly increase the "average" width of x-axis label.
1773 (TimeSeriesChart.computeTimeGrid): See above. Also assert that the number of labels we generate never
1774 exceeds maxLabels as a sanity check.
1775 (TimeSeriesChart._timeIterators): Added an iterator that increments by two hours for zoomed graphs.
1777 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1779 v3 UI should show status and associated bugs on analysis task pages
1780 https://bugs.webkit.org/show_bug.cgi?id=154212
1782 Reviewed by Chris Dumez.
1784 Added the capability to see and modify the status and the list of associated of bugs on analysis task pages.
1786 Also added the list of related tasks, which are analysis tasks associated with the same bug or have
1787 overlapping time ranges with the same test metric but on a potentially different platform.
1789 In addition, categorize analysis tasks with the status of "no change" or "inconclusive" as "closed" as no
1790 further action can be taken (users can bring them back to non-closed state without any restrictions).
1792 * public/api/analysis-tasks.php:
1793 (format_task): Categorize 'unchanged' and 'inconclusive' analysis tasks as closed.
1795 * public/privileged-api/associate-bug.php:
1796 (main): Added shouldDelete as a new mechanism to disassociate a bug since v3 UI shares a single Bug object
1797 between multiple analysis tasks (as it should have been in the first place).
1799 * public/v3/components/chart-pane-base.js:
1801 (ChartPaneBase.prototype._fetchAnalysisTasks): Since each analysis task's change type (status/result) could
1802 change, we need to create annotation objects during each render() call.
1803 (ChartPaneBase.prototype.render):
1804 (ChartPaneBase.prototype._renderAnnotations): Extracted from ChartPaneBase.prototype._fetchAnalysisTasks to
1805 do that. I was afraid of the perf impact of this but it doesn't seem to be an issue in my testing.
1806 (ChartPaneBase.cssTemplate): Removed superfluous margins (moved to ChartPane.cssTemplate) around the charts
1807 since they are only useful in the charts page.
1809 * public/v3/models/analysis-task.js:
1811 (AnalysisTask.prototype.updateSingleton): Added a comment as to why object.result cannot be renamed to
1812 object.changeType in the JSON API.
1813 (AnalysisTask.prototype.updateName): Added.
1814 (AnalysisTask.prototype.updateChangeType): Added.
1815 (AnalysisTask.prototype._updateRemoteState): Added.
1816 (AnalysisTask.prototype.associateBug): Added.
1817 (AnalysisTask.prototype.disassociateBug): Added.
1818 (AnalysisTask.fetchRelatedTasks): Added. See above for the criteria of related-ness.
1820 * public/v3/pages/analysis-task-page.js:
1822 (AnalysisTaskPage.prototype.updateFromSerializedState):
1823 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): Extracted from updateFromSerializedState.
1824 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks): Added.
1825 (AnalysisTaskPage.prototype.render): Render the list of associated bugs, the list of bug trackers (so that
1826 users can use it to associate with a new bug), and the list of related analysis tasks.
1827 (AnalysisTaskPage.prototype._renderTestGroupList): Extracted from render since it was getting too long.
1828 (AnalysisTaskPage.prototype._renderTestGroupDetails): Ditto.
1829 (AnalysisTaskPage.prototype._updateChangeType): Added.
1830 (AnalysisTaskPage.prototype._associateBug): Added.
1831 (AnalysisTaskPage.prototype._disassociateBug): Added.
1832 (AnalysisTaskPage.htmlTemplate): Added various elements to show and modify the status, associate bugs,
1833 and a list of related analysis tasks.
1834 (AnalysisTaskPage.cssTemplate): Added various styles for those form controls.
1836 * public/v3/pages/chart-pane.js:
1837 (ChartPane.cssTemplate): Moved the margins from ChartPaneBase.cssTemplate.
1839 2016-02-12 Ryosuke Niwa <rniwa@webkit.org>
1841 Perf dashboard should allow renaming analysis tasks and test groups
1842 https://bugs.webkit.org/show_bug.cgi?id=154200
1844 Reviewed by Chris Dumez.
1846 Allow editing names of analysis tasks and A/B testing groups in the v3 UI.
1848 Added the support for updating the name to the privileged API at /privileged-api/update-analysis-task
1849 and added a new prevailed API to update A/B testing groups at /privileged-api/update-test-group.
1851 * public/privileged-api/update-analysis-task.php: Added the support for renaming the analysis task.
1854 * public/privileged-api/update-test-group.php: Added. Supports updating the test group's name.
1857 * public/v3/components/editable-text.js: Added.
1858 (EditableText): Added. A new editable text label control. It looks like a text node with "(Edit)" link
1859 at the end which allow users to go into the "editing mode", which reveals an input element.
1860 The user can exit the editing mode by either moving the focus away from the control or clicking on
1861 "(Save)" at the end. It calls _updateCallback in the latter case.
1862 (EditableText.prototype.editedText): Returns the current value of the input element user.
1863 (EditableText.prototype.setText): Sets the label. This does not live-update the input element until
1864 the user exists the current editing mode and re-enters it.
1865 (EditableText.prototype.setStartedEditingCallback): Sets a callback which gets called when the user
1866 requested to enter the editing mode. Since EditableText relies on AnalysisTaskPage to render, this
1867 callback only exits to call EditableText.render() in AnalysisTask._didStartEditingTaskName.
1868 (EditableText.prototype.setUpdateCallback): Sets a callback which gets called when the user exits
1869 the editing mode by activating the "(Save)" link. This callback MUST return a promise upon resolution
1870 of which the control gets out of the editing mode. While the promise is in flight, the input element
1872 (EditableText.prototype.render): Updates various states of the elements. When _updatingPromise is not
1873 falsy, we make the input element readonly and show '(...)' on the link. Don't show the action link
1874 if the label is empty (e.g. analysis task or test group is still being fetched).
1875 (EditableText.prototype._didClick): Called when the user clicked on the action link. Enter the editing
1876 mode or save the edited label via _updateCallback.
1877 (EditableText.prototype._didBlur): Exit the editing mode without saving if the input element is not
1878 focused, there is no inflight promise returned by _updateCallback, and the action link "(Save)" does
1880 (EditableText.prototype._didUpdate): Called when exiting the editing mode.
1881 (EditableText.htmlTemplate):
1882 (EditableText.cssTemplate):
1884 * public/v3/index.html: Include newly added editable-text.js.
1886 * public/v3/models/analysis-task.js:
1887 (AnalysisTask.prototype.updateSingleton): Added.
1888 (AnalysisTask.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1889 the analysis task from the sever.
1890 (AnalysisTask._constructAnalysisTasksFromRawData): Use ensureSingleton instead of manually calling
1891 findById since we need to update the name of the singleton object we found (via updateSingleton).
1893 * public/v3/models/bug.js:
1894 (Bug.ensureSingleton): Moved the code to compute the synthetic id from AnalysisTask's
1895 _constructAnalysisTasksFromRawData.
1896 (Bug.prototype.updateSingleton): Added. Just assert that nothing changes.
1898 * public/v3/models/build-request.js:
1899 (BuildRequest.prototype.updateSingleton): Added. Assert that the intrinsic values of a build request
1900 doesn't change and update status text, status url, and build id as they could change.
1902 * public/v3/models/commit-log.js:
1903 (CommitLog): Made the constructor argument conform to the convention of id, object pair so that we can
1904 use DataModelObject.ensureSingleton.
1905 (CommitLog.ensureSingleton):
1906 (CommitLog.prototype.updateSingleton): Extracted from CommitLog.ensureSingleton.
1908 * public/v3/models/data-model.js:
1909 (DataModelObject.ensureSingleton): Call newly added updateSingleton.
1910 (DataModelObject.prototype.updateSingleton):
1911 (LabeledObject): Removed the name map since it's never used (findByName is never called anywhere).
1912 (LabeledObject.prototype.updateSingleton): Added. Updates _name.
1913 (LabeledObject.findByName): Deleted.
1915 * public/v3/models/test-group.js:
1916 (TestGroup.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1917 the test group from the sever.
1918 (TestGroup._createModelsFromFetchedTestGroups): Removed bogus code. A root set doesn't have a test
1919 group associated with it since multiple test groups can share a single root set (this property doesn't
1922 * public/v3/pages/analysis-task-page.js:
1923 (AnalysisTaskPage): Removed useless _taskId and added this._testGroupLabelMap and this._taskNameLabel.
1924 (AnalysisTaskPage.prototype.updateFromSerializedState): Cleanup.
1925 (AnalysisTaskPage.prototype._didFetchTask): Assert that this function is called exactly once.
1926 (AnalysisTaskPage.prototype.render): Use this._task.id() to show the v2 link. Use EditableText to show
1927 the names of the analysis task and the associated test groups. Hide the overview chart and the list of
1928 test groups (along with the retry/confirm button) when the analysis task failed to fetch. We always
1929 update the names of the analysis task and the associated test groups since they could be updated by
1931 (AnalysisTaskPage.prototype._didStartEditingTaskName): Added.
1932 (AnalysisTaskPage.prototype._updateTaskName): Added.
1933 (AnalysisTaskPage.prototype._updateTestGroupName): Added.
1934 (AnalysisTaskPage.htmlTemplate): Updated the style.
1936 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1938 Land the change that was supposed to be the part of r196463.
1940 * public/v3/pages/analysis-task-page.js:
1941 (AnalysisTaskPage.prototype._didFetchTestGroups): Select the latest test group by default.
1943 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1945 Refine v3 UI's analysis task page
1946 https://bugs.webkit.org/show_bug.cgi?id=154152
1948 Reviewed by Chris Dumez.
1950 This patch makes the following refinements to the analysis task page:
1951 - Always show the relative different of in-progress A/B testing.
1952 - Make the annotations (colored bars) in the chart open other analysis tasks.
1953 - Order the A/B testing groups in the reverse chronological order.
1954 - Select the time range corresponding to the current test group.
1956 * public/v3/components/analysis-results-viewer.js:
1957 (AnalysisResultsViewer.cssTemplate): Fixed the bug that pending and running testing groups are no longer
1958 colored after r196440. Use a slightly more opaque color for currently running groups compared to pending ones.
1960 * public/v3/components/chart-pane-base.js:
1961 (ChartPaneBase.prototype.setMainSelection): Added.
1962 (ChartPaneBase.prototype._openAnalysisTask): Moved the code from ChartPane._openAnalysisTask so that it can be
1963 reused in both AnalysisTaskChartPane and ChartPane (in charts page).
1964 (ChartPaneBase.prototype.router): Added. Overridden by each subclass.
1966 * public/v3/components/test-group-results-table.js:
1967 (TestGroupResultsTable.prototype.buildRowGroups): Always show the summary (relative difference of A to B) as
1968 long as there are some results in each set.
1970 * public/v3/models/test-group.js:
1971 (TestGroup.prototype.compareTestResults): Always set .label and .fullLabel with the relative change as long as
1972 there are some values. Keep using "pending" and "running" in .status since that would determine the color of
1973 stacking blocks representing those A/B testing groups.
1975 * public/v3/pages/analysis-task-page.js:
1976 (AnalysisTaskChartPane):
1977 (AnalysisTaskChartPane.prototype.setPage): Added.
1978 (AnalysisTaskChartPane.prototype.router): Added.
1980 (AnalysisTaskPage.prototype.render): Show the list of A/B testing groups in the reverse chronological order.
1981 Also set the main chart's selection to the time range of the current test group.
1983 * public/v3/pages/chart-pane.js:
1984 (ChartPane.prototype.router): Added.
1985 (ChartPane.prototype._openAnalysisTask): Moved to ChartPaneBase.prototype._openAnalysisTask.
1987 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1989 Add a script to process backlogs created while perf dashboard was in the maintenance mode
1990 https://bugs.webkit.org/show_bug.cgi?id=154140
1992 Reviewed by Chris Dumez.
1994 Added a script to process the backlog JSONs created while the perf dashboard was put in the maintenance mode.
1995 It re-submits each JSON file to the perf dashboard using the same server config file used by syncing scripts.
1997 * public/include/report-processor.php:
1998 (TestRunsGenerator::test_value_list_to_values_by_iterations): Fixed a bug in the error message code. It was
1999 referencing an undeclared variable.
2000 * tools/process-maintenance-backlog.py: Added.
2002 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2004 AnalysisResultsViewer never uses this._smallerIsBetter
2005 https://bugs.webkit.org/show_bug.cgi?id=154134
2007 Reviewed by Chris Dumez.
2009 Removed the unused instance variable _smallerIsBetter from AnalysisResultsViewer and TestGroupStackingBlock.
2011 * public/v3/components/analysis-results-viewer.js:
2012 (AnalysisResultsViewer): Removed the unused _smallerIsBetter.
2013 (AnalysisResultsViewer.prototype.setSmallerIsBetter): Deleted.
2014 (AnalysisResultsViewer.prototype.buildRowGroups):
2015 (AnalysisResultsViewer.TestGroupStackingBlock): Removed the unused _smallerIsBetter.
2016 * public/v3/pages/analysis-task-page.js:
2017 (AnalysisTaskPage.prototype._didFetchTask):
2019 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2021 Build fix after r196440.
2023 * public/v3/models/test-group.js:
2024 (TestGroup.prototype.addBuildRequest): Clear the map instead of setting the property to null.
2026 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2028 Perf dashboard should have UI to retry A/B testing
2029 https://bugs.webkit.org/show_bug.cgi?id=154090
2031 Reviewed by Chris Dumez.
2033 Added a button to re-try an existing A/B testing group with a custom repetition count. The same button functions
2034 as a way of confirming the progression/regression when there have been no A/B testing scheduled in the task.
2036 Also fixed the bug that A/B testing groups that have been waiting for other test groups will be shown as "running".
2038 * public/v3/components/results-table.js:
2039 (ResultsTable.cssTemplate): Don't pad the list of extra repositories when it's empty.
2041 * public/v3/components/test-group-results-table.js:
2042 (TestGroupResultsTable.prototype.buildRowGroups): Use TestGroup.labelForRootSet instead of manually
2043 computing the letter for each configuration set.
2045 * public/v3/models/build-request.js:
2046 (BuildRequest.prototype.hasStarted): Added.
2048 * public/v3/models/data-model.js:
2049 (DataModelObject.ensureSingleton): Added.
2050 (DataModelObject.cachedFetch): Added noCache option. This is used when re-fetching the test groups after
2053 * public/v3/models/measurement-cluster.js:
2054 (MeasurementCluster.prototype.startTime): Added.
2056 * public/v3/models/measurement-set.js:
2057 (MeasurementSet.prototype.hasFetchedRange): Added. Returns true only if there are no "holes" (cluster
2058 yet to be fetched) between the specified time range. This was added to fix a bug in AnalysisTaskPage's
2059 _didFetchMeasurement.
2061 * public/v3/models/test-group.js:
2062 (TestGroup): Added this._rootSetToLabel.
2063 (TestGroup.prototype.addBuildRequest): Reset this._rootSetToLabel along with this._requestedRootSets.
2064 (TestGroup.prototype.repetitionCount): Added. Returns the number of iterations executed per set. We assume that
2065 every root set in the test group shares a single repetition count.
2066 (TestGroup.prototype.requestedRootSets): Now populates this._rootSetToLabel for labelForRootSet.
2067 (TestGroup.prototype.labelForRootSet): Added.
2068 (TestGroup.prototype.hasStarted): Added.
2069 (TestGroup.prototype.compareTestResults): Use 'running' and 'pending' to differentiate test groups that are waiting
2070 for other groups to finish running from the ones that are actually running ('incomplete' before this patch).
2071 (TestGroup.fetchByTask):
2072 (TestGroup.createAndRefetchTestGroups): Added. Creates a new test group using the privileged-api/create-test-group
2073 and fetches the list of test groups for the specified analysis task.
2074 (TestGroup._createModelsFromFetchedTestGroups): Extracted from TestGroup.fetchByTask.
2076 * public/v3/pages/analysis-task-page.js:
2077 (AnalysisTaskPage): Initialize _renderedCurrentTestGroup to undefined so that we'd always can differentiate
2078 the initial call to AnalysisTaskPage.render and subsequent calls in which it's identical to _currentTestGroup.
2079 (AnalysisTaskPage.prototype._didFetchMeasurement): Fixed a bug that we don't exit early even when some
2080 clusters in between startPoint and endPoint are still being fetched via newly added hasFetchedRange.
2081 (AnalysisTaskPage.prototype.render): Update the default repetition count based on the current test group.
2082 Also update the label of the button to "Confirm the change" if there is no A/B testing in this task.
2083 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Added. Re-triggers an existing A/B testing group or creates
2084 the A/B testing for the entire range of the analysis task.
2085 (AnalysisTaskPage.prototype._hasDuplicateTestGroupName): Added.
2086 (AnalysisTaskPage.prototype._createRetryNameForTestGroup): Added.
2087 (AnalysisTaskPage.htmlTemplate): Added form controls to re-trigger A/B testing.
2088 (AnalysisTaskPage.cssTemplate): Updated the style.
2090 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2092 Removed the duplicated definition of ChartPaneBase.
2094 * public/v3/components/chart-pane-base.js:
2096 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
2098 Analysis task page on v3 UI should show charts
2099 https://bugs.webkit.org/show_bug.cgi?id=154057
2101 Reviewed by Chris Dumez.
2103 Extracted ChartPaneBase out of ChartPane and added an instance of its new subclass, AnalysisTaskChartPane,
2104 to the analysis task page. The main difference is that ChartPaneBase doesn't depend on the presence of
2105 this._chartsPage unlike ChartPane. It also doesn't have the header with toolbar (to show breakdown, etc...).
2107 * public/v3/components/base.js:
2108 (ComponentBase.prototype._constructShadowTree): Call htmlTemplate() and cssTemplate() with the right "this".
2110 * public/v3/components/chart-pane-base.js: Added.
2111 (ChartPaneBase): Extracted from ChartPane.
2112 (ChartPaneBase.prototype.configure): Extracted from the constructor. Separating this function allows the
2113 component to be instantiated inside a HTML template.
2114 (ChartPaneBase.prototype._fetchAnalysisTasks): Moved from ChartPane._fetchAnalysisTasks.
2115 (ChartPaneBase.prototype.platformId): Ditto.
2116 (ChartPaneBase.prototype.metricId): Ditto.
2117 (ChartPaneBase.prototype.setOverviewDomain): Ditto.
2118 (ChartPaneBase.prototype.setMainDomain): Ditto.
2119 (ChartPaneBase.prototype._overviewSelectionDidChange): Extracted from the constructor. This is overridden in
2120 ChartPane and unused in AnalysisTaskChartPane.
2121 (ChartPaneBase.prototype._mainSelectionDidChange): Extracted from ChartPane._mainSelectionDidChange.
2122 (ChartPaneBase.prototype._mainSelectionDidZoom): Extracted from ChartPane._mainSelectionDidZoom.
2123 (ChartPaneBase.prototype._indicatorDidChange): Extracted from ChartPane._indicatorDidChange.
2124 (ChartPaneBase.prototype._didFetchData): Moved from ChartPane._fetchAnalysisTasks.
2125 (ChartPaneBase.prototype._openAnalysisTask): Ditto.
2126 (ChartPaneBase.prototype._openCommitViewer): Ditto. Also fixed a bug that we don't show the spinner while
2127 waiting for the data to be fetched by calling this.render() here.
2128 (ChartPaneBase.prototype._keyup): Moved from ChartPane._keyup. Also fixed the bug that the revisions list
2129 doesn't update by calling this.render() here.
2130 (ChartPaneBase.prototype.render): Extracted from ChartPane.render.
2131 (ChartPaneBase.htmlTemplate): Extracted from ChartPane.htmlTemplate.
2132 (ChartPaneBase.paneHeaderTemplate): Added. This is overridden in ChartPane and unused in AnalysisTaskChartPane.
2133 (ChartPaneBase.cssTemplate): Extracted from ChartPane.htmlTemplate.
2135 * public/v3/components/chart-styles.js: Renamed from public/v3/pages/page-with-charts.js.
2136 (PageWithCharts): Renamed from PageWithCharts since it no longer extends PageWithHeading.
2137 (ChartStyles.createChartSourceList):
2139 * public/v3/components/commit-log-viewer.js:
2140 (CommitLogViewer.prototype.view): Set this._repository right away instead of waiting for the fetched data
2141 so that spinner will be shown while the data is being fetched.
2143 * public/v3/index.html:
2145 * public/v3/pages/analysis-task-page.js:
2146 (AnalysisTaskChartPane): Added extends ChartPaneBase.
2147 (AnalysisTaskPage): Added. this._chartPane.
2148 (AnalysisTaskPage.prototype._didFetchTask): Initialize this._chartPane with a domain.
2149 (AnalysisTaskPage.prototype.render): Render this._chartPane.
2150 (AnalysisTaskPage.htmlTemplate):
2152 * public/v3/pages/chart-pane-status-view.js:
2153 (ChartPaneStatusView): Removed the unused router from the argument list.
2154 (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Renamed from analyzeData() since it was ambiguous.
2155 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Fixed the bug that we don't update the list
2156 of the revisions here.
2157 (ChartPaneStatusView.prototype.computeChartStatusLabels):
2159 * public/v3/pages/chart-pane.js:
2160 (ChartPane): Now extends ChartPaneBase.
2161 (ChartPane.prototype._overviewSelectionDidChange): Extracted from the constructor.
2162 (ChartPane.prototype._mainSelectionDidChange):
2163 (ChartPane.prototype._mainSelectionDidZoom):
2164 (ChartPane.prototype._indicatorDidChange):
2165 (ChartPane.prototype.render):
2166 (ChartPane.prototype._renderActionToolbar):
2167 (ChartPane.paneHeaderTemplate): Extracted from htmlTemplate.
2168 (ChartPane.cssTemplate):
2169 (ChartPane.overviewOptions.selection.onchange): Deleted.
2170 (ChartPane.prototype._fetchAnalysisTasks): Deleted.
2171 (ChartPane.prototype.platformId): Deleted.
2172 (ChartPane.prototype.metricId): Deleted.
2173 (ChartPane.prototype.setOverviewDomain): Deleted.
2174 (ChartPane.prototype.setMainDomain): Deleted.
2175 (ChartPane.prototype._openCommitViewer): Deleted.
2176 (ChartPane.prototype._didFetchData): Deleted.
2177 (ChartPane.prototype._keyup): Deleted.
2179 * public/v3/pages/charts-page.js:
2181 (ChartsPage.createDomainForAnalysisTask): Extracted by createDomainForAnalysisTask; used to set the domain
2182 of the charts in the analysis task page.
2183 (ChartsPage.createStateForAnalysisTask):
2185 * public/v3/pages/dashboard-page.js:
2187 (DashboardPage.prototype._createChartForCell):
2189 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2191 Add the support for maintenance mode
2192 https://bugs.webkit.org/show_bug.cgi?id=154072
2194 Reviewed by Chris Dumez.
2196 Added the crude support for maintenance mode whereby which the reports are stored in the filesystem
2197 instead of the database.
2199 * config.json: Added maintenanceMode and maintenanceDirectory as well as forgotten siteTitle and
2200 remoteServer.httpdMutexDir.
2201 * public/api/report.php:
2202 (main): Don't connect to the database or modify database when maintenanceMode is set.
2203 * public/include/json-header.php:
2204 (ensure_privileged_api_data): Exit with InMaintenanceMode when maintenanceMode is set. This prevents
2205 privileged API such as creating analysis tasks and new A/B testing groups from modifying the database.
2207 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
2209 Analysis task page on v3 show progression as regressions
2210 https://bugs.webkit.org/show_bug.cgi?id=154045
2212 Reviewed by Chris Dumez.
2214 The bug was caused by TestGroup.compareTestResults referring to undefined _smallerIsBetter.
2215 Retrieve it from the associated metric object via the owner analysis task.
2217 * public/v3/models/test-group.js:
2219 2016-02-05 Ryosuke Niwa <rniwa@webkit.org>
2221 Testing with remote server cache is unusably slow
2222 https://bugs.webkit.org/show_bug.cgi?id=153928
2224 Reviewed by Chris Dumez.
2226 Don't use the single process mode of httpd as it's way too slow even for testing.
2227 Also we'll hit a null pointer crash (http://svn.apache.org/viewvc?view=revision&revision=1711479)
2229 Since httpd exits immediately when launched in multi-process mode, remote-cache-server.py (renamed from
2230 run-with-remote-server.py) now has "start" and "stop" commands to start/stop the Apache. Also added
2231 "reset" command to reset the cache for convenience.
2233 * Install.md: Updated the instruction.
2234 * config.json: Fixed a typo: httpdErro*r*Log.
2235 * tools/remote-cache-server.py: Copied from Websites/perf.webkit.org/tools/run-with-remote-server.py.
2236 Now takes one of the following commands: "start", "stop", and "reset".
2238 (start_httpd): Extracted from main.
2239 (stop_httpd): Added.
2240 * tools/remote-server-relay.conf: Removed redundant (duplicate) LoadModule's.
2241 * tools/run-with-remote-server.py: Removed.
2243 2016-02-04 Ryosuke Niwa <rniwa@webkit.org>
2245 Perf dashboard should have a script to setup database
2246 https://bugs.webkit.org/show_bug.cgi?id=153906
2248 Reviewed by Chris Dumez.
2250 Added tools/setup-database.py to setup the database. It retrieves the database name, username, password
2251 and initializes a database at the specified location.
2253 * Install.md: Updated instruction to setup postgres to use setup-database.py.
2254 * tools/setup-database.py: Added.
2256 (load_database_config):
2257 (determine_psql_dir):
2258 (start_or_stop_database):
2259 (execute_psql_command):
2261 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2263 buildbot syncing scripts sometimes schedule more than one requests per builder
2264 https://bugs.webkit.org/show_bug.cgi?id=153047
2266 Reviewed by Chris Dumez.
2268 The bug was caused by the check for singularity of scheduledRequests being conducted per configuration
2269 instead of per builder. So if there were multiple test configurations (e.g. Speedometer and Octane) that
2270 both used the same builder, then we may end up scheduling both at once.
2272 Fixed the bug by sharing a single set to keep track of the scheduled requests for all configurations per
2275 * tools/sync-with-buildbot.py:
2276 (load_config): Share a set amongst test configurations for each builder.
2277 (find_request_updates): Instead of creating a new set for each configuration, reuse the existing sets to
2278 share a single set agmonst test configurations for each builder.
2280 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2282 Analysis results viewer sometimes doesn't show the correct relative difference
2283 https://bugs.webkit.org/show_bug.cgi?id=152930
2285 Reviewed by Chris Dumez.
2287 The bug was caused by single A/B testing result associated with multiple rows when there are multiple data
2288 points with the same root set which matches that of an A/B testing.
2290 Fixed the bug by detecting such a case, and only associating each A/B testing result with the row created
2291 for the first matching point.
2293 * public/v3/components/analysis-results-viewer.js:
2294 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
2296 2016-01-08 Ryosuke Niwa <rniwa@webkit.org>
2298 Make v3 UI analysis task page is hard to understand
2299 https://bugs.webkit.org/show_bug.cgi?id=152917
2301 Reviewed by Antti Koivisto.
2303 Add a dark gray border around the selected block in the analysis results viewer instead of using darker
2304 shades since that looks as if they were bigger regression/progression.
2306 Explicitly show "Failed" as the label instead of omitting with "-" when all build requests in an A/B
2307 testing group fails.
2309 * public/v3/components/analysis-results-viewer.js:
2310 (AnalysisResultsViewer.cssTemplate): Tweaked the style to underline text in the hovered blocks and the
2311 selected blocks and show a dark gray border around the selected blocks.
2312 (AnalysisResultsViewer.TestGroupStackingBlock):
2313 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Use this._title for title.
2314 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
2315 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForRootSet): Deleted.
2317 * public/v3/components/results-table.js:
2318 (ResultsTable.prototype.render):
2319 (ResultsTable.prototype._createRevisionListCells): Extracted from ResultsTable.prototype.render.
2320 (ResultsTable.cssTemplate): Tweaked the style.
2322 (ResultsTableRow.prototype.constructor): Added _labelForWholeRow to store the label for the entire row.
2323 This is used to show the comparison result of two root sets (e.g. A vs B).
2324 (ResultsTableRow.prototype.setLabelForWholeRow): Added.
2325 (ResultsTableRow.prototype.labelForWholeRow): Added.
2326 (ResultsTableRow.prototype.resultContent): Extracted from buildHeading. Creates a hyperlinked bar graph
2327 used for each A/B testing result.
2328 (ResultsTableRow.prototype.buildHeading): Deleted since we need to set colspan on the second table cell
2329 when we're creating a row with _labelForWholeRow.
2331 * public/v3/components/test-group-results-table.js:
2332 (TestGroupResultsTable.prototype.buildRowGroups): Added rows to show relative differences and statistical
2333 significance between root sets (e.g. A vs B).
2335 * public/v3/models/build-request.js:
2336 (BuildRequest.prototype.hasCompleted): Added.
2338 * public/v3/models/test-group.js:
2339 (TestGroup.prototype.compareTestResults): Extracted from AnalysisResultsViewer.TestGroupStackingBlock's
2340 _computeTestGroupStatus and generalized to be reused in TestGroupResultsTable.
2341 (TestGroup.prototype._valuesForRootSet): Moved from AnalysisResultsViewer.TestGroupStackingBlock.
2343 * public/v3/pages/analysis-task-page.js:
2344 (AnalysisTaskPage.cssTemplate): Tweaked the style.
2346 2016-01-07 Ryosuke Niwa <rniwa@webkit.org>
2348 Perf dashboard should automatically add aggregators
2349 https://bugs.webkit.org/show_bug.cgi?id=152818
2351 Reviewed by Chris Dumez.
2353 When an aggregator entry is missing in aggregators table, automatically insert it in /api/report.
2355 In a very early version of the perf dashboard, we had the ability to define a custom aggregator
2356 in an admin page. In practice, nobody used or needed this feature so we got rid of it even before
2357 the dashboard was landed into WebKit repository. This patch cleans up that mess.
2360 (main): Added the filtering capability.
2361 (TestEnvironment): Expose the config JSON in the test environment.
2363 * public/include/report-processor.php:
2364 (ReportProcessor): Renamed name_to_aggregator now that it only contains ID.
2365 (ReportProcessor::__construct): No longer fetches the aggregator table. An equivalent work is done
2366 in newly added ensure_aggregators.
2367 (ReportProcessor::process): Calls ensure_aggregators which populates name_to_aggregator_id.
2368 (ReportProcessor::ensure_aggregators): Added. Add the builtin aggregators: Arithmetic, Geometric,
2369 Harmonic, and Total.
2370 (TestRunsGenerator): Renamed name_to_aggregator now that it only contains ID.
2371 (TestRunsGenerator::__construct):
2372 (TestRunsGenerator::add_aggregated_metric): Don't include aggregator_definition here since it's
2373 never used now that all the aggregations are done natively in PHP.
2374 (TestRunsGenerator::$aggregators): Added. We don't include SquareSum since it's only used for
2375 computing run_square_sum_cache in test_runs table and it's useless elsewhere.
2376 (TestRunsGenerator::aggregate_values): Add a comment about that.
2378 * tests/api-report.js: Updated a test case to reflect the change.
2380 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2382 Perf dashboard JSON API should fail gracefully when postgres is down
2383 https://bugs.webkit.org/show_bug.cgi?id=152812
2385 Reviewed by Chris Dumez.
2387 Even though all JSON APIs returned DatabaseConnectionFailure as the status when Database::connect
2388 returned a falsy value, PHP was spitting out warnings and producing HTTP responses that cannot be
2389 parsed as a JSON when pg_connect failed.
2391 Fixed the bug by suppressing warning messages in pg_connect.
2393 * public/include/db.php:
2394 (Database::connect): Use '@' prefix to suppress warning messages.
2396 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2398 Perf dashboard should auto-generate manifest file when one is missing
2399 https://bugs.webkit.org/show_bug.cgi?id=152813
2401 Reviewed by Chris Dumez.
2403 When /data/manifest.json is missing, fall back to newly added /api/manifest instead of
2404 silently failing to show the UI. This will make the initial setup easier.
2406 * public/api/manifest.php: Added.
2408 * public/include/manifest.php:
2409 (Manifest::manifest): Added.
2410 * public/v3/main.js:
2412 (didFetchManifest): Extracted from fetchManifest.
2414 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2416 Commit another forgotten change, this time, for r194653.
2418 * public/v3/models/measurement-set.js:
2420 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2422 The sampling of time series on v3 UI is too aggressive
2423 https://bugs.webkit.org/show_bug.cgi?id=152804
2425 Reviewed by Chris Dumez.
2427 Fixed a bug that we were always halving the number of data points in _sampleTimeSeries
2428 and increased the number of data points allowed to make the sampling less aggressive.
2430 * public/v3/components/time-series-chart.js:
2431 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Increase the number of maximum points
2432 to 2x the number of pixels divided by the radius of each point.
2433 (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Changed the semantics of endIndex
2434 to mean the index after the last point and renamed it to indexAfterEnd.
2435 (TimeSeriesChart.prototype._sampleTimeSeries): Fixed a bug that this code always coerced two
2436 data points into one sampled data point despite of the fact i and j are sufficiently apart
2437 since data[j].time - data[i].time > timePerSample by definition.
2439 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2441 Commit the forgotten change for r194651.
2443 * public/v3/pages/domain-control-toolbar.js:
2444 (DomainControlToolbar.prototype.setStartTime):
2446 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2448 The right hand side of main chart appears to be cut off as you zoom out on v3 UI
2449 https://bugs.webkit.org/show_bug.cgi?id=152778
2451 Reviewed by Antti Koivisto.
2453 Add a padding on x-axis after the end time to make the main chart more easily interactive.
2455 * public/v3/components/time-series-chart.js:
2456 (TimeSeriesChart.prototype._computeHorizontalRenderingMetrics):
2458 * public/v3/pages/page-with-charts.js:
2459 (PageWithCharts.mainChartOptions): Add a padding of 5px at the end of x-axis.
2461 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2463 v3 UI should use four sig-figs to label y-axis of the main charts
2464 https://bugs.webkit.org/show_bug.cgi?id=152779
2466 Reviewed by Antti Koivisto.
2468 Increase the number of significant figures used in the main charts to four as done in v2 UI.
2470 * public/v3/pages/chart-pane.js:
2471 (ChartPane.constructor): Create a formatter with four significant figures.
2472 * public/v3/pages/page-with-charts.js:
2473 (PageWithCharts.mainChartOptions): Increase the width of y-axis labels.
2475 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2477 v3 UI's time range slider is harder to use than that of v2 UI
2478 https://bugs.webkit.org/show_bug.cgi?id=152780
2480 Reviewed by Antti Koivisto.
2482 Improved the time range slider by using a cubic mapping to time range and providing a text field
2483 to directly edit the number of days to show.
2485 Now an user can enter the text mode to directly edit the number of days to show by clicking on
2486 the number of days (text field is always there with opacity=0).
2488 * public/v3/pages/charts-toolbar.js:
2489 (ChartsToolbar): Store the minimum and maximum number of days allowed. Also rename _inputElement
2490 to _slider and added a new type=number text field as _editor.
2491 (ChartsToolbar.prototype.render):
2492 (ChartsToolbar.prototype.setStartTime): Exit the text mode when the number of days is changed by
2493 an URL state transition (i.e. back/forward navigation).
2494 (ChartsToolbar.prototype._setInputElementValue): Added. Updates the values of _slider and _editor.
2495 (ChartsToolbar.prototype._enterTextMode): Added. Hide the elements used by the slider mode and
2496 show the text field.
2497 (ChartsToolbar.prototype._exitTextMode): Added. Does the opposite.
2498 (ChartsToolbar.prototype._sliderValueMayHaveChanged): Renamed from _inputValueMayHaveChanged.
2499 (ChartsToolbar.prototype._editorValueMayHaveChanged): Added. Similar to _sliderValueMayHaveChanged
2500 but also corrects the value of _editor if needed.
2501 (ChartsToolbar.prototype._callNumberOfDaysCallback): Extracted from _inputValueMayHaveChanged.
2502 Also fixed a bug that we didn't update the URL state when the change event was fired without
2503 modifying the effective number of days.
2504 (ChartsToolbar.cssTemplate): Tweaked the style to support the new mode. Also set a fixed width on
2505 the span showing the number of days in the slider mode.
2507 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2509 Zooming button is broken on v3 UI
2510 https://bugs.webkit.org/show_bug.cgi?id=152777
2512 Reviewed by Chris Dumez.
2514 Bring up the zoom button in z-index so that users can click it.
2516 * public/v3/components/interactive-time-series-chart.js:
2517 (InteractiveTimeSeriesChart.cssTemplate):
2519 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2521 v3 UI doesn't preserve the time range when charts page is opened from a dashboard
2522 https://bugs.webkit.org/show_bug.cgi?id=152776
2524 Reviewed by Chris Dumez.
2526 Fixed the bug by moving the construction of charts URL from DashboardPage.prototype.open to
2527 DashboardPage.prototype.render and re-rendering the entire page upon an URL state transition.
2529 * public/v3/pages/charts-page.js:
2530 (ChartsPage.createStateForDashboardItem): Takes the start time for the charts page.
2532 * public/v3/pages/dashboard-page.js:
2533 (DashboardPage.prototype.updateFromSerializedState): Merged _numberOfDaysDidChange and
2534 _updateChartsDomainFromToolbar into this function since they're not used elsewhere. Also re-render
2535 the entire page when transition between different number of days to show.
2536 (DashboardPage.prototype._numberOfDaysDidChange): Deleted.
2537 (DashboardPage.prototype._updateChartsDomainFromToolbar): Deleted.
2538 (DashboardPage.prototype.render): Construct URL for each charts here.
2539 (DashboardPage.prototype._createChartForCell): Don't construct URL here since this function is
2540 called once when the dashboard page is opened, and not when the time range is changed.
2542 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2544 Build fix for an old version of PHP after r194618.
2546 * public/api/measurement-set.php:
2548 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2550 A/B testing results should be visualized intuitively on v3 UI
2551 https://bugs.webkit.org/show_bug.cgi?id=152496
2553 Rubber-stamped by Chris Dumez.
2555 Add the "stacking block" view of A/B testing results to the analysis task page on v3 UI.
2557 The patch enhances JSON APIs at /api/analysis-task /api/measurement-set/ to reduce the number of
2558 HTTP requests, and adds two UI components: TestGroupResultsTable and AnalysisResultsViewer both
2559 of which inherits from an abstract superclass: ResultsTable.
2561 ResultsTable provides a tabular presentation of measured values in regular measurement sets and
2562 A/B testing results using groups of bar graphs created by BarGraphGroup. TestGroupResultsTable
2563 inherits from this class to display A/B testing configurations and the averaged results for each
2564 configuration, and AnalysisResultsViewer inherits from it to provide an intuitive visualization
2565 of the outcomes of all A/B testing results associated with a given analysis task.
2567 * public/api/analysis-tasks.php:
2568 (main): Add the capability to find the analysis task based on its build request.
2569 This allows /v3/#/analysis/task/?buildRequest=<id> to be hyperlinked on buildbot page.
2571 * public/api/measurement-set.php:
2572 (main): Removed the unused startTime and endTime, and added "analysisTask" to query parameters.
2573 (AnalysisResultsFetcher): Added. Used to fetch measured data associated with every build request
2574 on an analysis task.
2575 (AnalysisResultsFetcher::__construct):
2576 (AnalysisResultsFetcher::fetch): Unlike MeasurementSetFetcher, we fetch the list of commits and
2577 list of measurements separately since there will be a lot less builds and commits than measured
2578 data (since we're fetching measured values for all tests and their metrics).
2579 (AnalysisResultsFetcher::fetch_commits): Fetches commits.
2580 (AnalysisResultsFetcher::format_measurement): Like MeasurementSetFetcher::format_measurement but
2581 with config_type and config_metric since we're returning measured data for all metrics and test
2583 (AnalysisResultsFetcher::format_map): Similar to MeasurementSetFetcher::format_map.
2585 * public/v3/components/analysis-results-viewer.js: Added.
2586 (AnalysisResultsViewer): Added.
2587 (AnalysisResultsViewer.prototype.didUpdateResults): This callback is called by AnalysisTaskPage
2588 when A/B testing results become available.
2589 (AnalysisResultsViewer.prototype.render): Overrides ResultsTable's render to highlight the block
2590 representing the currently selected test group.
2592 (AnalysisResultsViewer.prototype.buildRowGroups): Creates a list of rows with "stacking blocks"
2593 that visualizes A/B testing results. The algorithm works as follows: 1. Create all table rows.
2594 2. Find which row is associated with each set in each test group. 3. Layout "blocks".
2596 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Collects root sets from all data
2597 in the measurement set as well as A/B testing **requests** (results may contain more repositories
2598 than requested but they aren't interesting for the purpose of visualizing results for the entire
2601 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Create table rows. First,
2602 create table rows for measurement set points that have a matching test group (i.e. either set A
2603 or set B of an A/B testing uses the same root set as a point). Second, insert a new row for each
2604 root set in each test group which didn't find a matching measurement set point. There is a little
2605 subtlety that some A/B testing may specify revisions for a subset of repositories and/or some A/B
2606 testing results may appear as if it goes back in time with respect to other A/B testing results.
2607 For example, consider creating two A/B test groups for WebKit changes and OS changes separately.
2608 There could be no coherent linearization of those two A/B testing in which both WebKit and OS
2609 versions move forward.
2611 (AnalysisResultsViewer.RootSetInTestGroup): Added. Represents a pair (test group, root set) since
2612 a root set could be shared by multiple test groups.
2613 (AnalysisResultsViewer.TestGroupStackingBlock): Added. A stacked block representing a test group.
2614 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex): Associates a row number with
2615 either set A or set B.
2616 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Creates a table cell
2618 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Returns true if this test group
2619 has failed and this block should look "thin" without any label.
2620 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus): Computes the
2621 status for this test group.
2623 (AnalysisResultsViewer.TestGroupStackingGrid): Added. AnalysisResultsViewer uses this class to
2624 layout blocks representing test groups.
2625 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.insertBlockToColumn): Inserts a new block
2626 to layout. We keep all test groups doing the same A/B test next to each other.
2627 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.layout): Layouts each block / test group
2628 in the order they are created.
2629 (AnalysisResultsViewer.TestGroupStackingGrid.prototype._layoutBlock): Places the block in the
2630 left-most column that can accommodate it while avoiding columns of a different thin-ness. A column
2631 is thin if its A/B testing has failed, and not thin otherwise.
2632 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.createCellsForRow): Creates table cells for
2633 a given row. For each column, generate a table cell if we're in the first row and the first block
2634 starts in a later row, a block starts in the current row, or the last block ended in the previous
2635 row and the next block or the last row appears later.
2637 * public/v3/components/bar-graph-group.js: Added. A component for showing a group of bar graphs.
2638 (BarGraphGroup): Added. Creates a group of bar graphs with the same value range. It's used by
2639 AnalysisResultsViewer and ResultsTable to show bar graphs to compare values.
2640 (SingleBarGraph): A component created and collectively controlled by BarGraphGroup.
2642 * public/v3/components/results-table.js: Added.
2643 (ResultsTable): An abstract superclass for TestGroupResultsTable and AnalysisResultsViewer.
2645 (ResultsTable.prototype.render): Renders the table. 1. Call "buildRowGroups()" implemented by
2646 a subclass to obtain the list of rows. 2. Compute the list of repositories to show. 3. For each
2647 cell in the table, compute the number of rows to show the same value (for rowspan). 4. Render the
2648 table with an extra list of repositories if exists.
2650 (ResultsTable.prototype._computeRepositoryList): Compute the list of repositories to list
2651 revisions in the table. Omit repositories not present in any row or for which all rows have the
2652 same revision. In the latter case, include it in the extra repositories listed below the table.
2653 This minimizes the amount of redundant information presented to the user.
2655 (ResultsTableRow): Added. Represents a single row in the table. ResultsTable constructs necessary
2656 table cells to tabulate the associated root sets, and shows the associated result using a grouped
2657 bar graph. Additional columns are used by AnalysisResultsViewer to show stacked blocks for A/B
2660 * public/v3/components/test-group-results-table.js: Added.
2661 (TestGroupResultsTable):
2662 (TestGroupResultsTable.prototype.didUpdateResults):
2663 (TestGroupResultsTable.prototype.setTestGroup):
2664 (TestGroupResultsTable.prototype.heading):
2665 (TestGroupResultsTable.prototype.render):
2666 (TestGroupResultsTable.prototype.buildRowGroups):
2668 * public/v3/index.html:
2669 * public/v3/models/analysis-results.js: Added.
2670 (AnalysisResults): Added. Like MeasurementSet, this class represents a set of measured values
2671 associated with a given analysis task.
2672 (AnalysisResults.prototype.find): Returns a measured valued for a given build and metric.
2673 (AnalysisResults.prototype.add): Adds a new measured value. Used by AnalysisResults.fetch.
2674 (AnalysisResults.fetch): Fetches data and creates AnalysisResults for a given analysis task.
2676 * public/v3/models/analysis-task.js:
2677 (AnalysisTask.prototype.startMeasurementId): Added.
2678 (AnalysisTask.prototype.endMeasurementId): Added.
2679 (AnalysisTask.fetchByBuildRequestId): Added.
2680 (AnalysisTask._fetchSubset): Uses DataModelObject.cachedFetch.
2682 * public/v3/models/build-request.js: Added.
2683 (BuildRequest): Added. Represents a single A/B testing request associated with a test group.
2685 * public/v3/models/builder.js:
2686 (Build): Added. Represents a build associated with a given A/B testing result.
2688 * public/v3/models/commit-log.js:
2689 (CommitLog): Made this class inherit from DataModelObject.
2690 (CommitLog.ensureSingleton): Added. Finds the singleton object created for a given revision
2691 in the specified repository. This helps RootSet and other classes compare commits fast.
2692 (CommitLog.prototype.repository): Added.
2693 (CommitLog.fetchBetweenRevisions): Uses CommitLog.ensureSingleton.
2695 * public/v3/models/data-model.js:
2697 (DataModelObject.namedStaticMap): Added.
2698 (DataModelObject.ensureNamedStaticMap): Renamed from namedStaticMap instead of implicitly
2699 assuming that the non-static version always creates the map.
2700 (DataModelObject.prototype.namedStaticMap): Added.
2701 (DataModelObject.cachedFetch): Extracted from AnalysisTask._fetchSubset so that TestGroup's
2702 fetchByTask could also use it.
2705 * public/v3/models/measurement-adaptor.js: Added.
2706 (MeasurementAdaptor): Extracted from MeasurementCluster. This class is responsible for
2707 re-formatting the data received via /api/measurement-set JSON API inside the v3 UI.
2708 (MeasurementAdaptor.prototype.extractId): Added.
2709 (MeasurementAdaptor.prototype.adoptToAnalysisResults): Added. Used by AnalysisResults.
2710 (MeasurementAdaptor.aggregateAnalysisResults): Added. Used by TestGroupResultsTable to
2711 aggregate results for each test configuration; e.g. computing the average for set A.
2712 (MeasurementAdaptor.prototype.adoptToSeries): Extracted from MeasurementCluster.addToSeries.
2713 Added rootSet() to each point. This allows AnalysisResultsViewer to compare them against root
2714 sets associated with A/B testing results.
2715 (MeasurementAdaptor.computeConfidenceInterval): Moved from MeasurementCluster.
2717 * public/v3/models/measurement-cluster.js:
2718 (MeasurementCluster):
2719 (MeasurementCluster.prototype.addToSeries):
2721 * public/v3/models/repository.js:
2722 (Repository.prototype.hasUrlForRevision): Added.
2724 * public/v3/models/root-set.js: Added.
2725 (RootSet): Added. Represents a set of commits in measured results.
2726 (MeasurementRootSet): Added. Ditto for results associated with A/B testing.
2728 * public/v3/models/test-group.js: Added.
2729 (TestGroup): Added. Represents a A/B testing on analysis task.
2730 (TestGroup.prototype.createdAt): Added.
2731 (TestGroup.prototype.buildRequests): Returns the list of build requests associated with this
2733 (TestGroup.prototype.addBuildRequest): Added. Used by BuildRequest's constructor to associate
2734 itself with this group.
2735 (TestGroup.prototype.didSetResult): Added. Called by BuildRequest.setResult when measured
2736 values are fetched and associated with a build request in this group.
2738 * public/v3/models/test.js:
2741 * public/v3/pages/analysis-task-page.js:
2743 (AnalysisTaskPage.prototype.updateFromSerializedState): Fetch the analysis task, test groups
2744 associated with it, and all A/B testing results based on the task id or the build request id
2745 specified in the URL.
2746 (AnalysisTaskPage.prototype._didFetchTask): Added. Start fetching the measured data. This is
2747 the data on charts page for which this analysis task was created, not results of A/B testing.
2748 (AnalysisTaskPage.prototype._didFetchMeasurement): Added. Display the fetched data in a table
2749 inside AnalysisResultsViewer.
2750 (AnalysisTaskPage.prototype._didFetchTestGroups): Added. Display the list of A/B test groups
2751 as well as the results of the first A/B testing.
2752 (AnalysisTaskPage.prototype._didFetchAnalysisResults): Added.
2753 (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Added. Once both the analysis task,
2754 A/B test groups as well as their results are fetched, update build requests in each test group
2756 (AnalysisTaskPage.prototype.render): Show the list of test groups and highlight the currently
2758 (AnalysisTaskPage.prototype._showTestGroup): Added. A callback used by AnalysisResultsViewer
2759 and TestGroupResultsTable to notify this class when the user selects a new test group.
2760 (AnalysisTaskPage.htmlTemplate): Updated the template.
2761 (AnalysisTaskPage.cssTemplate): Ditto.
2763 * public/v3/pages/charts-page.js:
2764 (ChartsPage.createStateForAnalysisTask): Added. Creates a URL state object for opening a chart
2765 associated with an analysis task.
2767 2015-12-22 Ryosuke Niwa <rniwa@webkit.org>
2769 Analysis task page is slow to load
2770 https://bugs.webkit.org/show_bug.cgi?id=152517
2772 Reviewed by Andreas Kling.
2774 The slowness comes from r194130 which made the JSON API at /api/analysis-tasks to report the start
2775 and the end of each analysis task. This query was adding ~2s to the total JSON generation time.
2777 Cache these values on analysis_task table since they never change once an analysis task is created.
2779 * init-database.sql: Added columns task_start_run_time and task_end_run_time to analysis_task table.
2780 Also added the missing drop statements at the top.
2782 * public/api/analysis-tasks.php:
2783 (fetch_and_push_bugs_to_tasks): Don't fetch the latest commit time of the start and the end.
2784 (format_task): Report task_start_run_time and task_end_run_time as startRunTime and endRunTime.
2786 * public/privileged-api/create-analysis-task.php:
2787 (main): Set start_run_time and end_run_time when creating an analysis task.
2788 (time_for_run): Added.
2790 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2792 v3 UI shouldn't open/close pane selector by mouseenter/leave
2793 https://bugs.webkit.org/show_bug.cgi?id=152399
2795 Reviewed by Andreas Kling.
2797 Removed the code to open and close the pane selector by mouseenter and mouseleave
2798 since multiple people have complained about the behavior.
2800 * public/v3/pages/charts-toolbar.js:
2801 (ChartsToolbar): Removed the event listeners.
2802 (ChartsToolbar.prototype._addPane): Don't close the pane selector when adding a new pane
2803 to better support the use case of adding multiple panes.
2804 (ChartsToolbar.cssTemplate): Tweaked CSS.
2806 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2808 Popover for analysis tasks shows up at the left edge of annotation bars in the v3 UI
2809 https://bugs.webkit.org/show_bug.cgi?id=152389
2811 Reviewed by Darin Adler.
2813 Compute the x coordinate of the popover from the center of each annotation bar.
2815 Also adjust the x coordinate to keep the popover within the charts.
2817 * public/v3/components/interactive-time-series-chart.js:
2818 (InteractiveTimeSeriesChart.prototype._renderChartContent):
2820 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2822 Dashboard charts should have uniform widths on v3 UI
2823 https://bugs.webkit.org/show_bug.cgi?id=152395
2825 Reviewed by Chris Dumez.
2827 Fix the bug by applying table-layout: fixed on the dashboard table.
2829 * public/v3/pages/dashboard-page.js:
2830 (DashboardPage.prototype.render): Added header-column as a class name to explicitly set the header column with.
2831 (DashboardPage.cssTemplate): Adjusted CSS accordingly.
2833 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2835 Closing a pane on v3 UI always closes the last pane
2836 https://bugs.webkit.org/show_bug.cgi?id=152388
2838 Reviewed by Chris Dumez.
2840 The bug was caused by closePane being called without arguments. (The first argument to bind is "this" value.)
2841 Fixed it by passing in "this" pane object to the first argument.
2843 * public/v3/pages/chart-pane.js:
2846 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2848 Perf Dashboard v3 UI doesn't show recent data points on v2 UI
2849 https://bugs.webkit.org/show_bug.cgi?id=152368
2851 Reviewed by Chris Dumez.
2853 The bug was caused by the last modified date in measurement set JSON being a string instead of a POSIX timestamp,
2854 which prevented the v3 UI from invalidating the cache. Specifically, the following boolean logic always evaluated
2855 to false because +data['lastModified'] was NaN in MeasurementSet.prototype._fetch (/v3/models/measurement-set.js):
2857 !clusterEndTime && useCache && +data['lastModified'] < self._lastModified
2859 Fixed the bug by calling Database::to_js_time on the last modified date fetched from the database.
2861 * public/api/measurement-set.php:
2862 (MeasurementSetFetcher::fetch_config_list): Convert the string returned by the database to a POSIX timestamp.
2863 * tests/api-measurement-set.js: Added a test to ensure the last modified date in JSON is numeric. Since the value
2864 of the last modified date depends on when tests run, we can't assert it to be a certain value.
2866 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2868 v3 UI should show and link the build number on charts page
2869 https://bugs.webkit.org/show_bug.cgi?id=152359
2871 Reviewed by Chris Dumez.
2873 Show the hyperlinked build number in the v3 UI.
2875 * public/v3/models/builder.js:
2876 (Builder): Renamed _buildURL to _buildUrlTemplate.
2877 (Builder.prototype.urlForBuild): Added.
2878 * public/v3/pages/chart-pane-status-view.js:
2879 (ChartPaneStatusView):
2880 (ChartPaneStatusView.prototype.render): Added the code to render hyperlinked build number when one is available.
2881 (ChartPaneStatusView.prototype.computeChartStatusLabels): Store currentPoint's measurement object as _buildInfo
2882 if the current point is set by an indicator (not by a selection).
2884 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2886 v3 dashboard doesn't stretch charts to fill the screen
2887 https://bugs.webkit.org/show_bug.cgi?id=152354
2889 Reviewed by Chris Dumez.
2891 The bug was caused by a workaround to avoid canvas stretching table cell too much.
2893 Fix the problem instead by making the canvas absolutely positioned inside the "time-series-chart" element
2894 so that it does not contribute to the intrinsic/natural width of the cell.
2896 * public/v3/components/time-series-chart.js:
2897 (TimeSeriesChart.prototype._ensureCanvas): Make the canvas absolutely positioned inside the shadow root.
2898 (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Use the container element's size now that
2899 the canvas does not resize with it.
2900 * public/v3/pages/dashboard-page.js:
2901 (DashboardPage.cssTemplate): Updated the CSS so that the chart stretches all the way.
2903 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2905 The chart status on v3 UI sometimes show wrong revision ranges
2906 https://bugs.webkit.org/show_bug.cgi?id=152331
2908 Reviewed by Chris Dumez.
2910 The bug was caused by the status view not taking the data sampling that happens in TimeSeriesChart into account
2911 when finding the previous point. Take this into account by using InteractiveTimeSeries.currentPoint(-1) which
2912 finds the sampled data point immediately preceding the current point (at which the indicator is shown).
2914 * public/v3/components/chart-status-view.js:
2915 (ChartStatusView.prototype.updateStatusIfNeeded):
2917 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2919 Perf dashboard's cycler page should use v3 UI
2920 https://bugs.webkit.org/show_bug.cgi?id=152324
2922 Reviewed by Chris Dumez.
2924 Use the v3 UI in cycler.html after r194130.
2926 * public/cycler.html:
2927 * public/v3/index.html: Removed the reference to a non-existent platform-selector.js.
2929 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2931 Add v3 UI to perf dashboard
2932 https://bugs.webkit.org/show_bug.cgi?id=152311
2934 Reviewed by Chris Dumez.
2936 Add the third iteration of the perf dashboard UI. UI for viewing and modifying analysis tasks is coming soon.
2937 The v3 UI is focused on speed, and removes all third-party script dependencies including jQuery, d3, and Ember.
2938 Both the DOM-based UI and graphing are implemented manually.
2941 The entire app is structured using new component library implemented in components/base.js. Each component is
2942 an instance of a subclass of ComponentBase which owns a single DOM element. Each subclass may supply static
2943 methods named htmlTemplate and cssTemplate as the template for a component instance. ComponentBase automatically
2944 clones the templates inside the associated element (or its shadow root on the supported browsers). Each subclass
2945 must supply a method called "render()" which constructs and updates the DOM as needed.
2947 There is a special component called Page, which represents an entire page. Each Page is opened by PageRouter's
2948 "route()" function. Each subclass of Page supplies "open()" for initialization and "updateFromSerializedState()"
2949 for a hash URL transition.
2952 The key feature of the v3 UI is the split of time series into chunks called clusters (see r194120). On an internal
2953 instance of the dashboard, the v2 UI downloads 27MB of data whereas the same page loads only 3MB of data in the v3.
2954 The key logic for fetching time series in chunks is implemented by MeasurementSet in /v3/models/measurement-set.js.
2955 We first fetch the cached primary cluster (the cluster that contains the newest data) at:
2956 /data/measurement-set-<platform-id>-<metric-id>.json
2958 If that's outdated according to lastModified in manifest.json, then we immediately re-fetch the primary cluster at:
2959 /api/measurement-set/?platform=<platform-id>&metric=<metric-id>
2961 Once the up-to-date primary cluster is fetched, we fetch all "secondary" clusters. For each cluster being fetched,
2962 including the primary, we invoke registered callbacks.
2965 In addition, the v3 UI reduces the initial page load time by loading a single bundled JS file generated by
2966 tools/bundle-v3-scripts.py. index.html has a fallback to load all 44 JS files individually during development.
2968 * public/api/analysis-tasks.php:
2969 (fetch_and_push_bugs_to_tasks): Added the code to fetch start and end run times. This is necessary in V3 UI
2970 because no longer fetch the entire time series. See r194120 for the new measurement set JSON API.
2971 (format_task): Compute the category of an analysis task based on "result" value. This will be re-vamped once
2972 I add the UI for the analysis task page in v3.
2974 * public/include/json-header.php:
2975 (require_format): CamelCase the name.
2976 (require_match_one_of_values): Ditto.
2977 (validate_arguments): Renamed from require_existence_of and used in measurement-set.php landed in r194120.
2980 * public/v3/components: Added.
2982 * public/v3/components/base.js: Added.
2983 (ComponentBase): The base component class.
2984 (ComponentBase.prototype.element): Returns the DOM element associated with the DOM element.
2985 (ComponentBase.prototype.content): Returns the shadow root if one exists and the associated element otherwise.
2986 (ComponentBase.prototype.render): To be implemented by a subclass.
2987 (ComponentBase.prototype.renderReplace): A helper function to "render" DOM contents.
2988 (ComponentBase.prototype._constructShadowTree): Called inside the constructor to instantiate the templates.
2989 (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Instantiates components referred by
2990 its element name inside the instantiated content.
2991 (ComponentBase.isElementInViewport): A helper function. Returns true if the element is in the viewport and it has
2992 non-zero width and height.
2993 (ComponentBase.defineElement): Defines a custom element that can be automatically instantiated from htmlTemplate.
2994 (ComponentBase.createElement): A helper function to create DOM tree to be used in "render()" method.
2995 (ComponentBase._addContentToElement): A helper for "createElement".
2996 (ComponentBase.createLink): A helper function to create a hyperlink or another clickable element (via callback).
2997 (ComponentBase.createActionHandler): A helper function to create an event listener that prevents the default action
2998 and stops the event propagation.
3000 * public/v3/components/button-base.js: Added.
3002 * public/v3/components/chart-status-view.js: Added.
3003 (ChartStatusView): A component that reports the current status of time-series-chart. It's subclasses by
3004 ChartPaneStatusView to provide additional information in the charts page's panes.
3006 * public/v3/components/close-button.js: Added.
3008 * public/v3/components/commit-log-viewer.js: Added.
3009 (CommitLogViewer): A component that lists commit revisions along with commit messages for a range of data points.
3011 * public/v3/components/interactive-time-series-chart.js: Added.
3012 (InteractiveTimeSeriesChart): A subclass of InteractiveTimeSeriesChart with interactivity (selection & indicator).
3013 Selection and indicator are mutually exclusive.
3015 * public/v3/components/pane-selector.js: Added.
3016 (PaneSelector): A component for selecting (platform, metric) pair to add in the charts page.
3018 * public/v3/components/spinner-icon.js: Added.
3020 * public/v3/components/time-series-chart.js: Added.
3021 (TimeSeriesChart): A canvas-based chart component without interactivity. It takes a source list and options as
3022 the constructor arguments. A source list is a list of measurement sets (measurement-set.js) with drawing options.
3023 This component fetches data via MeasurementSet.fetchBetween inside TimeSeriesChart.prototype.setDomain and
3024 progressively updates the charts as more data arrives. The canvas is updated on animation frame via rAF and all
3025 layout and rendering metrics are lazily computed in _layout. In addition, this component samples data before
3026 rendering the chart when there are more data points per pixel in _ensureSampledTimeSeries.
3028 * public/v3/index.html: Added. Loads bundled-scripts.js if it exists, or individual script files otherwise.
3030 * public/v3/instrumentation.js: Added. This class is used to gather runtime statistics of v3 UI. (It measures
3031 the performance of the perf dashboard UI).
3033 * public/v3/main.js: Added. Bootstraps the app.
3037 * public/v3/models: Added.
3038 * public/v3/models/analysis-task.js: Added.
3039 * public/v3/models/bug-tracker.js: Added.
3040 * public/v3/models/bug.js: Added.
3041 * public/v3/models/builder.js: Added.
3042 * public/v3/models/commit-log.js: Added.
3043 * public/v3/models/data-model.js: Added.
3044 (DataModelObject): The base class for various data objects that correspond to database tables. It supplies static
3045 hash map to find entries by id as well as other keys.
3046 (LabeledObject): A subclass of DataModelObject with the capability to find an object via its name.
3048 * public/v3/models/measurement-cluster.js: Added.
3049 (MeasurementCluster): Represents a single cluster or a chunk of data in a measurement set.
3051 * public/v3/models/measurement-set.js: Added.
3052 (MeasurementSet): Represents a measurement set.
3053 (MeasurementSet.findSet): Returns the singleton set given (metric, platform). We use singleton to avoid issuing
3054 multiple HTTP requests for the same JSON when there are multiple TimeSeriesChart that show the same graph (e.g. on
3055 charts page with overview and main charts).
3056 (MeasurementSet.prototype.findClusters): Finds the list of clusters to fetch in a given time range.
3057 (MeasurementSet.prototype.fetchBetween): Fetch clusters for a given time range and calls callback whenever new data
3058 arrives. The number of callbacks depends on the how many clusters need to be newly fetched.
3059 (MeasurementSet.prototype._fetchSecondaryClusters): Fetches non-primary (non-latest) clusters.
3060 (MeasurementSet.prototype._fetch): Issues a HTTP request to fetch a cluster.
3061 (MeasurementSet.prototype._didFetchJSON): Called when a cluster is fetched.
3062 (MeasurementSet.prototype._failedToFetchJSON): Called when the fetching of a cluster has failed.
3063 (MeasurementSet.prototype._invokeCallbacks): Invokes callbacks upon an approval of a new cluster.
3064 (MeasurementSet.prototype._addFetchedCluster): Adds the newly fetched cluster in the order.
3065 (MeasurementSet.prototype.fetchedTimeSeries): Returns a time series that contains data from all clusters that have
3067 (TimeSeries.prototype.findById): Additions to TimeSeries defined in /v2/data.js.
3068 (TimeSeries.prototype.dataBetweenPoints): Ditto.
3069 (TimeSeries.prototype.firstPoint): Ditto.
3071 * public/v3/models/metric.js: Added.
3072 * public/v3/models/platform.js: Added.
3073 * public/v3/models/repository.js: Added.
3074 * public/v3/models/test.js: Added.
3076 * public/v3/pages: Added.
3077 * public/v3/pages/analysis-category-page.js: Added. The "Analysis" page that lists the analysis tasks.
3078 * public/v3/pages/analysis-category-toolbar.js: Added. The toolbar to filter analysis tasks based on its category
3079 (unconfirmed, bisecting, identified, closed) and a keyword.
3081 * public/v3/pages/analysis-task-page.js: Added. Not implemented yet. It just has the hyperlink to the v2 UI.
3083 * public/v3/pages/chart-pane-status-view.js: Added.
3084 (ChartPaneStatusView): A subclass of ChartStatusView used in the charts page. In addition to the current value,
3085 comparison to baseline/target, it shows the list of repository revisions (e.g. WebKit revision, OS version).
3087 * public/v3/pages/chart-pane.js: Added.
3088 (ChartPane): A component a pane in the charts page. Each pane has the overview chart and the main chart. The zooming
3089 is synced across all panes in the charts page.
3091 * public/v3/pages/charts-page.js: Added. Charts page.
3092 * public/v3/pages/charts-toolbar.js: Added. The toolbar to set the number of days to show. This affects the overview
3093 chart's domain in each pane.
3095 * public/v3/pages/create-analysis-task-page.js: Added.
3096 (CreateAnalysisTaskPage): A page that gets shown momentarily while creating a new analysis task.
3098 * public/v3/pages/dashboard-page.js: Added. A dashboard page.
3099 * public/v3/pages/dashboard-toolbar.js: Added. Its toolbar with buttons to select the number of days to show.
3100 * public/v3/pages/domain-control-toolbar.js: Added. An abstract superclass of charts and dashboard toolbars.
3102 * public/v3/pages/heading.js: Added. A component for displaying the header and toolbar, if exists, on each page.
3103 * public/v3/pages/page-router.js: Added. This class is responsible for updating the URL hashes as well as opening
3104 and updating each page when the hash changes (via back/forward navigation).
3105 * public/v3/pages/page-with-charts.js: Added. An abstract subclass of page used by dashboards and charts page.
3106 Supplies helper functions for creating TimeSeriesChart options.
3107 * public/v3/pages/page-with-heading.js: Added. An abstract subclass of page that uses the heading component.
3108 * public/v3/pages/page.js: Added. The Page component.
3109 * public/v3/pages/toolbar.js: Added. An abstract toolbar component.
3111 * public/v3/remote.js: Added.
3112 (getJSON): Fetches JSON from the remote server.
3113 (getJSONWithStatus): Ditto. Rejects the response if the status is not "OK".
3114 (PrivilegedAPI.sendRequest): Posts a HTTP request to a privileged API in /privileged-api/.
3115 (PrivilegedAPI.requestCSRFToken): Creates a new CSRF token to request a privileged API post.
3117 * tools/bundle-v3-scripts.py: Added.
3118 (main): Bundles js files together and minifies them by jsmin.py for the v3 UI. Without this script, we're forced to
3119 download 44 JS files or making each JS file contain multiple classes.
3121 * tools/jsmin.py: Copied from WebInspector / JavaScriptCore code.
3123 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
3125 Fix v2 UI after r194093.
3127 * public/v2/data.js:
3129 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
3131 Add /api/measurement-set for v3 UI
3132 https://bugs.webkit.org/show_bug.cgi?id=152312
3134 Rubber-stamped by Chris Dumez.
3136 The new API JSON allows the front end to fetch measured data in chunks called a "cluster" as specified
3137 in config.json for each measurement set specified by the pair of a platform and a metric.
3139 When the front end needs measured data in a given time range (t_0, t_1) for a measurement set, it first
3140 fetches the primary cluster by /api/measurement-set/?platform=<platform-id>&metric=<metric-id>.
3141 The primary cluster is the last cluster in the set (returning the first cluster here is not useful
3142 since we don't typically show very old data), and provides the information needed to fetch other clusters.
3144 Fetching the primary cluster also creates JSON files at:
3145 /data/measurement-set-<platform-id>-<metric-id>-<cluster-end-time>.json
3146 to allow latency free access for secondary clusters. The front end code can also fetch the cache of
3147 the primary cluster at: /data/measurement-set-<platform-id>-<metric-id>.json.
3149 Because the front end code has to behave as if all data is fetched, each cluster contains one data point
3150 immediately before the first data point and one immediately after the last data point. This avoids having
3151 to fetch multiple empty clusters for manually specified baseline data. To support this behavior, we generate
3152 all clusters for a given measurement set at once when the primary cluster is requested.
3154 Furthermore, all measurement sets are divided at the same time into clusters so that the boundary of clusters
3155 won't shift as more data are reported to the server.
3157 * config.json: Added clusterStart and clusterSize as options.
3158 * public/api/measurement-set.php: Added.
3160 (MeasurementSetFetcher::__construct):
3161 (MeasurementSetFetcher::fetch_config_list): Finds configurations that belongs to this (platform, metric) pair.
3162 (MeasurementSetFetcher::at_end): Returns true if we've reached the end of all clusters for this set.
3163 (MeasurementSetFetcher::fetch_next_cluster): Generates the JSON data for the next cluster. We generate clusters
3164 in increasing chronological order (the oldest first and the newest last).
3165 (MeasurementSetFetcher::execute_query): Executes the main query.
3166 (MeasurementSetFetcher::format_map): Returns the mapping of a measurement field to an array index. This removes
3167 the need to have key names for each measurement and reduces the JSON size by ~10%.
3168 (MeasurementSetFetcher::format_run): Creates an array that contains data for a single measurement. The order
3169 matches that of keys in format_map.
3170 (MeasurementSetFetcher::parse_revisions_array): Added. Copied from runs.php.
3171 * tests/api-measurement-set.js: Added. Added tests for /api/measurement-set.
3173 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3175 Using fake timestamp in OS version make some results invisible
3176 https://bugs.webkit.org/show_bug.cgi?id=152289
3178 Reviewed by Stephanie Lewis.
3180 Fix various bugs after r194088.
3182 * public/api/commits.php:
3183 (format_commit): Include the commit order.
3184 * public/v2/data.js:
3185 (CommitLogs._cacheConsecutiveCommits): Sort by commit order when commit time is missing.
3186 * tools/pull-os-versions.py:
3187 (OSBuildFetcher._assign_order): Use integer instead of fake time for commit order.
3188 (available_builds_from_command): Exit early when an exception is thrown.
3190 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3192 Fix a typo in the previous commit.
3194 * public/include/report-processor.php:
3196 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3198 Build fix after r192965. Suppress a warning about log being referred to as a closure variable.
3200 * public/include/report-processor.php:
3202 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3204 Using fake timestamp in OS version make some results invisible
3205 https://bugs.webkit.org/show_bug.cgi?id=152289
3207 Reviewed by Stephanie Lewis.
3209 Added commit_order column to explicitly order OS versions. This fixes the bug whereby which
3210 baseline results reported with only OS versions are shown with x coordinate set to 10 years ago.
3212 To migrate the existing database, run:
3213 ALTER TABLE commits ADD COLUMN commit_order integer;
3214 CREATE INDEX commit_order_index ON commits(commit_order);
3216 Then for each repository $1,
3217 UPDATE commits SET (commit_time, commit_order) = (NULL, CAST(EXTRACT(epoch from commit_time) as integer))
3218 WHERE commit_repository = $1;
3221 * init-database.sql: Added the column.
3222 * public/api/commits.php:
3223 (fetch_commits_between): Use commit_order to order commits when commit_time is missing.
3224 * public/api/report-commits.php:
3225 (main): Set commit_order.
3226 * tools/pull-os-versions.py:
3227 (OSBuildFetcher.fetch_and_report_new_builds):
3228 (OSBuildFetcher._assign_order): Renamed from _assign_fake_timestamps. Set the order instead of a fake timestmap.
3230 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3232 Perf dashboard can't merge when the destination platform is missing baseline/target
3233 https://bugs.webkit.org/show_bug.cgi?id=152286
3235 Reviewed by Stephanie Lewis.
3237 The bug was caused by the query to migrate test configurations to new platform checking
3238 configuration type and metric separately; that is, it assumes the configuration exists
3239 only if either the same type or the same metric exists in the destination.
3241 Fixed the bug by checking both conditions simultaneously for each configuration.
3243 * public/admin/platforms.php:
3244 * tests/admin-platforms.js: Added a test.
3246 2015-12-11 Ryosuke Niwa <rniwa@webkit.org>
3248 Perf dashboard's buildbot sync config JSON duplicates too much information
3249 https://bugs.webkit.org/show_bug.cgi?id=152196
3251 Reviewed by Stephanie Lewis.
3253 Added shared, per-builder, and per-test (called type) configurations.
3255 * tools/sync-with-buildbot.py:
3257 (load_config.merge):
3259 2015-12-02 Ryosuke Niwa <rniwa@webkit.org>
3261 Perf dashboard should avoid overflow during geometric mean computation
3262 https://bugs.webkit.org/show_bug.cgi?id=151773
3264 Reviewed by Chris Dumez.
3266 * public/include/report-processor.php:
3268 2015-11-30 Ryosuke Niwa <rniwa@webkit.org>
3270 Perf dashboard should extend baseline and target to the future
3271 https://bugs.webkit.org/show_bug.cgi?id=151511
3273 Reviewed by Darin Adler.
3275 * public/v2/data.js:
3276 (RunsData.prototype.timeSeriesByCommitTime): Added extendToFuture as an argument.
3277 (RunsData.prototype.timeSeriesByBuildTime): Ditto.
3278 (RunsData.prototype._timeSeriesByTimeInternal): Ditto.
3279 (TimeSeries): Add a new point to the end if extendToFuture is set and the series is not empty.
3280 * public/v2/manifest.js:
3281 (App.Manifest._formatFetchedData): Set extendToFuture to true for baselines and targets.
3283 2015-11-30 Ryosuke Niwa <rniwa@webkit.org>
3285 Perf dashboard should always show comparison to baseline and target even if one is missing
3286 https://bugs.webkit.org/show_bug.cgi?id=151510
3288 Reviewed by Darin Adler.
3290 Show the comparison status against the baseline when baseline is present but target is missing.
3292 To make the code more readable, this patch splits the logic into three cases:
3293 1. Both baseline and target are present
3294 2. Only baseline is present
3295 3. Only target is present
3297 Also extracted a helper function to construct the label.
3300 (.labelForDiff): Added.
3301 (App.Pane.computeStatus):
3303 2015-11-23 Commit Queue <commit-queue@webkit.org>
3305 Unreviewed, rolling out r192716 and r192717.
3306 https://bugs.webkit.org/show_bug.cgi?id=151582
3308 The patch was incorrect. We always need at least one data
3309 point in each configuration (Requested by rniwa on #webkit).
3311 Reverted changesets:
3313 "Perf dashboard's should not include results more than 366
3315 https://bugs.webkit.org/show_bug.cgi?id=151529
3316 http://trac.webkit.org/changeset/192716
3318 "Build fix for old version of PHP."
3319 http://trac.webkit.org/changeset/192717
3321 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3323 Build fix for old version of PHP.
3325 * public/api/runs.php:
3327 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3329 Perf dashboard's should not include results more than 366 days old in JSON
3330 https://bugs.webkit.org/show_bug.cgi?id=151529
3332 Reviewed by Timothy Hatcher.
3334 Don't return results more than 366 days old in /api/runs/ JSON API.
3335 This is a ~5% runtime improvement and reduces the JSON file size by 20-50% in the internal perf dashboard.
3337 * public/api/runs.php:
3338 (main): Added the support for "?noResults" to avoid echoing results. This is useful for debugging.
3339 Also instantiate RunsGenerator before issuing the query to find all configurations so that the runtime cost
3340 of doing so will be included in elapsedTime.
3341 (RunsGenerator::fetch_runs): Skip a row when its build and commit times are more than 366 days old.
3342 (RunsGenerator::format_run): Takes build_time and revisions as arguments since fetch_runs uses them now.
3343 (RunsGenerator::parse_revisions_array): Compute the max of commit times.
3345 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3347 Remove chartPointRadius from interactive chart component
3348 https://bugs.webkit.org/show_bug.cgi?id=151480
3350 Reviewed by Darin Adler.
3352 Replaced the parameter by CSS rules.
3354 * public/v2/chart-pane.css:
3356 (.chart .dot.foreground):
3357 (.chart .highlight):
3359 * public/v2/index.html:
3360 * public/v2/interactive-chart.js:
3361 (App.InteractiveChartComponent.Ember.Component.extend._constructGraphIfPossible):
3362 (App.InteractiveChartComponent.Ember.Component.extend._highlightedItemsChanged):
3364 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3366 Perf dashboard's runs API uses more than 128MB of memory
3367 https://bugs.webkit.org/show_bug.cgi?id=151478
3369 Reviewed by Andreas Kling.
3371 Don't fetch all query results at once to avoid using twice as much memory as needed.
3372 Use iterative API to format each result at a time.
3374 This change is also a 5% runtime performance gain.
3376 * public/api/runs.php:
3377 (RunsGenerator::__construct): Takes a Database instance instead of a list of configurations. The latter is
3378 no longer needed as we pass in each configuration type explicitly to fetch_runs.
3379 (RunsGenerator::fetch_runs): Renamed from add_runs since it now executes the database query via execute_query.
3380 Also moved the logic to compute the last modified time here.
3381 (RunsGenerator::execute_query): Moved from fetch_runs_for_config. Use Database::query instead of query_and_fetch_all.
3382 (RunsGeneratorForTestGroup):
3383 (RunsGeneratorForTestGroup::__construct):
3384 (RunsGeneratorForTestGroup::execute_query): Moved from fetch_runs_for_config_and_test_group.
3386 * public/include/db.php:
3387 (generate_data_file): Lock the file to avoid corruption.
3389 2015-11-19 Ryosuke Niwa <rniwa@webkit.org>
3391 Perf dashboard always fetches charts JSON twice
3392 https://bugs.webkit.org/show_bug.cgi?id=151483
3394 Reviewed by Andreas Kling.
3396 Only re-generate "runs" JSON via /api/runs/ when the cache doesn't exist in /data/ or the cached JSON is
3397 obsolete (shouldRefetch is set true) or corrupt (the second closure).
3402 2015-11-18 Ryosuke Niwa <rniwa@webkit.org>
3404 Internal perf dashboard takes forever to load
3405 https://bugs.webkit.org/show_bug.cgi?id=151430
3407 Rubber-stamped by Antti Koivisto.
3409 Fix a few performance problems with the perf dashboard v2 UI.
3412 (App.DashboardRow._createPane): Set "inDashboard" to true.
3413 (App.Pane._fetch): Immediately show the cached chart instead of waiting for the refetched data which invokes
3414 a PHP JSON API. Also don't fetch the analysis tasks when the chart is shown in the dashboard since we don't
3415 show annotate charts in the dashboard.
3417 2015-10-15 Ryosuke Niwa <rniwa@webkit.org>
3419 Unreviewed fix of a test after r190687.
3421 * tests/admin-regenerate-manifest.js:
3423 2015-10-12 Ryosuke Niwa <rniwa@webkit.org>
3425 Perf dashboard tools shouldn't require server credentials in multiple configuration files
3426 https://bugs.webkit.org/show_bug.cgi?id=149994
3428 Reviewed by Chris Dumez.
3430 Made detect-changes.js and pull-svn.py pull username and passwords from the server config JSON to reduce
3431 the number of JSON files that need to include credentials.
3433 Also made each script reload the server config after sleep to allow dynamic credential updates.
3435 In addition, change the server config JSON's format to include scheme, host, and port numbers separately
3436 instead of a url since detect-changes.js needs each value separately.
3438 This reduces the number of JSONs with credentials to two for our internal dashboard.
3440 * tools/detect-changes.js:
3441 (main): Added a property argument parsing. Now takes --server-config-json, --change-detection-config-json,
3442 and --seconds-to-sleep like other scripts.
3443 (parseArgument): Added.
3444 (fetchManifestAndAnalyzeData): Reload the server config JSON.
3445 (loadServerConfig): Added. Set settings.perfserver and settings.slave from the server config JSON. Also
3446 add settings.perfserver.host to match the old format.
3447 (configurationsForTesting): Fixed a bug that we throw an exception when a dashboard contains an empty cell.
3449 * tools/pull-os-versions.py:
3450 (main): Use load_server_config after each sleep.
3452 * tools/pull-svn.py:
3453 (main): Use load_server_config after each sleep.
3454 (fetch_commits_and_submit): Use the perf dashboard's auth as subversion credential when useServerAuth is set.
3456 * tools/sync-with-buildbot.py:
3457 (main): Use load_server_config after each sleep.
3460 (load_server_config): Extracted from python scripts. Computes server's url from scheme, host, and port number
3461 to match the old format python scripts except.
3463 2015-10-11 Ryosuke Niwa <rniwa@webkit.org>
3465 Build fix after r190817. Now that pull-os-versions store fake timestamps, we need to bypass timestamp
3466 checks for OS versions when bots try to report new results. Otherwise, we fail to process the reports
3467 with a MismatchingCommitTime error.
3469 * public/include/report-processor.php:
3470 (ReportProcessor::resolve_build_id):
3472 2015-10-08 Ryosuke Niwa <rniwa@webkit.org>
3474 Perf dashboard erroneously shows an old OS build in A/B testing range
3475 https://bugs.webkit.org/show_bug.cgi?id=149942
3477 Reviewed by Darin Adler.
3479 Ordering OS builds lexicologically turned out be a bad idea since 15A25 falls between 15A242 and 15A251.
3480 Use a fake/synthetic timestamp to force the commonly understood total order instead.
3482 Refactored pull-os-versions.py to share the server config JSON with other scripts. Also made the script
3483 support pulling multiple sources; e.g. both OS X and iOS.
3485 Also removed superfluous feature to submit results in chunks. The perf dashboard can handle thousands of
3486 revisions being submitted at once just fine.
3488 * public/api/commits.php:
3489 (main): A partial revert of r185574 since we no longer need to order builds lexicologically.
3491 * tools/pull-os-versions.py:
3492 (main): Takes --os-config-json, --server-config-json, and --seconds-to-sleep as arguments instead of
3493 a single --config argument to share the server config JSON with other scripts.
3494 (OSBuildFetcher): Extracted out of main. This class is instantiated for each OS kind (e.g. OS X).
3495 (OSBuildFetcher.__init__): Added.
3496 (OSBuildFetcher._fetch_available_builds): Extracted out of main. Fetches available builds from a website
3498 (OSBuildFetcher.fetch_and_report_new_builds): Extracted out of main. Submits the fetched builds after
3499 filtering out the ones we've already reported.
3500 (OSBuildFetcher._assign_fake_timestamps): Creates a fake timestamp to establish a total order amongst each
3501 OS X / iOS style build number such as 12A3456b.
3503 2015-10-08 Ryosuke Niwa <rniwa@webkit.org>
3505 pull-svn.py fails to sync revisions when SVN credentials is not setup
3506 https://bugs.webkit.org/show_bug.cgi?id=149941
3508 Reviewed by Chris Dumez.
3510 Added the support for specifying subversion credentials.
3512 Also added the support for pulling from multiple subversion servers. Subversion servers are specified
3513 in a JSON configuration file specified by --svn-config formatted as follows:
3518 "url": "http://svn.webkit.org/repository/webkit",
3519 "username": "webkitten",
3520 "password": "webkitten's password",
3521 "trustCertificate": true,
3522 "accountNameFinderScript":
3523 ["python", "/Volumes/Data/WebKit/Tools/Scripts/webkit-patch", "find-users"]
3528 In addition, refactored it to use the shared server config JSON for the dashboard access.
3530 * tools/pull-svn.py:
3531 (main): Now takes --svn-config-json, --server-config-json, --seconds-to-sleep and --max-fetch-count
3532 as required options instead of seven unnamed arguments.
3533 (fetch_commits_and_submit): Extracted from main. Fetches at most max_fetch_count new revisions from
3534 the subversion server, and submits them in accordance with server_config.
3535 (fetch_commit_and_resolve_author): Now takes a single repository dictionary instead of two separate
3536 arguments for name and URL to pass down the repository's authentication info to fetch_commit.
3537 (fetch_commit): Ditto. Add appropriate arguments when username and passwords are specified.
3538 (resolve_author_name_from_account): Use a list argument instead of a single string argument now that
3539 the argument comes from a JSON instead of sys.argv.
3541 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3543 Unreviewed race condition fix. Exit early when xScale or yScale is not defined.
3545 * public/v2/interactive-chart.js:
3546 (App.InteractiveChartComponent._updateRangeBarRects):
3548 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3550 Add a page that cycles through v2 dashboards
3551 https://bugs.webkit.org/show_bug.cgi?id=149907
3553 Reviewed by Chris Dumez.
3555 Add cycler.html that goes through each dashboard on v2 UI.
3557 This allows the dashboards to be cycled through on a TV screen.
3559 * public/cycler.html: Added.
3560 (loadURLAt): Appends a new iframe to load the next URL (i is the index of the dashboard to be shown)
3561 at the end of body. We don't immediately show the new iframe since it might take a while to load.
3562 (showNewFrameIfLoaded): Remove the current iframe and show the next iframe if the next dashboard has
3563 finished loading. We can't rely on DOMContentLoaded or load events because we use asynchronous XHR to
3564 load each chart's data. Instead, wait until some chart becomes available or fails to load and none of
3565 charts are still in progress to be shown.
3567 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3569 Allow custom revisions to be specified in A/B testing
3570 https://bugs.webkit.org/show_bug.cgi?id=149905
3572 Reviewed by Chris Dumez.
3574 Allow custom revision number on each "repository" when creating a test group.
3576 * public/v2/app.css:
3577 (form .analysis-group [name=customValue]): Added.
3580 (App.AnalysisTaskController._createConfiguration): Added "Custom" as a revision option.
3581 Also added point labels such as (point 3) on "None" for when some points are missing revision info.
3582 (App.AnalysisTaskController._labelForPoints): Extracted from _createConfiguration.
3583 (App.AnalysisTaskController.actions.createTestGroup): Respect the custom revision number when custom
3584 revision option is selected.
3586 * public/v2/index.html: Added a text field for specifying a custom revision number.
3588 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3590 Make the site name configurable in perf dashboard
3591 https://bugs.webkit.org/show_bug.cgi?id=149894
3593 Reviewed by Chris Dumez.
3595 Added "siteTitle" as a new configuration key to specify the site name.
3597 * public/include/db.php:
3598 (config): Now takes the default value as an argument.
3599 * public/include/manifest.php:
3600 (ManifestGenerator::generate): Include siteTitle in the manifest.
3601 * public/index.html: Update the title and the heading when the manifest is loaded.
3602 * public/v2/index.html: Use App.Manifest.siteTitle as the heading. document.title needs to be updated manually.
3603 * public/v2/manifest.js:
3604 (App.MetricSerializer.normalizePayload): Update document.title and App.Manifest.siteTitle.
3606 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3608 Perf dashboard doesn't show analysis tasks anchored at outliers
3609 https://bugs.webkit.org/show_bug.cgi?id=149870
3611 Reviewed by Chris Dumez.
3613 The bug was caused by the computation of start and end times of analysis tasks being dependent on
3614 time series provided to the interactive chart component even though they are already filtered.
3616 Since the interactive chart component shouldn't be messing with the underlying data models, moved
3617 the code to compute start and end times to App.Pane, to where it belongs, and made the moved code use
3618 the unfiltered time series newly exposed on ChartData.
3620 Also fixed a bug in fetch-from-remote.php which resulted in Ember endlessly fetching same JSON files.
3622 * public/admin/fetch-from-remote.php:
3623 (.): Use the full request URI for HTTP requests and caching. Otherwise, we're going to mix up caches
3624 and Ember can start hanging browsers (took me three hours to debug this).
3627 (App.Pane._showOutlierChanged): Added. Resets chartData when showOutlier flag has been changed.
3628 (App.Pane.fetchAnalyticRanges): The old code wasn't filtering analysis tasks by platforms and metrics
3629 at all since it relied on the server-side REST API to do the filtering, which I haven't implemented yet.
3630 Filter the results manually instead.
3631 (App.Pane.ranges): Moved the logic to compute startTime and endTime here from InteractiveChartComponent.
3632 (App.PaneController.toggleShowOutlier): Now that App.Pane responds to showOutlier changes, we don't
3633 need to call a private method on it.
3634 (App.AnalysisTaskController._chartDataChanged): When end points are not found, try showing outliers.
3635 This will cause chartData to be modified so just exit early and wait for getting called again.
3637 * public/v2/interactive-chart.js:
3638 (App.InteractiveChartComponent._rangesChanged): The code to compute start and end time has been moved
3641 * public/v2/manifest.js:
3642 (App.Manifest._formatFetchedData): Added unfiltered time series as new properties as they are now used
3643 to compute the end points of analysis tasks when their end points are outliers.
3645 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3647 Unreviewed. Fix a typo in r190645.
3649 * public/include/db.php:
3651 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3653 V2 UI shouldn't sort dashboards lexicologically
3654 https://bugs.webkit.org/show_bug.cgi?id=149856
3656 Reviewed by Chris Dumez.
3658 Don't sort the dashboards by name in App.Manifest.
3661 (App.IndexRoute.beforeModel): Don't transition to "undefined" (string) dashboard.
3662 * public/v2/manifest.js:
3663 (App.Manifest.._fetchedManifest):
3665 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3667 V2 UI fails to show the data for the very first point in charts
3668 https://bugs.webkit.org/show_bug.cgi?id=149857
3670 Reviewed by Chris Dumez.
3672 The bug was caused by seriesBetweenPoints returning null for when point.seriesIndex is 0.
3673 Explicitly check the type of this property instead.
3675 * public/v2/data.js:
3676 (TimeSeries.prototype.seriesBetweenPoints):
3678 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3680 Perf dashboard should have the capability to test local UI with production data
3681 https://bugs.webkit.org/show_bug.cgi?id=149834
3683 Reviewed by Chris Dumez.
3685 Added tools/run-with-remote-server.py which runs a local httpd server and pulls data from a remote server.
3687 * Install.md: Added the instruction on how to use the script. Also updated the remaining instructions
3689 * config.json: Added remote server configurations.