1 2016-04-13 Ryosuke Niwa <rniwa@webkit.org>
3 REGRESSION(r199444): Perf dashboard always fetches all measurement sets
4 https://bugs.webkit.org/show_bug.cgi?id=156534
6 Reviewed by Darin Adler.
8 The bug was cased by SummaryPage's constructor fetching all measurement sets. Since each page is always
9 constructed in main(), this resulted in all measurement sets being fetched on all pages.
11 * public/v3/pages/summary-page.js:
13 (SummaryPage.prototype.open): Fetch measurement set JSONs here.
14 (SummaryPage.prototype._createConfigurationGroup): Renamed from _createConfigurationGroupAndStartFetchingData.
16 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
18 Add a summary page to v3 UI
19 https://bugs.webkit.org/show_bug.cgi?id=156531
21 Reviewed by Stephanie Lewis.
23 Add new "Summary" page, which shows the average difference (better or worse) from the baseline across
24 multiple platforms and tests by a single number.
26 * public/include/manifest.php:
27 (ManifestGenerator::generate): Include "summary" in manifest.json.
28 * public/shared/statistics.js:
29 (Statistics.mean): Added.
30 (Statistics.median): Added.
31 * public/v3/components/ratio-bar-graph.js: Added.
32 (RatioBarGraph): Shows a horizontal bar graph that visualizes the relative difference (e.g. 3% better).
33 (RatioBarGraph.prototype.update):
34 (RatioBarGraph.prototype.render):
35 (RatioBarGraph.cssTemplate):
36 (RatioBarGraph.htmlTemplate):
37 * public/v3/index.html:
39 (main): Instantiate SummaryPage and add it to the navigation bar and the router.
40 * public/v3/models/manifest.js:
41 (Manifest._didFetchManifest): Let "summary" pass through from manifest.json to main().
42 * public/v3/models/measurement-set.js:
43 (MeasurementSet.prototype._failedToFetchJSON): Invoke the callback with an error or true in order for
44 the callback can detect a failure.
45 (MeasurementSet.prototype._invokeCallbacks): Ditto.
46 * public/v3/pages/charts-page.js:
47 (ChartsPage.createStateForConfigurationList): Added to add a hyperlink from summary page to charts page.
48 * public/v3/pages/summary-page.js: Added.
50 (SummaryPage.prototype.routeName): Added.
51 (SummaryPage.prototype.open): Added.
52 (SummaryPage.prototype.render): Added.
53 (SummaryPage.prototype._createConfigurationGroupAndStartFetchingData): Added.
54 (SummaryPage.prototype._constructTable): Added.
55 (SummaryPage.prototype._constructRatioGraph): Added.
56 (SummaryPage.htmlTemplate): Added.
57 (SummaryPage.cssTemplate): Added.
58 (SummaryPageConfigurationGroup): Added. Represents a set of platforms and tests shown in a single cell.
59 (SummaryPageConfigurationGroup.prototype.ratio): Added.
60 (SummaryPageConfigurationGroup.prototype.label): Added.
61 (SummaryPageConfigurationGroup.prototype.changeType): Added.
62 (SummaryPageConfigurationGroup.prototype.configurationList): Added.
63 (SummaryPageConfigurationGroup.prototype.fetchAndComputeSummary): Added.
64 (SummaryPageConfigurationGroup.prototype._computeSummary): Added.
65 (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio): Added. Invoked for each time series in
66 the set, and stores the computed ratio of the current values to the baseline in this._setToRatio.
67 The results are aggregated by _computeSummary as a single number later.
68 (SummaryPageConfigurationGroup._medianForTimeRange): Added.
69 (SummaryPageConfigurationGroup._fetchData): A thin wrapper to make MeasurementSet.fetchBetween promise
70 friendly since MeasurementSet doesn't support Promise at the moment (but it should!).
71 * server-tests/api-manifest.js: Updated a test case.
73 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
75 Make sync-buildbot.js fault safe
76 https://bugs.webkit.org/show_bug.cgi?id=156498
78 Reviewed by Chris Dumez.
80 Fixed a bug that sync-buildbot.js will continue to schedule build requests from multiple test groups
81 if multiple test groups are simultaneously in-progress on the same builder. Also fixed a bug that if
82 a build request had failed without leaving a trace (i.e. no entry on any of the builders we know of),
83 sync-buildbot.js throws an exception.
85 * server-tests/tools-buildbot-triggerable-tests.js: Added test cases.
86 * tools/js/buildbot-syncer.js:
87 (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Renamed. Optionally takes the slave name.
88 When this parameter is specified, schedule the request only if the specified slave is available.
89 * tools/js/buildbot-triggerable.js:
90 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Always use
91 scheduleRequestInGroupIfAvailable to schedule a new build request. Using scheduleRequest for non-first
92 build requests was problematic when there were multiple test groups with pending requests because then
93 we would schedule those pending requests without checking whether there is already a pending job or if
94 we have previously scheduled a job. Also fallback to use any syncer / builder when groupInfo.syncer is
95 not set even if the next request was not the first one in the test group since we can't determine on
96 which builder preceding requests are processed in such cases.
97 * unit-tests/buildbot-syncer-tests.js:
99 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
101 Replace script runner to use mocha.js tests
102 https://bugs.webkit.org/show_bug.cgi?id=156490
104 Reviewed by Chris Dumez.
106 Replaced run-tests.js, which was a whole test harness for running legacy tests by tools/run-tests.py
107 which is a thin wrapper around mocha.js.
109 * run-tests.js: Removed.
111 * tools/run-tests.py: Added.
114 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
116 New syncing script sometimes schedules a build request on a wrong builder
117 https://bugs.webkit.org/show_bug.cgi?id=156489
119 Reviewed by Stephanie Lewis.
121 The bug was caused by _scheduleNextRequestInGroupIfSlaveIsAvailable scheduling the next build request on
122 any available syncer regardless of whether the request is the first one in the test group or not because
123 BuildRequest.order was returning a string instead of a number.
125 Also fixed a bug that BuildbotTriggerable.syncOnce was re-ordering test groups by their id's instead of
126 respecting the order in which the perf dashboard returned.
128 * public/v3/models/build-request.js:
129 (BuildRequest.prototype.order): Force the order to be a number.
130 * server-tests/api-build-requests-tests.js: Assert the order as numbers.
131 * server-tests/resources/mock-data.js:
132 (MockData.addAnotherMockTestGroup): Changed the test group id to 601, which is after the first mock data.
133 The old number was masking a bug in BuildbotTriggerable that it was re-ordering test groups by their id's
134 instead of using the order set forth by the perf dashboard.
135 (MockData.mockTestSyncConfigWithSingleBuilder):
136 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for scheduling two build requests in
137 a single call to syncOnce. Each build request should be scheduled on the same builder as the previous build
138 requests in the same test group.
139 * tools/js/buildbot-triggerable.js:
140 (BuildbotTriggerable.prototype.syncOnce): Order test groups by groupOrder, which is the index at which first
141 build request in the group appeared.
142 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Don't re-order build requests
143 as they're already sorted on the server side.
144 (BuildbotTriggerable._testGroupMapForBuildRequests): Added groupOrder to test group info
146 2016-04-09 Ryosuke Niwa <rniwa@webkit.org>
148 Build fix. Don't treat a build number 0 as a pending build.
150 * tools/js/buildbot-syncer.js:
151 (BuildbotBuildEntry.prototype.isPending):
153 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
155 Escape builder names in url* and pathFor* methods of BuildbotSyncer
156 https://bugs.webkit.org/show_bug.cgi?id=156427
158 Reviewed by Darin Adler.
160 The build fix in r199251 breaks other usage of RemoteAPI. Fix it properly by escaping builder names in
161 various methods of BuildbotSyncer.
163 Also fixed a typo in the logging and a bug that the new syncing script never updated "scheduled" to "running".
165 * server-tests/resources/mock-data.js:
166 (MockData.mockTestSyncConfigWithTwoBuilders): Renamed "some-builder-2" to "some builder 2" to test the
167 new escaping behavior in tools-buildbot-triggerable-tests.js and buildbot-syncer-tests.js.
169 * server-tests/tools-buildbot-triggerable-tests.js: Added tests for status url, and added a new test case
170 for updating "scheduled" to "running".
172 * tools/js/buildbot-syncer.js:
173 (BuildbotBuildEntry.buildRequestStatusIfUpdateIsNeeded): Update the status to "running" when the request's
174 status is "scheduled" and the buildbot's build is currently in progress.
175 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Escape the builder name.
176 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto.
177 (BuildbotSyncer.prototype.pathForForceBuild): Ditto.
178 (BuildbotSyncer.prototype.url): Ditto.
179 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
181 * tools/js/buildbot-triggerable.js:
182 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers):
183 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Fixed a typo. We are
184 scheduling new build requests, not syncing them.
185 * tools/js/remote.js:
186 (RemoteAPI.sendHttpRequest): Reverted r199251.
187 * unit-tests/buildbot-syncer-tests.js:
189 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
191 Build fix. We need to escape the path or http.request would fail.
193 * tools/js/remote.js:
195 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
197 Fix various bugs in the new syncing script
198 https://bugs.webkit.org/show_bug.cgi?id=156393
200 Reviewed by Darin Adler.
202 * server-tests/resources/common-operations.js: Added. This file was supposed to be added in r199191.
203 (addBuilderForReport):
205 (connectToDatabaseInEveryTest):
207 * tools/js/buildbot-triggerable.js:
208 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
209 builder as this dramatically increases the amount of log we generate.
210 * tools/js/parse-arguments.js:
211 (parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
212 * tools/js/remote.js:
213 (RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
214 (RemoteAPI.prototype.configure): Added more validations with nice error messages.
215 (RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
216 the right port in configure instead based on the scheme.
217 * tools/sync-buildbot.js:
218 (syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
219 and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
220 properly in Manifest.fetch() because we do need to "forget" about some tests and platforms in some cases.
221 For now, delete all v3 model objects and start over in each syncing cycle.
222 * unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.
224 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
226 sync-buildbot.js doesn't mark disappeared builds as failed
227 https://bugs.webkit.org/show_bug.cgi?id=156386
229 Reviewed by Chris Dumez.
231 Fix a bug that new syncing script doesn't mark builds that it scheduled but doesn't appear when queried
232 by buildbot's JSON API. These are builds that got canceled by humans (e.g. buildbot was restarted, data
233 loss, pending build was canceled, etc...)
235 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case.
236 * tools/js/buildbot-triggerable.js:
237 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added a set of build requests we've matched
238 against BuildbotBuildEntry's. Mark build requests that didn't have any entry but supposed to be in either
239 'scheduled' or 'running' status as failed.
241 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
243 A/B testing bots should prioritize user created test groups
244 https://bugs.webkit.org/show_bug.cgi?id=156375
246 Reviewed by Chris Dumez.
248 Order build requests preferring user created ones over ones automatically created by detect-changes.js.
250 Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new
251 build request on a builder/slave even when we had previously scheduled another build request.
253 * public/include/build-requests-fetcher.php:
254 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on
255 author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js.
256 Since we're using ascending order, this would put user created test groups first.
257 * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case
258 for testing that build requests for an user created test group shows up first.
259 * server-tests/resources/mock-data.js:
260 (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name.
261 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests
262 for an user created test group shows up first.
263 * tools/js/buildbot-syncer.js:
264 (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already
265 scheduled new build requests. Don't schedule more requests on these slaves.
266 (BuildbotSyncer.prototype.scheduleRequest):
267 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null
268 when slaveList is not specified) to _slavesWithNewRequests.
269 (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request
270 we have previously scheduled should be included in one of the entires now.
271 * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug.
272 (sampleiOSConfig): Added a second slave for new test cases.
274 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
276 Migrate legacy perf dashboard tests to mocha.js based tests
277 https://bugs.webkit.org/show_bug.cgi?id=156335
279 Reviewed by Chris Dumez.
281 Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise
282 for most of asynchronous operations, refactored the tests to use Promises as well, and added more
283 assertions where appropriate.
285 Also consolidated common helper functions into server-tests/resources/common-operations.js.
286 Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were
287 taking an array of reports while others were taking a single report. New shared implementation in
288 common-operations.js now takes a single report.
290 Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout.
291 Most of tests are passing under 100ms on my computer so 1s should be plenty still.
293 * run-tests.js: Removed.
294 * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js.
295 (reportsForDifferentPlatforms):
296 * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js.
297 (.addBuilder): Moved to common-operations.js.
298 * server-tests/api-build-requests-tests.js:
299 * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps.
300 * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js.
301 (.queryPlatformAndMetric):
303 * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js.
304 * server-tests/api-report-tests.js: Moved from tests/api-report.js.
307 (.reportWithSameSubtestName):
308 * server-tests/resources/common-operations.js: Added.
309 (addBuilderForReport): Extracted from tests.
310 (addSlaveForReport): Ditto.
311 (connectToDatabaseInEveryTest): Added.
312 (submitReport): Extracted from admin-platforms-tests.js.
313 * server-tests/resources/test-server.js:
314 (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start
315 its own Apache instance (that would certainly will fail).
316 * server-tests/tools-buildbot-triggerable-tests.js:
318 * tools/js/database.js:
319 (Database.prototype.selectAll): Added.
320 (Database.prototype.selectFirstRow): Added.
321 (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments.
323 2016-04-05 Ryosuke Niwa <rniwa@webkit.org>
325 New buildbot syncing scripts that supports multiple builders and slaves
326 https://bugs.webkit.org/show_bug.cgi?id=156269
328 Reviewed by Chris Dumez.
330 Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves.
331 The old python script (sync-with-buildbot.py) could only support a single builder and slave
332 for each platform, test pair.
334 The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added
335 throughout the codebase and tests have been refactored.
337 BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible
338 for syncing everything on each builder (on a buildbot).
340 Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored
341 test helpers and mocks as needed.
343 * public/v3/models/build-request.js:
344 (BuildRequest.prototype.status): Added.
345 (BuildRequest.prototype.isScheduled): Added.
346 * public/v3/models/metric.js:
347 (Metric.prototype.fullName): Added.
348 * public/v3/models/platform.js:
349 (Platform): Added the map based on platform name.
350 (Platform.findByName): Added.
351 * public/v3/models/test.js:
352 (Test.topLevelTests):
353 (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would
354 find the test whose name is "B" which has a parent test named "A".
355 (Test.prototype.fullName): Added.
356 * server-tests/api-build-requests-tests.js:
357 (addMockData): Moved to resources/mock-data.js.
358 (addAnotherMockTestGroup): Ditto.
359 * server-tests/resources/mock-data.js: Added.
360 (MockData.resetV3Models): Added.
361 (MockData.addMockData): Moved from api-build-requests-tests.js.
362 (MockData.addAnotherMockTestGroup): Ditto.
363 (MockData.mockTestSyncConfigWithSingleBuilder): Added.
364 (MockData.mockTestSyncConfigWithTwoBuilders): Added.
365 (MockData.pendingBuild): Added.
366 (MockData.runningBuild): Added.
367 (MockData.finishedBuild): Added.
368 * server-tests/resources/test-server.js:
370 (TestServer.prototype.remoteAPI):
371 (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit.
372 (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever.
373 (TestServer.prototype._waitForPid): Increase the timeout.
374 (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards.
375 * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce.
377 (MockLogger.prototype.log): Added.
378 (MockLogger.prototype.error): Added.
379 * tools/detect-changes.js:
380 (parseArgument): Moved to js/parse-arguments.js.
381 * tools/js/buildbot-syncer.js:
382 (BuildbotBuildEntry):
383 (BuildbotBuildEntry.prototype.syncer): Added.
384 (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status
385 for a build request (of the matching build request ID) if it needs to be updated in the server.
386 (BuildbotSyncer): This class
387 (BuildbotSyncer.prototype.addTestConfiguration): Added.
388 (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations.
389 (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on
391 (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request.
392 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for
393 the specified build request on the first slave that's available.
394 (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object.
395 Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it.
396 (BuildbotSyncer.prototype._pullRecentBuilds):
397 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now
398 only returns the path instead of the full URL since RemoteAPI takes a path, not full URL.
399 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON.
400 (BuildbotSyncer.prototype.pathForForceBuild): Added.
401 (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL.
402 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
403 (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test
404 configurations associated with it, find the one matching for this request.
405 (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it.
406 (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of
407 slave names present on this builder.
408 * tools/js/buildbot-triggerable.js: Added.
409 (BuildbotTriggerable): Added.
410 (BuildbotTriggerable.prototype.name): Added.
411 (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls
412 existing build requests from the perf dashboard, pulls buildbot for pending and running/completed
413 builds on each builder (represented by each syncer), schedules build requests on buildbot if there
414 is any builder/slave available, and updates the status of build requests in the database.
415 (BuildbotTriggerable.prototype._validateRequests): Added.
416 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added.
417 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added.
418 (BuildbotTriggerable._testGroupMapForBuildRequests): Added.
419 * tools/js/database.js:
420 * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js.
422 * tools/js/remote.js:
423 (RemoteAPI): Now optionally takes the server configuration.
424 (RemoteAPI.prototype.url): Added.
425 (RemoteAPI.prototype.getJSON): Removed the code for specifying request content.
426 (RemoteAPI.prototype.getJSONWithStatus): Ditto.
427 (RemoteAPI.prototype.postJSON): Added.
428 (RemoteAPI.prototype.postFormUrlencodedData): Added.
429 (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth.
430 * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host.
431 * tools/sync-buildbot.js: Added.
432 (main): Added. Parse the arguments and start the loop.
434 * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as
435 scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed.
437 (smallConfiguration): Added.
438 (smallPendingBuild): Added.
439 (smallInProgressBuild): Added.
440 (smallFinishedBuild): Added.
441 (createSampleBuildRequest): Create a unique build request for each platform.
442 (samplePendingBuild): Optionally specify build time and slave name.
443 (sampleInProgressBuild): Optionally specify slave name.
444 (sampleFinishedBuild): Ditto.
445 * unit-tests/resources/mock-remote-api.js:
446 (assert.notReached.assert.notReached):
447 (MockRemoteAPI.url): Added.
448 (MockRemoteAPI.postFormUrlencodedData): Added.
449 (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus.
450 (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we
451 need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI.
452 (MockRemoteAPI.inject):
453 (MockRemoteAPI.reset): Added.
455 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
457 Simplify API of Test model by removing Test.setParentTest
458 https://bugs.webkit.org/show_bug.cgi?id=156055
460 Reviewed by Joseph Pecoraro.
462 Removed Test.setParentTest. Keep track of the child-parent relationship using the static map instead.
464 Now each test only stores parent's id and uses the ID static map in Test.parentTest().
466 * public/v3/models/manifest.js:
467 (Manifest._didFetchManifest.buildObjectsFromIdMap): Removed the code to create the map of child-parent
468 relationship and call setParentTest.
469 * public/v3/models/test.js:
470 (Test): Updated a static map by the name of "childTestMap" to store itself. We should probably sort
471 child tests using some fixed criteria in the future instead of relying on the creation order but
472 preserve the old code's ordering for now.
473 (Test.prototype.parentTest): Look up the static map by the parent test's id.
474 (Test.prototype.onlyContainsSingleMetric):
475 (Test.prototype.setParentTest): Deleted.
476 (Test.prototype.childTests): Look up the child test map.
478 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
480 BuildRequest should have associated platform and test
481 https://bugs.webkit.org/show_bug.cgi?id=156054
483 Reviewed by Joseph Pecoraro.
485 Added methods to retrieve the platform and the test associated with a build request with tests.
487 * public/v3/models/build-request.js:
489 (BuildRequest.prototype.platform): Added.
490 (BuildRequest.prototype.test): Added.
491 * server-tests/api-build-requests-tests.js:
492 * server-tests/api-manifest.js: Fixed a typo. This tests /api/manifest, not /api/build-requests.
493 * unit-tests/buildbot-syncer-tests.js:
494 (.createSampleBuildRequest): Now takes Platform and Test objects to avoid hitting assertions in
495 BuildRequest's constructor.
497 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
499 BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
500 https://bugs.webkit.org/show_bug.cgi?id=156008
502 Reviewed by Darin Adler.
504 Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.
506 Now, new syncing scripts must be able to figure out the build slave the first build requests in
507 a given test group had used in order to schedule subsequent build requests in the test group.
509 For this purpose, /api/build-requests has been modified to return all build requests whose test
510 group had not finished yet. A test group is finished if all build requests in the test group had
511 finished (completed, failed, or canceled).
513 * public/include/build-requests-fetcher.php:
514 (BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
515 groups that have not been finished.
516 * public/v3/models/build-request.js:
518 (BuildRequest.prototype.testGroupId): Added.
519 (BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
520 (BuildRequest.fetchForTriggerable): Added.
521 (BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
523 * public/v3/models/manifest.js:
524 (Manifest.fetch): Use the full path from root so that it works in server tests.
525 * public/v3/models/test-group.js:
526 (TestGroup.hasPending):
527 (TestGroup._createModelsFromFetchedTestGroups):
528 * server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
529 is present in the response returned by /api/build-requests iff any build request in the group had not
532 (.addAnotherMockTestGroup): Added.
533 * unit-tests/test-groups-tests.js:
535 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
537 Make dependency injection in unit tests more explicit
538 https://bugs.webkit.org/show_bug.cgi?id=156006
540 Reviewed by Joseph Pecoraro.
542 Make the dependency injection of model objects in unit tests explicit so that server tests that create
543 "real" model objects won't create these mock objects. Now each test that uses mock model objects would call
544 MockModels.inject() to inject before / beforeEach and access each object using a property on MockModels
545 instead of them being implicitly defined on the global object.
547 Similarly, MockRemoteAPI now only replaces global.RemoteAPI during each test so that server tests can use
548 real RemoteAPI to access the test Apache server.
550 * unit-tests/analysis-task-tests.js:
551 * unit-tests/buildbot-syncer-tests.js:
552 (createSampleBuildRequest):
553 * unit-tests/measurement-adaptor-tests.js:
554 * unit-tests/measurement-set-tests.js:
555 * unit-tests/resources/mock-remote-api.js:
556 (MockRemoteAPI.getJSONWithStatus):
557 (MockRemoteAPI.inject): Added. Override RemoteAPI on the global object during each test.
558 * unit-tests/resources/mock-v3-models.js:
559 (MockModels.inject): Added. Create mock model objects before each test, and clear all static maps of
560 various v3 model classes (to remove all singleton objects for those model classes).
561 * unit-tests/test-groups-tests.js:
563 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
565 BuildbotSyncer should be able to fetch JSON from buildbot
566 https://bugs.webkit.org/show_bug.cgi?id=155921
568 Reviewed by Joseph Pecoraro.
570 Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot
571 with lots of unit tests as this has historically been a source of subtle bugs in the old script.
573 New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that
574 the state of some builds may change between each HTTP request. In the old script, we fetched the list
575 of the pending builds, and requested -1, -2, etc... builds for N times. But between each request,
576 a pending build may start running or an in-progress build finish and shift the offset by one. The new
577 script avoids this problem by first requesting all pending builds, then all in-progress and finished
578 builds in a single HTTP request. The results are then merged so that entries for in-progress and
579 finished builds would override the entries for pending builds if they overlap.
581 Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes
582 the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js).
584 * server-tests/api-build-requests-tests.js:
585 * server-tests/api-manifest.js:
586 * tools/js/buildbot-syncer.js:
587 (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as
588 we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished
589 builds as 'currentStep' is always defined but null in those builds.
590 (BuildbotBuildEntry.prototype.buildNumber): Added.
591 (BuildbotBuildEntry.prototype.isPending): Added.
592 (BuildbotBuildEntry.prototype.hasFinished): Added.
593 (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds.
594 (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds.
595 (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added.
596 (BuildbotSyncer.prototype.urlForBuildJSON): Added.
597 (BuildbotSyncer.prototype.url): Added.
598 (BuildbotSyncer.prototype.urlForBuildNumber): Added.
599 * tools/js/remote.js:
600 (RemoteAPI.prototype.getJSON): Renamed from fetchJSON.
601 (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus.
602 * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node.
603 * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot
604 (samplePendingBuild):
605 (sampleInProgressBuild): Added.
606 (sampleFinishedBuild): Added.
607 * unit-tests/resources/mock-remote-api.js:
608 (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus.
610 2016-03-24 Ryosuke Niwa <rniwa@webkit.org>
612 Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
613 https://bugs.webkit.org/show_bug.cgi?id=155863
615 Reviewed by Joseph Pecoraro.
617 Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability
618 added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed
619 /admin/regenerate-manifest since it has been superseded by /api/manifest.
621 This patch also extracts manifest.js out of main.js so that it could be used and tested without the
624 * public/admin/regenerate-manifest.php: Deleted.
625 * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with
626 a trailing backslash.
627 * public/include/manifest.php:
628 (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories.
629 * public/v3/index.html:
632 * public/v3/models/bug-tracker.js:
633 (BugTracker.prototype.newBugUrl): Added.
634 (BugTracker.prototype.repositories): Added.
635 * public/v3/models/manifest.js: Added. Extracted from main.js.
636 (Manifest.fetch): Moved from main.js' fetchManifest.
637 (Manifest._didFetchManifest): Moved from main.js' didFetchManifest.
638 * public/v3/models/platform.js:
639 (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of
640 the same name. This is tested by the newly added test cases.
641 * server-tests/api-build-requests-tests.js:
642 * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js
643 with additional assertions for v3 UI model objects.
644 * server-tests/resources/test-server.js:
645 (TestServer.prototype.start):
646 (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API.
647 Also no longer takes dataDirectory as an argument since it's always the same.
648 (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data.
649 (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests.
650 (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an
651 unintended side effect of slowing down unit tests even through they don't need Postgres or Apache.
652 * tests/admin-regenerate-manifest.js: Removed.
653 * tools/js/database.js:
654 * tools/js/v3-models.js:
656 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
658 Add mocha server tests for /api/build-requests
659 https://bugs.webkit.org/show_bug.cgi?id=155831
661 Reviewed by Chris Dumez.
663 Added the new mocha.js based server-tests for /api/build-requests. The new harness automatically:
664 - starts a new Apache instance
665 - switches the database during testing via setting an environmental variable
666 - backups and restores public/data directory during testing
668 As a result, developer no longer has to manually setup Apache, edit config.json manually to use
669 a testing database, or run /api/manifest.php to re-generate the manifest file after testing.
671 This patch also makes ID resolution optional on /api/build-requests so that v3 model based syncing
672 scripts can re-use the same code as the v3 UI to process the JSON. tools/sync-with-buildbot.py has
673 been modified to use this option (useLegacyIdResolution).
675 * config.json: Added configurations for the test httpd server.
676 * init-database.sql: Don't error when tables and types don't exist (when database is empty).
677 * public/api/build-requests.php:
678 (main): Made the ID resolution optional with useLegacyIdResolution. Also removed "updates" from the
679 results JSON since it's never used.
680 * public/include/build-requests-fetcher.php:
681 (BuildRequestsFetcher::__construct):
682 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Fixed the bug that we would include the same
683 commit multiple times for each root set.
684 * public/include/db.php:
685 (config): If present, use ORG_WEBKIT_PERF_CONFIG_PATH instead of Websites/perf.webkit.org/config.json.
686 * server-tests: Added.
687 * server-tests/api-build-requests-tests.js: Added. Tests for /api/build-requests.
689 * server-tests/resources: Added.
690 * server-tests/resources/test-server.conf: Added. Apache configuration file for testing.
691 * server-tests/resources/test-server.js: Added.
693 (TestSever.prototype.start): Added.
694 (TestSever.prototype.stop): Added.
695 (TestSever.prototype.remoteAPI): Added. Configures RemoteAPI to be used with the test sever.
696 (TestSever.prototype.database): Added. Returns Database configured to use the test database.
697 (TestSever.prototype._constructTestConfig): Creates config.json for testing. The file is generated by
698 _start and db.php's config() reads it from the environmental variable: ORG_WEBKIT_PERF_CONFIG_PATH.
699 (TestSever.prototype._ensureDataDirectory): Renames public/data to public/original-data if exists,
700 and creates a new empty public/data.
701 (TestSever.prototype._restoreDataDirectory): Deletes public/data and renames public/original-data
703 (TestSever.prototype._ensureTestDatabase): Drops the test database if exists and creates a new one.
704 (TestSever.prototype.initDatabase): Run init-database.sql to start each test with a consistent state.
705 (TestSever.prototype._executePgsqlCommand): Executes a postgres command line tool such as psql.
706 (TestSever.prototype._determinePgsqlDirectory): Finds the directory that contains psql.
707 (TestSever.prototype._startApache): Starts an Apache instance for testing.
708 (TestSever.prototype._stopApache): Stops the Apache instance for testing.
709 (TestSever.prototype._waitForPid): Waits for the Apache pid file to appear or disappear.
710 (before): Start the test server at the beginning.
711 (beforeEach): Re-initialize all tables before each test.
712 (after): Stop the test server at the end.
713 * tools/js/config.js:
714 (Config.prototype.path):
715 (Config.prototype.serverRoot): Added. The path to Websites/perf.webkit.org/public/.
716 (Config.prototype.pathFromRoot): Added. Resolves a path from Websites/perf.webkit.org.
717 * tools/js/database.js:
718 (Database): Now optionally takes the database name to use a different database during testing.
719 (Database.prototype.connect):
720 (Database.prototype.query): Added.
721 (Database.prototype.insert): Added.
722 (tableToPrefixMap): Maps table name to its prefix. Used by Database.insert.
723 * tools/js/remote.js: Added.
724 (RemoteAPI): Added. This is node.js equivalent of RemoteAPI in public/v3/remote.js.
725 (RemoteAPI.prototype.configure): Added.
726 (RemoteAPI.prototype.fetchJSON): Added.
727 (RemoteAPI.prototype.fetchJSONWithStatus): Added.
728 (RemoteAPI.prototype.sendHttpRequest): Added.
729 * tools/sync-with-buildbot.py:
730 (main): Use useLegacyIdResolution as this script relies on the legacy behavior.
731 * unit-tests/checkconfig.js: pg was never directly used in this test.
733 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
735 Delete a file that was supposed to be removed in r198614 for real.
737 * unit-tests/resources/v3-models.js: Removed.
739 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
741 Add a model for parsing buildbot JSON with unit tests
742 https://bugs.webkit.org/show_bug.cgi?id=155814
744 Reviewed by Joseph Pecoraro.
746 Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests.
747 They will be used in the new syncing scripts to improve A/B testing.
749 * public/v3/models/build-request.js:
751 * tools/js/buildbot-syncer.js: Added.
752 (BuildbotBuildEntry): Added.
753 (BuildbotBuildEntry.prototype.slaveName): Added.
754 (BuildbotBuildEntry.prototype.buildRequestId): Added.
755 (BuildbotBuildEntry.prototype.isInProgress): Added.
756 (BuildbotSyncer): Added.
757 (BuildbotSyncer.prototype.testPath): Added.
758 (BuildbotSyncer.prototype.builderName): Added.
759 (BuildbotSyncer.prototype.platformName): Added.
760 (BuildbotSyncer.prototype.fetchPendingRequests): Added.
761 (BuildbotSyncer.prototype._propertiesForBuildRequest): Added.
762 (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added.
763 (BuildbotSyncer._loadConfig): Added.
764 (BuildbotSyncer._validateAndMergeConfig): Added.
765 (BuildbotSyncer._validateAndMergeProperties): Added.
766 * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js.
767 (beforeEach): Deleted since this only defined inside mocha.
768 * unit-tests/analysis-task-tests.js:
769 * unit-tests/buildbot-syncer-tests.js: Added.
771 (createSampleBuildRequest):
772 (.smallConfiguration):
773 * unit-tests/measurement-adaptor-tests.js:
774 * unit-tests/measurement-set-tests.js:
775 * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js.
777 * unit-tests/test-groups-tests.js:
780 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
782 Add unit tests for test-group.js
783 https://bugs.webkit.org/show_bug.cgi?id=155781
785 Reviewed by Joseph Pecoraro.
787 Added unit tests for test-group.js that would have caught regressions fixed in r198503.
789 * public/v3/components/chart-pane-base.js:
790 (ChartPaneBase.prototype._renderAnnotations): Added a forgotten break statement.
791 * public/v3/models/build-request.js:
792 (BuildRequest.prototype.setResult):
794 * public/v3/models/test-group.js:
795 * unit-tests/measurement-set-tests.js: Use ./resources/v3-models.js to reduce the code duplication.
796 * unit-tests/resources/v3-models.js: Import more stuff from v3 models.
798 * unit-tests/test-groups-tests.js: Added. Added some unit tests for TestGroup.
800 (.testGroupWithStatusList):
802 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
808 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
810 Commit log viewer repaints too frequently after r198499
811 https://bugs.webkit.org/show_bug.cgi?id=155732
813 Reviewed by Joseph Pecoraro.
815 The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
816 if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
817 and avoiding work in the commit log viewer when the requested repository and the revision range were
818 the same as those of the last request.
820 * public/v3/components/commit-log-viewer.js:
822 (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
823 identical to the one we already have to avoid repaints and issuing multiple network requests.
824 * public/v3/components/interactive-time-series-chart.js:
825 (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
826 indicator hadn't changed.
827 * public/v3/pages/chart-pane.js:
828 (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
829 the URL. We need to check whether the lock state had changed. The old condition was also redundant
830 since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
832 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
834 Fix A/B testing after r198503.
836 * public/include/build-requests-fetcher.php:
838 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
840 Analysis task page is broken after r198479
841 https://bugs.webkit.org/show_bug.cgi?id=155735
843 Rubber-stamped by Chris Dumez.
845 * public/api/measurement-set.php:
846 (AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
847 * public/include/build-requests-fetcher.php:
848 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
849 * public/v3/models/commit-log.js:
850 (CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
851 * public/v3/models/root-set.js:
852 (RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
853 we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
854 find the repository with "[object]" as the ID.
855 * public/v3/models/test-group.js:
856 (TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.
858 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
860 v3 UI sometimes don't update the list of revisions on the commit log viewer
861 https://bugs.webkit.org/show_bug.cgi?id=155729
863 Rubber-stamped by Chris Dumez.
865 Fixed multiple bugs that were affecting the list of blame range and commit logs for the range weren't
866 updated in some cases on v3 UI. Also, the commit log viewer state is now a part of the URL state so
867 opening and closing the commit log viewer will persist across page loads.
869 Also fixed a regression from r198479 that Test object can't be created for a top level test.
871 * public/v3/components/chart-pane-base.js:
872 (ChartPaneBase.prototype.configure):
873 (ChartPaneBase.prototype._mainSelectionDidChange): Fixed the bug that the list of blame range nor the
874 commit log viewer don't get updated when the selected range changes.
875 (ChartPaneBase.prototype._indicatorDidChange):
876 (ChartPaneBase.prototype._didFetchData):
877 (ChartPaneBase.prototype._updateStatus): Extracted from _indicatorDidChange and _didFetchData.
878 (ChartPaneBase.prototype._requestOpeningCommitViewer): Renamed from _openCommitViewer.
880 * public/v3/components/chart-status-view.js:
881 (ChartStatusView.prototype.updateStatusIfNeeded): Fixed the bug that the blame range doesn't get set
882 on the initial page load when the selection range is set but the chart data hadn't been fetched yet.
884 * public/v3/components/commit-log-viewer.js:
885 (CommitLogViewer.prototype.view): Fixed the bug that we don't clear out the old list of commits while
886 loading the next set of commits to show as it looked as if the list was never updated.
887 (CommitLogViewer.prototype.render): Fixed the bug that the view always show the last repository name
888 even if there were nothing being fetched or commits to show.
890 * public/v3/components/pane-selector.js:
891 (PaneSelector.prototype.focus): Removed superfluous call to console.log.
893 * public/v3/models/data-model.js:
894 (DataModelObject.listForStaticMap): Generalized the code for all to fix the bug in Test.
895 (DataModelObject.all):
897 * public/v3/models/test.js:
898 (Test): Fixed the bug that this code was relying on the static map to be an array.
899 (Test.topLevelTests): Use newly added listForStaticMap to convert the dictionary to an array.
901 * public/v3/pages/chart-pane-status-view.js:
902 (ChartPaneStatusView): Always initialize _usedRevisionRange as a triple to simplify code elsewhere.
903 (ChartPaneStatusView.prototype.render): Invoke _revisionCallback when user clicks on a repository
904 expansion mark (>>). Also fixed click handler from the row since this made selecting revision range
905 on the view cumbersome. Now user has to explicitly click on the expansion mark (>>).
906 (ChartPaneStatusView.prototype._setRevisionRange): Now takes shouldNotify, from, and to as arguments
907 as this function must not invoke_revisionCallback inside _updateRevisionListForNewCurrentRepository.
908 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Use newly added setCurrentRepository
909 instead of manually invoking setCurrentRepository and updateRevisionListWithNotification.
910 (ChartPaneStatusView.prototype.setCurrentRepository): Fixed the bug that we weren't updating the
912 (ChartPaneStatusView.prototype.updateRevisionList): Renamed from updateRevisionListWithNotification
913 since we no longer call _revisionCallback. In general, callbacks are only meant to communicate user
914 initiated actions, and not program induced updates like this API so this was a bad pattern anyway.
915 ChartPane now explicitly updates the commit log viewer instead of relying on this function calling
916 _requestOpeningCommitViewer implicitly.
917 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Extracted from
918 updateRevisionListWithNotification so that setCurrentRepository can also call this function.
920 * public/v3/pages/chart-pane.js:
921 (ChartPane.prototype._requestOpeningCommitViewer): Overrides ChartPaneBase's method. Open the same
922 repository in other panes via ChartsPage.setOpenRepository.
923 (ChartPane.prototype.setOpenRepository): This method is called when the user selected a repository in
924 another pane. Open the same repository in this pane if it wasn't already open.
926 * public/v3/pages/charts-page.js:
927 (ChartsPage): Added this._currentRepositoryId.
928 (ChartsPage.prototype.serializeState): Serialize _currentRepositoryId.
929 (ChartsPage.prototype.updateFromSerializedState): Set the commit log viewer's
930 (ChartsPage.prototype.setOpenRepository): Added.
932 * tests/api-measurement-set.js: Fixed a test after r198479.
934 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
936 V3 Perf Dashboard should automatically select initial range when creating a new task
937 https://bugs.webkit.org/show_bug.cgi?id=155677
939 Reviewed by Joseph Pecoraro.
941 Select the entire range of points for which the analysis task is created by default so that creating
942 a test group to confirm the regression / progression is easy.
944 * public/v3/pages/analysis-task-page.js:
945 (AnalysisTaskPage): Added a boolean flag which indicates the user had modified main chart's selection.
946 * public/v3/pages/analysis-task-page.js:
947 (AnalysisTaskPage.prototype.render): Set the main chart's selection to the entire range of points in
948 the analysis task if the user had never modified selection.
949 (AnalysisTaskPage.prototype._chartSelectionDidChange): This callback is invoked only when the user had
950 modified the selection so set _selectionWasModifiedByUser true here unconditionally.
952 2016-03-19 Ryosuke Niwa <rniwa@webkit.org>
954 Associated commits don't immediately show up on an analysis task page
955 https://bugs.webkit.org/show_bug.cgi?id=155692
957 Reviewed by Darin Adler.
959 The bug was caused by resolveCommits in AnalysisTask._constructAnalysisTasksFromRawData not being
960 able to find the matching commit log if the commit log had been created by the charts which don't
961 set the remote identifiers on each CommitLog objects.
963 Fixed the bug by modifying /api/measurement-set to include the commit ID, and making CommitLog
964 use the real database ID as its ID instead of a fake ID we create from repository and revision.
966 Also added a bunch of Mocha unit tests for AnalysisTask.fetchAll.
968 * public/api/measurement-set.php:
969 (MeasurementSetFetcher::execute_query): Fetch commit_id.
970 (MeasurementSetFetcher::format_run): Use pass-by-reference to avoid making a copy of the row.
971 (MeasurementSetFetcher::parse_revisions_array): Include commit_id as the first item in the result.
972 * public/v3/instrumentation.js:
973 * public/v3/models/analysis-task.js:
974 (AnalysisTask): Fixed a bug that _buildRequestCount and _finishedBuildRequestCount could be kept
975 as strings and hasPendingRequests() could return a wrong result because it would perform string
976 inequality instead of numerical inequality.
977 (AnalysisTask.prototype.updateSingleton): Ditto.
978 (AnalysisTask.prototype.dissociateCommit):
979 (AnalysisTask._constructAnalysisTasksFromRawData):
980 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Use findById now that CommitLog
981 objects all use the same id as the database id.
982 * public/v3/models/commit-log.js:
984 (CommitLog.prototype.remoteId): Deleted since we no longer create a fake id for commit logs for
986 (CommitLog.findByRemoteId): Deleted.
987 (CommitLog.ensureSingleton): Deleted.
988 (CommitLog.fetchBetweenRevisions):
990 * public/v3/models/data-model.js:
991 (DataModelObject.clearStaticMap): Added to aid unit testing.
992 (DataModelObject.ensureNamedStaticMap): Fixed a typo. Each map is a dictionary, not an array.
993 * public/v3/models/metric.js:
994 * public/v3/models/platform.js:
995 * public/v3/models/root-set.js:
996 (RootSet): Updated per the interface change in CommitLog.ensureSingleton.
997 (MeasurementRootSet): Updated per /api/measurement-set change. Use the first value as the id.
998 * public/v3/models/test.js:
999 * unit-tests/analysis-task-tests.js: Added.
1000 (sampleAnalysisTask):
1001 (measurementCluster):
1002 * unit-tests/checkconfig.js: Added some assertion message to help aid diagnosing the failure.
1003 * unit-tests/measurement-adaptor-tests.js: Updated the sample data per the API change in
1004 /api/measurement-set and also added assertions for commit log ids.
1005 * unit-tests/measurement-set-tests.js:
1007 * unit-tests/resources: Added.
1008 * unit-tests/resources/mock-remote-api.js: Added. Extracted from measurement-set-tests.js to be
1009 used in analysis-task-tests.js.
1010 (assert.notReached.assert.notReached):
1011 (global.RemoteAPI.getJSON):
1012 (global.RemoteAPI.getJSONWithStatus):
1014 * unit-tests/resources/v3-models.js: Added. Extracted from measurement-set-tests.js to be used in
1015 analysis-task-tests.js and added more imports as needed.
1019 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1021 Build fix after r198464.
1023 * public/v3/components/analysis-results-viewer.js:
1024 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
1026 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1028 Build fix after r198234.
1030 * public/api/commits.php:
1031 (main): Typo: fetch_latest_reported -> fetch_last_reported.
1032 * public/include/commit-log-fetcher.php:
1033 (CommitLogFetcher::format_single_commit): commits should be an array.
1035 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1037 Perf Dashboard v3 confuses better and worse on A/B task page
1038 https://bugs.webkit.org/show_bug.cgi?id=155675
1039 <rdar://problem/25208723>
1041 Reviewed by Joseph Pecoraro.
1043 The analysis results viewer on v3 UI sometimes treats regressions as progressions and vice versa when
1044 the first set (i.e. set A) of the revisions used in an A/B testing never appears in the original graph,
1045 and its latest commit time matches that of the second set, which appears in the original graph.
1047 Because the analysis results viewer compares results in the increasing row number, this results in
1048 B to be compared to A instead of A to be compared to B. Fixed the bug by preventing the wrong ordering
1049 to occur in _buildRowsForPointsAndTestGroups by always inserting a root set A before B when B appears
1050 and A doesn't appear in the original graph.
1052 * public/v3/components/analysis-results-viewer.js:
1053 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Remember the succeeding root set B
1054 when creating an entry for root set A.
1055 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Fixed the bug. Also un-duplicated
1056 the code to create a new row.
1057 (AnalysisResultsViewer.RootSetInTestGroup): Now takes a succeeding root set. e.g. it's B for A and
1058 undefined for B in A/B testing.
1059 (AnalysisResultsViewer.RootSetInTestGroup.prototype.succeedingRootSet): Added.
1060 * public/v3/components/time-series-chart.js:
1061 (TimeSeriesChart.computeTimeGrid): Fixed the bug that we would end up showing 0 AM instead of dates
1062 when both dates and months change.
1064 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1066 Add unit tests for measurement-set.js and measurement-adapter.js
1067 https://bugs.webkit.org/show_bug.cgi?id=155673
1069 Reviewed by Daniel Bates.
1071 Add tests which were supposed to be added in r198462.
1073 * unit-tests/measurement-adaptor-tests.js: Added.
1074 * unit-tests/measurement-set-tests.js: Added.
1075 (assert.notReached): Added.
1076 (global.RemoteAPI.getJSON): Added.
1077 (global.RemoteAPI.getJSONWithStatus): Added. A mock.
1079 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1081 Add unit tests for measurement-set.js and measurement-adapter.js
1082 https://bugs.webkit.org/show_bug.cgi?id=155673
1084 Reviewed by Darin Adler.
1086 Added mocha unit tests for MeasurementSet and MeasurementAdapter classes along with the necessary
1087 refactoring to run these tests in node.
1089 getJSON and getJSONStatus are now under RemoteAPI so that unit tests can mock them.
1091 Removed the dependency on v2 UI's TimeSeries and Measurement class by adding a new implementation
1092 of TimeSeries in v3 and removing the dependency on Measurement in chart-pane-status-view.js with
1093 new helper methods on Build and CommitLog.
1095 Many js files now use 'use strict' (node doesn't support class syntax in non-strict mode) and
1096 module.exports to export symbols in node's require function.
1098 * public/v3/index.html:
1099 * public/v3/main.js:
1100 * public/v3/models/analysis-results.js:
1101 (AnalysisResults.fetch):
1102 * public/v3/models/analysis-task.js:
1103 (AnalysisTask.fetchAll):
1104 * public/v3/models/builder.js:
1106 (Build.prototype.builder): Added. Used by ChartPaneStatusView.
1107 (Build.prototype.buildNumber): Ditto.
1108 (Build.prototype.buildTime): Ditto.
1109 * public/v3/models/commit-log.js:
1110 (CommitLog.prototype.diff): Ditto.
1111 (CommitLog.fetchBetweenRevisions):
1112 * public/v3/models/data-model.js:
1113 (DataModelObject.cachedFetch):
1114 * public/v3/models/measurement-adaptor.js:
1115 (MeasurementAdaptor.prototype.applyToAnalysisResults): Renamed from adoptToAnalysisResults.
1116 (MeasurementAdaptor.prototype.applyTo): Renamed from adoptToSeries. Now shares a lot more
1117 code with applyToAnalysisResults. The code to set 'series' and 'seriesIndex' has been moved
1118 to TimeSeries.append. 'measurement' is no longer needed as this patch removes its only use
1119 in ChartPaneStatusView.
1120 * public/v3/models/measurement-cluster.js:
1121 (MeasurementCluster.prototype.addToSeries): Use TimeSeries.append instead of directly mutating
1123 * public/v3/models/measurement-set.js:
1124 (Array.prototype.includes): Added a polyfill for node.
1125 (MeasurementSet.prototype._fetchSecondaryClusters): Removed a bogus assertion. When fetchBetween
1126 is called with a mixture of clusters that have been fetched and not fetched, this assertion fails.
1127 (MeasurementSet.prototype._fetch):
1128 (TimeSeries.prototype.findById): Moved to time-series.js.
1129 (TimeSeries.prototype.dataBetweenPoints): Ditto.
1130 (TimeSeries.prototype.firstPoint): Ditto.
1131 (TimeSeries.prototype.fetchedTimeSeries): Moved the code to extend the last point to TimeSeries'
1133 * public/v3/models/repository.js:
1134 * public/v3/models/root-set.js:
1135 (MeasurementRootSet): Ignore repositories that had not been defined (e.g. it could be added after
1136 manifest.json had been downloaded but before a given root set is created for an A/B testing).
1137 * public/v3/models/time-series.js:
1138 (TimeSeries): Added.
1139 (TimeSeries.prototype.append): Added.
1140 (TimeSeries.prototype.extendToFuture): Added.
1141 (TimeSeries.prototype.firstPoint): Moved from measurement-set.js.
1142 (TimeSeries.prototype.lastPoint): Added.
1143 (TimeSeries.prototype.previousPoint): Added.
1144 (TimeSeries.prototype.nextPoint): Added.
1145 (TimeSeries.prototype.findPointByIndex): Added.
1146 (TimeSeries.prototype.findById): Moved from measurement-set.js.
1147 (TimeSeries.prototype.findPointAfterTime): Added.
1148 (TimeSeries.prototype.dataBetweenPoints): Moved from measurement-set.js.
1149 * public/v3/pages/chart-pane-status-view.js:
1150 (ChartPaneStatusView.prototype.render): Use newly added helper functions on Build.
1151 (ChartPaneStatusView.prototype._formatTime): Added.
1152 (ChartPaneStatusView.prototype.setCurrentRepository):
1153 (ChartPaneStatusView.prototype.computeChartStatusLabels): Rewrote the code using RootSet object on
1154 currentPoint and previousPoint instead of Measurement class from v2 UI. Also sort the results using
1155 sortByNamePreferringOnesWithURL.
1156 * public/v3/remote.js:
1157 (RemoteAPI.getJSON): Moved under RemoteAPI.
1158 (RemoteAPI.getJSONWithStatus): Ditto.
1160 (PrivilegedAPI.requestCSRFToken):
1162 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1164 Add unit tests for config.json and statistics.js
1165 https://bugs.webkit.org/show_bug.cgi?id=155626
1167 Reviewed by Darin Adler.
1169 Added mocha unit tests for statistics.js and validating config.json. For segmentations, I've extracted
1170 real data from our internal perf dashboard.
1172 Also fixed some bugs covered by these new tests.
1174 * public/shared/statistics.js:
1175 (Statistics.movingAverage): Fixed a bug that forwardWindowSize was never used.
1176 (Statistics.exponentialMovingAverage): Fixed the bug that the moving average starts at 0. It should
1177 start at the first value instead.
1178 (.splitIntoSegmentsUntilGoodEnough): Fixed the bug that we may try to segment a time series into
1179 more parts than there are data points. Clearly, that doesn't make any sense.
1180 (.findOptimalSegmentation): Renamed local variables so that they're more descriptive, and rewrote
1181 the debugging code was the old code was emitting some useless data. Also fixed the bug that the length
1182 of "segmentation" was off by one (we need segmentCount + 1 elements in the array sine we always
1183 include the start of the first segment = 0 and the end of the last segment = values.length).
1184 (.SampleVarianceUpperTriangularMatrix):
1185 (Statistics): Modernized the export code.
1187 * tools/js/config.js: Added.
1189 (Config.prototype.configFilePath): Added.
1190 (Config.prototype.value): Added.
1191 (Config.prototype.path): Added.
1192 * tools/js/database.js: Added.
1194 (Database.prototype.connect): Added.
1195 (Database.prototype.disconnect): Added.
1196 * unit-tests: Added.
1197 * unit-tests/checkconfig.js: Added. Validates config.json. This is useful while setting up
1198 a local instance of the perf dashboard.
1199 * unit-tests/statistics-tests.js: Added.
1200 (assert.almostEqual): Added. Asserts that two floating values are within a given significant digits.
1205 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1207 Fix a typo which was supposed to be fixed in r198351.
1209 * public/v3/pages/analysis-task-page.js:
1210 (AnalysisTaskPage.prototype.render):
1212 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1214 An analysis task should be closed if a progression cause is identified
1215 https://bugs.webkit.org/show_bug.cgi?id=155549
1217 Reviewed by Chris Dumez.
1219 Since a progression is desirable, we should close an analysis task once its cause is identified.
1221 Also fix some typos.
1223 * init-database.sql: Fixed a typo.
1224 * public/api/analysis-tasks.php:
1225 * public/v3/models/analysis-task.js:
1226 (AnalysisTask.prototype.dissociateBug): Renamed from dissociateBug.
1227 * public/v3/pages/analysis-task-page.js:
1228 (AnalysisTaskPage.prototype.render):
1229 (AnalysisTaskPage.prototype._dissociateBug): Renamed from _dissociateBug.
1230 (AnalysisTaskPage.prototype._dissociateCommit): Fixed the typo in the alert.
1232 2016-03-16 Ryosuke Niwa <rniwa@webkit.org>
1234 Analysis task page should allow specifying commits that caused or fixed a regression or a progression
1235 https://bugs.webkit.org/show_bug.cgi?id=155529
1237 Reviewed by Chris Dumez.
1239 Added the capability to associate revisions that caused or fixed a progression or a regression for which
1240 an analysis task was created. Added task_commits that stores this relationship and added the backend
1241 support to retrieve this table in /api/analysis-tasks and an privileged API to update this table at
1242 /privileged-api/associate-commit.
1244 Also extracted a new component, MutableListView, out of AnalysisTaskPage to render and manipulate a list
1245 of mutable items, and used it to render the list of associated bugs and commits. The view takes a list of
1246 kinds (e.g. repositories or bug trackers), and accepts a pair of a kind and arbitrary text as a new item
1249 * init-database.sql: Added task_commits table.
1251 * public/api/analysis-tasks.php:
1253 (fetch_associated_data_for_tasks): Renamed from fetch_and_push_bugs_to_tasks now that it also fetches
1254 the list of commits associated with each analysis task by calling CommitLogFetcher::fetch_for_tasks.
1255 Also fixe the bug that we were not taking
1256 (format_task): No longer sets 'category' since the computation of category now depends on the list of
1257 commits associated with this analysis task which aren't available until fetch_associated_data_for_tasks.
1258 (determine_category): Added. Categorize any analysis tasks with "fixes" commits as "closed" and "causes"
1259 commits as "identified".
1261 * public/include/commit-log-fetcher.php:
1262 (CommitLogFetcher::__construct): Remove the unused instance variable.
1263 (CommitLogFetcher::fetch_for_tasks): Added. Fetches all commits associated with a list of analysis tasks.
1264 Assumes the caller (fetch_associated_data_for_tasks) had setup "fixes" and "causes" fields on each task.
1266 * public/privileged-api/associate-commit.php: Added. Updates task_commits table to associate or disassociate
1267 a commit with an analysis task. When the specified analysis task and the specified commit are already
1268 associated, we simply update the table instead of adding a duplicating entry or error. For dissociation,
1269 the front-end specifies the commit ID.
1272 * public/v3/index.html:
1273 * public/v3/components/mutable-list-view.js: Added. Used by the list associated bugs and commits.
1274 (MutableListView): Added.
1275 (MutableListView.prototype.setList): Added.
1276 (MutableListView.prototype.setKindList): Added.
1277 (MutableListView.prototype.setAddCallback): Added. This callback is invoked when the user tries to add
1278 a new item to the list.
1279 (MutableListView.prototype.render): Added.
1280 (MutableListView.prototype._submitted): Added.
1281 (MutableListView.cssTemplate):
1282 (MutableListView.htmlTemplate):
1283 (MutableListItem): Added. RemovalLink could be a hyperlink or a callback and gets involved when the user
1284 tries to delete this item.
1285 (MutableListItem.prototype.content):
1287 * public/v3/models/analysis-task.js:
1288 (AnalysisTask): Added the support of the list of commits that fixed and caused changes.
1289 (AnalysisTask.prototype.updateSingleton): Ditto.
1290 (AnalysisTask.prototype.causes): Added.
1291 (AnalysisTask.prototype.fixes): Added.
1292 (AnalysisTask.prototype.associateCommit): Added. Use the API added at /privileged-api/associate-commit
1293 to associate a new commit with this analysis task. Each commit has either caused or fixed the change.
1294 (AnalysisTask.prototype.dissociateCommit): Added. Use the same API to disassociate each commit.
1295 (AnalysisTask._constructAnalysisTasksFromRawData): Find all commits associated with each analysis task.
1296 Because commit log objects use a fake ID fdue to /api/measurement-set not providing commit IDs, we must
1297 use CommitLog.findByRemoteId to find each commit instead of usual CommitLog.findById.
1298 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Added.
1300 * public/v3/models/build-request.js:
1301 (BuildRequest.prototype.hasFinished): Renamed from hasCompleted since it was confusing for this._status
1302 being "completed" wasn't a necessary condition for this function to return true.
1304 * public/v3/models/commit-log.js:
1305 (CommitLog): Added the static map for actual commit ID instead of a fake ID created in ensureSingleton.
1306 (CommitLog.prototype.remoteId): Added. Returns the real commit ID.
1307 (CommitLog.findByRemoteId): Added. Finds an CommitLog object using the real ID.
1309 * public/v3/models/test-group.js:
1310 (TestGroup.prototype.hasFinished): Renamed from hasCompleted to match the rename in BuildRequest.
1312 * public/v3/pages/analysis-task-page.js:
1313 (AnalysisTaskPage): Added lists for the commits that fixed and caused the change using MutableListView.
1314 Also adopted MutableListView for the list of associated bugs.
1315 (AnalysisTaskPage.prototype.render): Added the code to populate the newly added lists.
1316 (AnalysisTaskPage.prototype._makeCommitListItem): Added.
1317 (AnalysisTaskPage.prototype._associateBug): Now this is a callback from MutableListView.
1318 (AnalysisTaskPage.prototype._associateCommit): Added.
1319 (AnalysisTaskPage.prototype._dissociateCommit): Added.
1320 (AnalysisTaskPage.htmlTemplate):
1321 (AnalysisTaskPage.cssTemplate):
1323 * public/v3/remote.js:
1324 (getJSON): Spit out the entire responseText when JSON failed to parse to make debugging easier.
1326 2016-03-15 Ryosuke Niwa <rniwa@webkit.org>
1328 Extract the code to format commit logs into its own PHP file
1329 https://bugs.webkit.org/show_bug.cgi?id=155514
1331 Rubber-stamped by Chris Dumez.
1333 Extracted CommitLogFetcher out of /api/commits so that it could be used in analysis-tasks.php
1334 in the future to support associating cause/fix for each analysis task.
1336 * public/api/commits.php:
1337 * public/include/commit-log-fetcher.php: Added.
1339 (CommitLogFetcher::__construct): Added.
1340 (CommitLogFetcher::repository_id_from_name): Added.
1341 (CommitLogFetcher::fetch_between): Added.
1342 (CommitLogFetcher::fetch_oldest): Added.
1343 (CommitLogFetcher::fetch_latest): Added.
1344 (CommitLogFetcher::fetch_last_reported): Added.
1345 (CommitLogFetcher::fetch_revision): Added.
1346 (CommitLogFetcher::commit_for_revision): Added.
1347 (CommitLogFetcher::format_single_commit): Added.
1348 (CommitLogFetcher::format_commit): Added.
1350 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1352 Build fix after r196870.
1354 * public/include/report-processor.php:
1356 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1358 Add Size metric to perf dashboard
1359 https://bugs.webkit.org/show_bug.cgi?id=155266
1361 Reviewed by Chris Dumez.
1363 Added the "Size" metric and use bytes as its unit.
1365 * public/js/helper-classes.js:
1367 * public/v2/data.js:
1368 (RunsData.unitFromMetricName):
1370 2016-02-20 Ryosuke Niwa <rniwa@webkit.org>
1372 Add the support for universal slave password
1373 https://bugs.webkit.org/show_bug.cgi?id=154476
1375 Reviewed by David Kilzer.
1377 Added the support for universalSlavePassword.
1380 * public/include/report-processor.php:
1381 (ReportProcessor::process):
1382 (ReportProcessor::authenticate_and_construct_build_data): Extracted from process().
1384 2016-02-19 Ryosuke Niwa <rniwa@webkit.org>
1386 Analysis tasks page complains about missing repository but with a wrong name
1387 https://bugs.webkit.org/show_bug.cgi?id=154468
1389 Reviewed by Chris Dumez.
1391 Fixed the bug by using the right variable in the template literal.
1393 * public/v3/components/customizable-test-group-form.js:
1394 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use querySelector here since Chrome doesn't have
1395 getElementsByClassName on ShadowRoot.
1396 * public/v3/pages/analysis-task-page.js:
1397 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Use name which is the name of
1400 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1402 Revert an unintended change made in the previous commit.
1404 * init-database.sql:
1406 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1408 Perf dashboard should let user cancel pending A/B testing and hide failed ones
1409 https://bugs.webkit.org/show_bug.cgi?id=154433
1411 Reviewed by Chris Dumez.
1413 Added a button to hide a test group in the details view (the bottom table) in the analysis task page, and
1414 "Show hidden tests" link to show the hidden test groups on demand. When a test group is hidden, all pending
1415 requests in the group will also be canceled since a common scenario of using this feature is that the user
1416 had triggered an useless A/B testing; e.g. all builds will fail, wrong, etc... We can revisit and add the
1417 capability to just cancel the pending requests and leaving the group visible later if necessary.
1419 Run `ALTER TYPE build_request_status_type ADD VALUE 'canceled';` to add the new type.
1421 * init-database.sql: Added testgroup_hidden column to analysis_test_groups table and added 'canceled'
1422 as a value to build_request_status_type table.
1423 * public/api/test-groups.php:
1424 (format_test_group): Added 'hidden' field in the JSON result.
1425 * public/privileged-api/update-test-group.php:
1426 (main): Added the support for updating testgroup_hidden column. When this column is set to true, also
1427 cancel all pending build requests (by setting its request_status to 'canceled' which will be ignore by
1428 the syncing script).
1429 * public/v3/components/test-group-results-table.js:
1430 (TestGroupResultsTable.prototype.setTestGroup): Reset _renderedTestGroup here so that the next call to
1431 render() will update the table; e.g. when build requests' status change from 'Pending' to 'Canceled'.
1432 * public/v3/models/build-request.js:
1433 (BuildRequest.prototype.hasCompleted): A build request is considered complete/finished if it's canceled.
1434 (BuildRequest.prototype.hasPending): Added.
1435 (BuildRequest.prototype.statusLabel): Handle 'canceled' status.
1436 * public/v3/models/test-group.js:
1438 (TestGroup.prototype.updateSingleton): Added to update 'hidden' field.
1439 (TestGroup.prototype.isHidden): Added.
1440 (TestGroup.prototype.hasPending): Added.
1441 (TestGroup.prototype.hasPending): Added.
1442 (TestGroup.prototype.updateHiddenFlag): Added. Uses the privileged API to update testgroup_hidden column.
1443 The JSON API also updates the status of the 'pending' build requests in the group to 'canceled'.
1444 * public/v3/pages/analysis-task-page.js:
1445 (AnalysisTaskPage): Added _showHiddenTestGroups and _filteredTestGroups as instance variables.
1446 (AnalysisTaskPage.prototype._didFetchTestGroups):
1447 (AnalysisTaskPage.prototype._showAllTestGroups): Added.
1448 (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState): Extracted from _didFetchTestGroups.
1449 (AnalysisTaskPage.prototype._renderTestGroupList): Use the filtered list of test groups to show the list
1450 of test groups. When all test groups are shown, we would first show the hidden ones after the regular ones.
1451 (AnalysisTaskPage.prototype._createTestGroupListItem): Extracted from _renderTestGroupList.
1452 (AnalysisTaskPage.prototype._renderTestGroupDetails): Update the text inside the button to hide the test
1453 group. Also show a warning text that the pending requests will be canceled if there are any.
1454 (AnalysisTaskPage.prototype._hideCurrentTestGroup): Added.
1455 (AnalysisTaskPage.cssTemplate): Updated the style.
1457 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1459 The rows in the analysis results table should be expandable
1460 https://bugs.webkit.org/show_bug.cgi?id=154427
1462 Reviewed by Chris Dumez.
1464 Added "(Expand)" link between rows that have hidden points. Upon click it inserts the hidden rows.
1466 We insert around five rows at a time when there are hundreds of hidden points but we also avoid leaving
1467 behind expandable rows of less than two rows.
1469 Also fixed a bug in CustomizableTestGroupForm that getElementsById would throw in the shipping Safari
1470 because getElementsById doesn't exist on Element.prototype by using class name instead.
1472 * public/v3/components/analysis-results-viewer.js:
1473 (AnalysisResultsViewer):
1474 (AnalysisResultsViewer.prototype.setCurrentTestGroup): Removed superfluous call to render().
1475 (AnalysisResultsViewer.prototype.setPoints): Always show the start and the end points.
1476 (AnalysisResultsViewer.prototype.buildRowGroups):
1477 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Add an instance of ExpandableRow which
1478 shows a "(Expand)" link to show hidden rows here.
1479 (AnalysisResultsViewer.prototype._expandBetween): Added. Expands rows between two points.
1480 (AnalysisResultsViewer.cssTemplate): Added rules for "(Expand)" links.
1481 (AnalysisResultsViewer.ExpandableRow): Added.
1482 (AnalysisResultsViewer.ExpandableRow.prototype.resultContent): Added. Overrides what's in the results column.
1483 (AnalysisResultsViewer.ExpandableRow.prototype.heading): Added. Generates "(Expand)" link.
1485 * public/v3/components/customizable-test-group-form.js:
1486 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use getElementsByClassName instead of
1488 (CustomizableTestGroupForm.prototype._classForLabelAndRepository): Renamed from _idForLabelAndRepository.
1489 (CustomizableTestGroupForm._constructRevisionRadioButtons): Set class name instead of id.
1491 * public/v3/components/results-table.js:
1492 (ResultsTable.prototype.render): Don't generate radio buttons to select a row when root set is missing;
1493 e.g. for rows that show "(Expand)" links.
1495 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1497 Statistically significant A/B testing results should be color coded in details view
1498 https://bugs.webkit.org/show_bug.cgi?id=154414
1500 Reviewed by Chris Dumez.
1502 Color code the statistically significant comparisions in TestGroupResultsTable as done in the analysis
1505 * public/v3/components/customizable-test-group-form.js:
1506 (CustomizableTestGroupForm.cssTemplate): Build fix after r196768.
1507 * public/v3/components/test-group-results-table.js:
1508 (TestGroupResultsTable.prototype.buildRowGroups): Add the status as a class name.
1509 (TestGroupResultsTable.cssTemplate): Added styles to color-code statistically significant results.
1511 2016-02-17 Ryosuke Niwa <rniwa@webkit.org>
1513 v3 UI should allow custom revisions for A/B testing
1514 https://bugs.webkit.org/show_bug.cgi?id=154379
1516 Reviewed by Chris Dumez.
1518 Added the capability to customize revisions selected in the overview chart and the results viewer.
1520 Newly added CustomizableTestGroupForm is responsible for allowing users to modify the set of revisions in
1521 a new A/B testing group. Unlike TestGroupForm which doesn't know anything about which revisions are selected
1522 for each project/repository, CustomizableTestGroupForm is aware of the list of revisions used in each set.
1524 The list of revisions used in each set is represented by RootSet if users had not customized them, and
1525 CustomRootSet otherwise; the latter was added since regular RootSet object requires CommitLog and other
1526 DataModelObjects which are hard to create without corresponding database entries.
1528 * public/v3/components/customizable-test-group-form.js: Added.
1529 (CustomizableTestGroupForm): Added.
1530 (CustomizableTestGroupForm.prototype.setRootSetMap): Added.
1531 (CustomizableTestGroupForm.prototype._submitted): Overrides the superclass' method.
1532 (CustomizableTestGroupForm.prototype._customize): Ditto. Unlike TestGroupForm's callback, this class'
1533 callback passes in a root set map as the third argument.
1534 (CustomizableTestGroupForm.prototype._computeRootSetMap): Added. Returns this._rootSetMap, which is set by
1535 AnalysisTaskPage if user had not customized the root sets. Otherwise return a new map with CustomRootSet's.
1536 (CustomizableTestGroupForm.prototype.render): Added. Creates a table to allow customization of root sets.
1537 (CustomizableTestGroupForm._constructRevisionRadioButtons): Added.
1538 (CustomizableTestGroupForm._createRadioButton): Added.
1539 (CustomizableTestGroupForm.cssTemplate): Added.
1540 (CustomizableTestGroupForm.formContent): Added. This method is called by TestGroupForm.htmlTemplate.
1541 * public/v3/components/test-group-form.js:
1542 (TestGroupForm): Updated the various methods to not directly mutate DOM. Store the state in instance
1543 variables and update DOM in render() as done elsewhere.
1544 (TestGroupForm.prototype.setNeedsName): Deleted. We no longer need this flag since TestGroupForm which is
1545 used for retries never needs a name and CustomizableTestGroupForm which is used to create a new test group
1546 always requires a name.
1547 (TestGroupForm.prototype.setDisabled):
1548 (TestGroupForm.prototype.setLabel):
1549 (TestGroupForm.prototype.setRepetitionCount):
1550 (TestGroupForm.prototype.render): Added.
1551 (TestGroupForm.prototype._submitted): Moved the code to prevent the default action has been moved to the
1552 constructor since this method is overridden by CustomizableTestGroupForm.
1553 (TestGroupForm.cssTemplate): Added.
1554 (TestGroupForm.htmlTemplate):
1555 (TestGroupForm.formContent): Extracted from htmlTemplate.
1556 * public/v3/index.html:
1557 * public/v3/models/repository.js:
1558 (Repository.sortByNamePreferringOnesWithURL): Added.
1559 * public/v3/models/root-set.js:
1560 (RootSet.prototype.revisionForRepository): Added so that _createTestGroupAfterVerifyingRootSetList can retrieve
1561 the revision information from CustomRootSet without going through CommitLog objects since CustomRootSet doesn't
1562 have associated CommitLog objects.
1563 (CustomRootSet): Added. Used by CustomizableTestGroupForm to create a custom root map since regular RootSet
1564 requires CommitLog and other related objects which are hard to create without database entries.
1565 (CustomRootSet.prototype.setRevisionForRepository): Added.
1566 (CustomRootSet.prototype.repositories): Added.
1567 (CustomRootSet.prototype.revisionForRepository): Added.
1568 * public/v3/pages/analysis-task-page.js:
1570 (AnalysisTaskPage.prototype.render): Removed the reference to v2 UI since v3 UI is now strictly more powerful
1571 than v2 UI. Also update the root set maps in each form here.
1572 (AnalysisTaskPage.prototype._retryCurrentTestGroup): No longer takes unused name argument as it got removed
1574 (AnalysisTaskPage.prototype._chartSelectionDidChange): No longer updates the disabled-ness here since it's now
1575 done in render() via setRootSetMap().
1576 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Now takes rootSetMap as an argument.
1577 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): No longer updates the disabled-ness here
1578 since it's now done in render() via setRootSetMap().
1579 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Now takes rootSetMap as an argument.
1580 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Take a dictionary of root set labels
1581 such as A and B, which maps to a RootSet or a newly-added CustomRootSet.
1582 (AnalysisTaskPage.htmlTemplate): Use customizable-test-group-form for creating a new A/B testing group. Retry
1583 form will continue to use TestGroupForm since customizing revisions is non-sensical in retries.
1584 (AnalysisTaskPage.cssTemplate): Updated the style.
1586 2016-02-16 Ryosuke Niwa <rniwa@webkit.org>
1588 v3 UI has the capability to schedule an A/B testing in a specific range
1589 https://bugs.webkit.org/show_bug.cgi?id=154329
1591 Reviewed by Chris Dumez.
1593 Extended AnalysisTaskChartPane and ResultsTable so that users can select a range of points in either
1594 the overview chart pane and the results viewer table. Extracted TestGroupForm out of the analysis task
1595 page and used right below those two components in the analysis task page.
1597 * public/v3/components/results-table.js:
1599 (ResultsTable.prototype.setRangeSelectorLabels): Added.
1600 (ResultsTable.prototype.setRangeSelectorCallback): Added.
1601 (ResultsTable.prototype.selectedRange): Added.
1602 (ResultsTable.prototype._rangeSelectorClicked): Added.
1603 (ResultsTable.prototype.render): Generate radio boxes to select a range.
1605 * public/v3/components/test-group-form.js:
1607 (TestGroupForm.prototype.setStartCallback): Added.
1608 (TestGroupForm.prototype.setNeedsName): Added.
1609 (TestGroupForm.prototype.setDisabled): Added.
1610 (TestGroupForm.prototype.setLabel): Added.
1611 (TestGroupForm.prototype.setRepetitionCount): Added.
1612 (TestGroupForm.prototype._submitted): Added.
1613 (TestGroupForm.htmlTemplate): Extracted from AnalysisTaskPage.htmlTemplate.
1615 * public/v3/index.html:
1617 * public/v3/pages/analysis-task-page.js:
1618 (AnalysisTaskChartPane.prototype._mainSelectionDidChange): Added. Delegates the work to AnalysisTaskPage.
1619 (AnalysisTaskChartPane.prototype.selectedPoints): Added.
1621 (AnalysisTaskPage.prototype.title):
1622 (AnalysisTaskPage.prototype.render):
1623 (AnalysisTaskPage.prototype._renderTestGroupDetails): Use TestGroupForm's methods instead of mutating DOM.
1624 (AnalysisTaskPage.prototype._retryCurrentTestGroup):
1625 (AnalysisTaskPage.prototype._chartSelectionDidChange): Added.
1626 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Added.
1627 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Added.
1628 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Added.
1629 (AnalysisTaskPage.prototype._createRetryNameForTestGroup):
1630 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Extracted from _retryCurrentTestGroup
1631 so that we can call it in _createNewTestGroupFromChart and _createNewTestGroupFromViewer.
1632 (AnalysisTaskPage.htmlTemplate):
1634 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1636 Extract the code specific to v2 UI out of shared statistics.js
1637 https://bugs.webkit.org/show_bug.cgi?id=154277
1639 Reviewed by Chris Dumez.
1641 Extracted statistics-strategies.js out of statistics.js for v2 UI and detect-changes.js. The intent is to
1642 deprecate this file once we implement refined statistics tools in v3 UI and adopt it in detect-changes.js.
1644 * public/shared/statistics.js:
1645 (Statistics.movingAverage): Extracted from the "Simple Moving Average" strategy.
1646 (Statistics.cumultaiveMovingAverage): Extracted from the "Cumulative Moving Average" strategy.
1647 (Statistics.exponentialMovingAverage): Extracted from the "Exponential Moving Average" strategy.
1648 Use a temporary "movingAverage" to keep the last moving average instead of relying on the previous
1649 entry in "averages" array to avoid special casing an array of length 1 and starting the loop at i = 1.
1650 (Statistics.segmentTimeSeriesGreedyWithStudentsTTest): Extracted from "Segmentation: Recursive t-test"
1651 strategy. Don't create the list of averages to match segmentTimeSeriesByMaximizingSchwarzCriterion here.
1652 It's done in newly added averagesFromSegments.
1653 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Extracted from
1654 "Segmentation: Schwarz criterion" strategy.
1655 (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Just store the start index to match
1657 (App.Pane.updateStatisticsTools):
1658 (App.Pane._computeMovingAverageAndOutliers):
1659 * public/v2/data.js:
1660 * public/v2/index.html:
1661 * public/v2/statistics-strategies.js: Added.
1662 (StatisticsStrategies.MovingAverageStrategies): Added.
1663 (averagesFromSegments): Extracted from "Segmentation: Schwarz criterion" strategy. Now used by both
1664 "Segmentation: Recursive t-test" and "Segmentation: Schwarz criterion" strategies.
1665 (StatisticsStrategies.EnvelopingStrategies): Moved from Statistics.EnvelopingStrategies.
1666 (StatisticsStrategies.TestRangeSelectionStrategies): Moved from Statistics.TestRangeSelectionStrategies.
1667 (createWesternElectricRule): Moved from statistics.js.
1668 (countValuesOnSameSide): Ditto.
1669 (StatisticsStrategies.executeStrategy): Moved from Statistics.executeStrategy.
1670 * tools/detect-changes.js:
1671 (computeRangesForTesting):
1673 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1675 v1 UI and v2 UI should share statistics.js
1676 https://bugs.webkit.org/show_bug.cgi?id=154262
1678 Reviewed by Chris Dumez.
1680 Share statistics.js between v1 and v2 UI.
1682 * public/index.html:
1683 * public/js/shared.js: Deleted.
1684 * public/js/statistics.js: Removed.
1685 * public/shared: Added.
1686 * public/shared/statistics.js: Moved from Websites/perf.webkit.org/public/v2/js/statistics.js.
1687 * public/v2/index.html:
1688 * public/v2/js/statistics.js: Removed.
1689 * public/v3/index.html:
1690 * tools/detect-changes.js:
1692 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1694 v3 UI sometimes shows same dates twice on the x-axis of time series charts
1695 https://bugs.webkit.org/show_bug.cgi?id=154210
1697 Reviewed by Chris Dumez.
1699 The bug was caused by the label generation code in TimeSeriesChart.computeTimeGrid never emitting hours.
1701 Use hours instead of dates as labels when the current time's date is same as the previous label's date.
1702 Always include dates before entering this mode to avoid just having hours as labels on the entire x-axis.
1704 * public/v3/components/time-series-chart.js:
1705 (TimeSeriesChart.prototype._renderXAxis): Slightly increase the "average" width of x-axis label.
1706 (TimeSeriesChart.computeTimeGrid): See above. Also assert that the number of labels we generate never
1707 exceeds maxLabels as a sanity check.
1708 (TimeSeriesChart._timeIterators): Added an iterator that increments by two hours for zoomed graphs.
1710 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1712 v3 UI should show status and associated bugs on analysis task pages
1713 https://bugs.webkit.org/show_bug.cgi?id=154212
1715 Reviewed by Chris Dumez.
1717 Added the capability to see and modify the status and the list of associated of bugs on analysis task pages.
1719 Also added the list of related tasks, which are analysis tasks associated with the same bug or have
1720 overlapping time ranges with the same test metric but on a potentially different platform.
1722 In addition, categorize analysis tasks with the status of "no change" or "inconclusive" as "closed" as no
1723 further action can be taken (users can bring them back to non-closed state without any restrictions).
1725 * public/api/analysis-tasks.php:
1726 (format_task): Categorize 'unchanged' and 'inconclusive' analysis tasks as closed.
1728 * public/privileged-api/associate-bug.php:
1729 (main): Added shouldDelete as a new mechanism to disassociate a bug since v3 UI shares a single Bug object
1730 between multiple analysis tasks (as it should have been in the first place).
1732 * public/v3/components/chart-pane-base.js:
1734 (ChartPaneBase.prototype._fetchAnalysisTasks): Since each analysis task's change type (status/result) could
1735 change, we need to create annotation objects during each render() call.
1736 (ChartPaneBase.prototype.render):
1737 (ChartPaneBase.prototype._renderAnnotations): Extracted from ChartPaneBase.prototype._fetchAnalysisTasks to
1738 do that. I was afraid of the perf impact of this but it doesn't seem to be an issue in my testing.
1739 (ChartPaneBase.cssTemplate): Removed superfluous margins (moved to ChartPane.cssTemplate) around the charts
1740 since they are only useful in the charts page.
1742 * public/v3/models/analysis-task.js:
1744 (AnalysisTask.prototype.updateSingleton): Added a comment as to why object.result cannot be renamed to
1745 object.changeType in the JSON API.
1746 (AnalysisTask.prototype.updateName): Added.
1747 (AnalysisTask.prototype.updateChangeType): Added.
1748 (AnalysisTask.prototype._updateRemoteState): Added.
1749 (AnalysisTask.prototype.associateBug): Added.
1750 (AnalysisTask.prototype.disassociateBug): Added.
1751 (AnalysisTask.fetchRelatedTasks): Added. See above for the criteria of related-ness.
1753 * public/v3/pages/analysis-task-page.js:
1755 (AnalysisTaskPage.prototype.updateFromSerializedState):
1756 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): Extracted from updateFromSerializedState.
1757 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks): Added.
1758 (AnalysisTaskPage.prototype.render): Render the list of associated bugs, the list of bug trackers (so that
1759 users can use it to associate with a new bug), and the list of related analysis tasks.
1760 (AnalysisTaskPage.prototype._renderTestGroupList): Extracted from render since it was getting too long.
1761 (AnalysisTaskPage.prototype._renderTestGroupDetails): Ditto.
1762 (AnalysisTaskPage.prototype._updateChangeType): Added.
1763 (AnalysisTaskPage.prototype._associateBug): Added.
1764 (AnalysisTaskPage.prototype._disassociateBug): Added.
1765 (AnalysisTaskPage.htmlTemplate): Added various elements to show and modify the status, associate bugs,
1766 and a list of related analysis tasks.
1767 (AnalysisTaskPage.cssTemplate): Added various styles for those form controls.
1769 * public/v3/pages/chart-pane.js:
1770 (ChartPane.cssTemplate): Moved the margins from ChartPaneBase.cssTemplate.
1772 2016-02-12 Ryosuke Niwa <rniwa@webkit.org>
1774 Perf dashboard should allow renaming analysis tasks and test groups
1775 https://bugs.webkit.org/show_bug.cgi?id=154200
1777 Reviewed by Chris Dumez.
1779 Allow editing names of analysis tasks and A/B testing groups in the v3 UI.
1781 Added the support for updating the name to the privileged API at /privileged-api/update-analysis-task
1782 and added a new prevailed API to update A/B testing groups at /privileged-api/update-test-group.
1784 * public/privileged-api/update-analysis-task.php: Added the support for renaming the analysis task.
1787 * public/privileged-api/update-test-group.php: Added. Supports updating the test group's name.
1790 * public/v3/components/editable-text.js: Added.
1791 (EditableText): Added. A new editable text label control. It looks like a text node with "(Edit)" link
1792 at the end which allow users to go into the "editing mode", which reveals an input element.
1793 The user can exit the editing mode by either moving the focus away from the control or clicking on
1794 "(Save)" at the end. It calls _updateCallback in the latter case.
1795 (EditableText.prototype.editedText): Returns the current value of the input element user.
1796 (EditableText.prototype.setText): Sets the label. This does not live-update the input element until
1797 the user exists the current editing mode and re-enters it.
1798 (EditableText.prototype.setStartedEditingCallback): Sets a callback which gets called when the user
1799 requested to enter the editing mode. Since EditableText relies on AnalysisTaskPage to render, this
1800 callback only exits to call EditableText.render() in AnalysisTask._didStartEditingTaskName.
1801 (EditableText.prototype.setUpdateCallback): Sets a callback which gets called when the user exits
1802 the editing mode by activating the "(Save)" link. This callback MUST return a promise upon resolution
1803 of which the control gets out of the editing mode. While the promise is in flight, the input element
1805 (EditableText.prototype.render): Updates various states of the elements. When _updatingPromise is not
1806 falsy, we make the input element readonly and show '(...)' on the link. Don't show the action link
1807 if the label is empty (e.g. analysis task or test group is still being fetched).
1808 (EditableText.prototype._didClick): Called when the user clicked on the action link. Enter the editing
1809 mode or save the edited label via _updateCallback.
1810 (EditableText.prototype._didBlur): Exit the editing mode without saving if the input element is not
1811 focused, there is no inflight promise returned by _updateCallback, and the action link "(Save)" does
1813 (EditableText.prototype._didUpdate): Called when exiting the editing mode.
1814 (EditableText.htmlTemplate):
1815 (EditableText.cssTemplate):
1817 * public/v3/index.html: Include newly added editable-text.js.
1819 * public/v3/models/analysis-task.js:
1820 (AnalysisTask.prototype.updateSingleton): Added.
1821 (AnalysisTask.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1822 the analysis task from the sever.
1823 (AnalysisTask._constructAnalysisTasksFromRawData): Use ensureSingleton instead of manually calling
1824 findById since we need to update the name of the singleton object we found (via updateSingleton).
1826 * public/v3/models/bug.js:
1827 (Bug.ensureSingleton): Moved the code to compute the synthetic id from AnalysisTask's
1828 _constructAnalysisTasksFromRawData.
1829 (Bug.prototype.updateSingleton): Added. Just assert that nothing changes.
1831 * public/v3/models/build-request.js:
1832 (BuildRequest.prototype.updateSingleton): Added. Assert that the intrinsic values of a build request
1833 doesn't change and update status text, status url, and build id as they could change.
1835 * public/v3/models/commit-log.js:
1836 (CommitLog): Made the constructor argument conform to the convention of id, object pair so that we can
1837 use DataModelObject.ensureSingleton.
1838 (CommitLog.ensureSingleton):
1839 (CommitLog.prototype.updateSingleton): Extracted from CommitLog.ensureSingleton.
1841 * public/v3/models/data-model.js:
1842 (DataModelObject.ensureSingleton): Call newly added updateSingleton.
1843 (DataModelObject.prototype.updateSingleton):
1844 (LabeledObject): Removed the name map since it's never used (findByName is never called anywhere).
1845 (LabeledObject.prototype.updateSingleton): Added. Updates _name.
1846 (LabeledObject.findByName): Deleted.
1848 * public/v3/models/test-group.js:
1849 (TestGroup.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1850 the test group from the sever.
1851 (TestGroup._createModelsFromFetchedTestGroups): Removed bogus code. A root set doesn't have a test
1852 group associated with it since multiple test groups can share a single root set (this property doesn't
1855 * public/v3/pages/analysis-task-page.js:
1856 (AnalysisTaskPage): Removed useless _taskId and added this._testGroupLabelMap and this._taskNameLabel.
1857 (AnalysisTaskPage.prototype.updateFromSerializedState): Cleanup.
1858 (AnalysisTaskPage.prototype._didFetchTask): Assert that this function is called exactly once.
1859 (AnalysisTaskPage.prototype.render): Use this._task.id() to show the v2 link. Use EditableText to show
1860 the names of the analysis task and the associated test groups. Hide the overview chart and the list of
1861 test groups (along with the retry/confirm button) when the analysis task failed to fetch. We always
1862 update the names of the analysis task and the associated test groups since they could be updated by
1864 (AnalysisTaskPage.prototype._didStartEditingTaskName): Added.
1865 (AnalysisTaskPage.prototype._updateTaskName): Added.
1866 (AnalysisTaskPage.prototype._updateTestGroupName): Added.
1867 (AnalysisTaskPage.htmlTemplate): Updated the style.
1869 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1871 Land the change that was supposed to be the part of r196463.
1873 * public/v3/pages/analysis-task-page.js:
1874 (AnalysisTaskPage.prototype._didFetchTestGroups): Select the latest test group by default.
1876 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1878 Refine v3 UI's analysis task page
1879 https://bugs.webkit.org/show_bug.cgi?id=154152
1881 Reviewed by Chris Dumez.
1883 This patch makes the following refinements to the analysis task page:
1884 - Always show the relative different of in-progress A/B testing.
1885 - Make the annotations (colored bars) in the chart open other analysis tasks.
1886 - Order the A/B testing groups in the reverse chronological order.
1887 - Select the time range corresponding to the current test group.
1889 * public/v3/components/analysis-results-viewer.js:
1890 (AnalysisResultsViewer.cssTemplate): Fixed the bug that pending and running testing groups are no longer
1891 colored after r196440. Use a slightly more opaque color for currently running groups compared to pending ones.
1893 * public/v3/components/chart-pane-base.js:
1894 (ChartPaneBase.prototype.setMainSelection): Added.
1895 (ChartPaneBase.prototype._openAnalysisTask): Moved the code from ChartPane._openAnalysisTask so that it can be
1896 reused in both AnalysisTaskChartPane and ChartPane (in charts page).
1897 (ChartPaneBase.prototype.router): Added. Overridden by each subclass.
1899 * public/v3/components/test-group-results-table.js:
1900 (TestGroupResultsTable.prototype.buildRowGroups): Always show the summary (relative difference of A to B) as
1901 long as there are some results in each set.
1903 * public/v3/models/test-group.js:
1904 (TestGroup.prototype.compareTestResults): Always set .label and .fullLabel with the relative change as long as
1905 there are some values. Keep using "pending" and "running" in .status since that would determine the color of
1906 stacking blocks representing those A/B testing groups.
1908 * public/v3/pages/analysis-task-page.js:
1909 (AnalysisTaskChartPane):
1910 (AnalysisTaskChartPane.prototype.setPage): Added.
1911 (AnalysisTaskChartPane.prototype.router): Added.
1913 (AnalysisTaskPage.prototype.render): Show the list of A/B testing groups in the reverse chronological order.
1914 Also set the main chart's selection to the time range of the current test group.
1916 * public/v3/pages/chart-pane.js:
1917 (ChartPane.prototype.router): Added.
1918 (ChartPane.prototype._openAnalysisTask): Moved to ChartPaneBase.prototype._openAnalysisTask.
1920 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1922 Add a script to process backlogs created while perf dashboard was in the maintenance mode
1923 https://bugs.webkit.org/show_bug.cgi?id=154140
1925 Reviewed by Chris Dumez.
1927 Added a script to process the backlog JSONs created while the perf dashboard was put in the maintenance mode.
1928 It re-submits each JSON file to the perf dashboard using the same server config file used by syncing scripts.
1930 * public/include/report-processor.php:
1931 (TestRunsGenerator::test_value_list_to_values_by_iterations): Fixed a bug in the error message code. It was
1932 referencing an undeclared variable.
1933 * tools/process-maintenance-backlog.py: Added.
1935 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1937 AnalysisResultsViewer never uses this._smallerIsBetter
1938 https://bugs.webkit.org/show_bug.cgi?id=154134
1940 Reviewed by Chris Dumez.
1942 Removed the unused instance variable _smallerIsBetter from AnalysisResultsViewer and TestGroupStackingBlock.
1944 * public/v3/components/analysis-results-viewer.js:
1945 (AnalysisResultsViewer): Removed the unused _smallerIsBetter.
1946 (AnalysisResultsViewer.prototype.setSmallerIsBetter): Deleted.
1947 (AnalysisResultsViewer.prototype.buildRowGroups):
1948 (AnalysisResultsViewer.TestGroupStackingBlock): Removed the unused _smallerIsBetter.
1949 * public/v3/pages/analysis-task-page.js:
1950 (AnalysisTaskPage.prototype._didFetchTask):
1952 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1954 Build fix after r196440.
1956 * public/v3/models/test-group.js:
1957 (TestGroup.prototype.addBuildRequest): Clear the map instead of setting the property to null.
1959 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
1961 Perf dashboard should have UI to retry A/B testing
1962 https://bugs.webkit.org/show_bug.cgi?id=154090
1964 Reviewed by Chris Dumez.
1966 Added a button to re-try an existing A/B testing group with a custom repetition count. The same button functions
1967 as a way of confirming the progression/regression when there have been no A/B testing scheduled in the task.
1969 Also fixed the bug that A/B testing groups that have been waiting for other test groups will be shown as "running".
1971 * public/v3/components/results-table.js:
1972 (ResultsTable.cssTemplate): Don't pad the list of extra repositories when it's empty.
1974 * public/v3/components/test-group-results-table.js:
1975 (TestGroupResultsTable.prototype.buildRowGroups): Use TestGroup.labelForRootSet instead of manually
1976 computing the letter for each configuration set.
1978 * public/v3/models/build-request.js:
1979 (BuildRequest.prototype.hasStarted): Added.
1981 * public/v3/models/data-model.js:
1982 (DataModelObject.ensureSingleton): Added.
1983 (DataModelObject.cachedFetch): Added noCache option. This is used when re-fetching the test groups after
1986 * public/v3/models/measurement-cluster.js:
1987 (MeasurementCluster.prototype.startTime): Added.
1989 * public/v3/models/measurement-set.js:
1990 (MeasurementSet.prototype.hasFetchedRange): Added. Returns true only if there are no "holes" (cluster
1991 yet to be fetched) between the specified time range. This was added to fix a bug in AnalysisTaskPage's
1992 _didFetchMeasurement.
1994 * public/v3/models/test-group.js:
1995 (TestGroup): Added this._rootSetToLabel.
1996 (TestGroup.prototype.addBuildRequest): Reset this._rootSetToLabel along with this._requestedRootSets.
1997 (TestGroup.prototype.repetitionCount): Added. Returns the number of iterations executed per set. We assume that
1998 every root set in the test group shares a single repetition count.
1999 (TestGroup.prototype.requestedRootSets): Now populates this._rootSetToLabel for labelForRootSet.
2000 (TestGroup.prototype.labelForRootSet): Added.
2001 (TestGroup.prototype.hasStarted): Added.
2002 (TestGroup.prototype.compareTestResults): Use 'running' and 'pending' to differentiate test groups that are waiting
2003 for other groups to finish running from the ones that are actually running ('incomplete' before this patch).
2004 (TestGroup.fetchByTask):
2005 (TestGroup.createAndRefetchTestGroups): Added. Creates a new test group using the privileged-api/create-test-group
2006 and fetches the list of test groups for the specified analysis task.
2007 (TestGroup._createModelsFromFetchedTestGroups): Extracted from TestGroup.fetchByTask.
2009 * public/v3/pages/analysis-task-page.js:
2010 (AnalysisTaskPage): Initialize _renderedCurrentTestGroup to undefined so that we'd always can differentiate
2011 the initial call to AnalysisTaskPage.render and subsequent calls in which it's identical to _currentTestGroup.
2012 (AnalysisTaskPage.prototype._didFetchMeasurement): Fixed a bug that we don't exit early even when some
2013 clusters in between startPoint and endPoint are still being fetched via newly added hasFetchedRange.
2014 (AnalysisTaskPage.prototype.render): Update the default repetition count based on the current test group.
2015 Also update the label of the button to "Confirm the change" if there is no A/B testing in this task.
2016 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Added. Re-triggers an existing A/B testing group or creates
2017 the A/B testing for the entire range of the analysis task.
2018 (AnalysisTaskPage.prototype._hasDuplicateTestGroupName): Added.
2019 (AnalysisTaskPage.prototype._createRetryNameForTestGroup): Added.
2020 (AnalysisTaskPage.htmlTemplate): Added form controls to re-trigger A/B testing.
2021 (AnalysisTaskPage.cssTemplate): Updated the style.
2023 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2025 Removed the duplicated definition of ChartPaneBase.
2027 * public/v3/components/chart-pane-base.js:
2029 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
2031 Analysis task page on v3 UI should show charts
2032 https://bugs.webkit.org/show_bug.cgi?id=154057
2034 Reviewed by Chris Dumez.
2036 Extracted ChartPaneBase out of ChartPane and added an instance of its new subclass, AnalysisTaskChartPane,
2037 to the analysis task page. The main difference is that ChartPaneBase doesn't depend on the presence of
2038 this._chartsPage unlike ChartPane. It also doesn't have the header with toolbar (to show breakdown, etc...).
2040 * public/v3/components/base.js:
2041 (ComponentBase.prototype._constructShadowTree): Call htmlTemplate() and cssTemplate() with the right "this".
2043 * public/v3/components/chart-pane-base.js: Added.
2044 (ChartPaneBase): Extracted from ChartPane.
2045 (ChartPaneBase.prototype.configure): Extracted from the constructor. Separating this function allows the
2046 component to be instantiated inside a HTML template.
2047 (ChartPaneBase.prototype._fetchAnalysisTasks): Moved from ChartPane._fetchAnalysisTasks.
2048 (ChartPaneBase.prototype.platformId): Ditto.
2049 (ChartPaneBase.prototype.metricId): Ditto.
2050 (ChartPaneBase.prototype.setOverviewDomain): Ditto.
2051 (ChartPaneBase.prototype.setMainDomain): Ditto.
2052 (ChartPaneBase.prototype._overviewSelectionDidChange): Extracted from the constructor. This is overridden in
2053 ChartPane and unused in AnalysisTaskChartPane.
2054 (ChartPaneBase.prototype._mainSelectionDidChange): Extracted from ChartPane._mainSelectionDidChange.
2055 (ChartPaneBase.prototype._mainSelectionDidZoom): Extracted from ChartPane._mainSelectionDidZoom.
2056 (ChartPaneBase.prototype._indicatorDidChange): Extracted from ChartPane._indicatorDidChange.
2057 (ChartPaneBase.prototype._didFetchData): Moved from ChartPane._fetchAnalysisTasks.
2058 (ChartPaneBase.prototype._openAnalysisTask): Ditto.
2059 (ChartPaneBase.prototype._openCommitViewer): Ditto. Also fixed a bug that we don't show the spinner while
2060 waiting for the data to be fetched by calling this.render() here.
2061 (ChartPaneBase.prototype._keyup): Moved from ChartPane._keyup. Also fixed the bug that the revisions list
2062 doesn't update by calling this.render() here.
2063 (ChartPaneBase.prototype.render): Extracted from ChartPane.render.
2064 (ChartPaneBase.htmlTemplate): Extracted from ChartPane.htmlTemplate.
2065 (ChartPaneBase.paneHeaderTemplate): Added. This is overridden in ChartPane and unused in AnalysisTaskChartPane.
2066 (ChartPaneBase.cssTemplate): Extracted from ChartPane.htmlTemplate.
2068 * public/v3/components/chart-styles.js: Renamed from public/v3/pages/page-with-charts.js.
2069 (PageWithCharts): Renamed from PageWithCharts since it no longer extends PageWithHeading.
2070 (ChartStyles.createChartSourceList):
2072 * public/v3/components/commit-log-viewer.js:
2073 (CommitLogViewer.prototype.view): Set this._repository right away instead of waiting for the fetched data
2074 so that spinner will be shown while the data is being fetched.
2076 * public/v3/index.html:
2078 * public/v3/pages/analysis-task-page.js:
2079 (AnalysisTaskChartPane): Added extends ChartPaneBase.
2080 (AnalysisTaskPage): Added. this._chartPane.
2081 (AnalysisTaskPage.prototype._didFetchTask): Initialize this._chartPane with a domain.
2082 (AnalysisTaskPage.prototype.render): Render this._chartPane.
2083 (AnalysisTaskPage.htmlTemplate):
2085 * public/v3/pages/chart-pane-status-view.js:
2086 (ChartPaneStatusView): Removed the unused router from the argument list.
2087 (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Renamed from analyzeData() since it was ambiguous.
2088 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Fixed the bug that we don't update the list
2089 of the revisions here.
2090 (ChartPaneStatusView.prototype.computeChartStatusLabels):
2092 * public/v3/pages/chart-pane.js:
2093 (ChartPane): Now extends ChartPaneBase.
2094 (ChartPane.prototype._overviewSelectionDidChange): Extracted from the constructor.
2095 (ChartPane.prototype._mainSelectionDidChange):
2096 (ChartPane.prototype._mainSelectionDidZoom):
2097 (ChartPane.prototype._indicatorDidChange):
2098 (ChartPane.prototype.render):
2099 (ChartPane.prototype._renderActionToolbar):
2100 (ChartPane.paneHeaderTemplate): Extracted from htmlTemplate.
2101 (ChartPane.cssTemplate):
2102 (ChartPane.overviewOptions.selection.onchange): Deleted.
2103 (ChartPane.prototype._fetchAnalysisTasks): Deleted.
2104 (ChartPane.prototype.platformId): Deleted.
2105 (ChartPane.prototype.metricId): Deleted.
2106 (ChartPane.prototype.setOverviewDomain): Deleted.
2107 (ChartPane.prototype.setMainDomain): Deleted.
2108 (ChartPane.prototype._openCommitViewer): Deleted.
2109 (ChartPane.prototype._didFetchData): Deleted.
2110 (ChartPane.prototype._keyup): Deleted.
2112 * public/v3/pages/charts-page.js:
2114 (ChartsPage.createDomainForAnalysisTask): Extracted by createDomainForAnalysisTask; used to set the domain
2115 of the charts in the analysis task page.
2116 (ChartsPage.createStateForAnalysisTask):
2118 * public/v3/pages/dashboard-page.js:
2120 (DashboardPage.prototype._createChartForCell):
2122 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2124 Add the support for maintenance mode
2125 https://bugs.webkit.org/show_bug.cgi?id=154072
2127 Reviewed by Chris Dumez.
2129 Added the crude support for maintenance mode whereby which the reports are stored in the filesystem
2130 instead of the database.
2132 * config.json: Added maintenanceMode and maintenanceDirectory as well as forgotten siteTitle and
2133 remoteServer.httpdMutexDir.
2134 * public/api/report.php:
2135 (main): Don't connect to the database or modify database when maintenanceMode is set.
2136 * public/include/json-header.php:
2137 (ensure_privileged_api_data): Exit with InMaintenanceMode when maintenanceMode is set. This prevents
2138 privileged API such as creating analysis tasks and new A/B testing groups from modifying the database.
2140 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
2142 Analysis task page on v3 show progression as regressions
2143 https://bugs.webkit.org/show_bug.cgi?id=154045
2145 Reviewed by Chris Dumez.
2147 The bug was caused by TestGroup.compareTestResults referring to undefined _smallerIsBetter.
2148 Retrieve it from the associated metric object via the owner analysis task.
2150 * public/v3/models/test-group.js:
2152 2016-02-05 Ryosuke Niwa <rniwa@webkit.org>
2154 Testing with remote server cache is unusably slow
2155 https://bugs.webkit.org/show_bug.cgi?id=153928
2157 Reviewed by Chris Dumez.
2159 Don't use the single process mode of httpd as it's way too slow even for testing.
2160 Also we'll hit a null pointer crash (http://svn.apache.org/viewvc?view=revision&revision=1711479)
2162 Since httpd exits immediately when launched in multi-process mode, remote-cache-server.py (renamed from
2163 run-with-remote-server.py) now has "start" and "stop" commands to start/stop the Apache. Also added
2164 "reset" command to reset the cache for convenience.
2166 * Install.md: Updated the instruction.
2167 * config.json: Fixed a typo: httpdErro*r*Log.
2168 * tools/remote-cache-server.py: Copied from Websites/perf.webkit.org/tools/run-with-remote-server.py.
2169 Now takes one of the following commands: "start", "stop", and "reset".
2171 (start_httpd): Extracted from main.
2172 (stop_httpd): Added.
2173 * tools/remote-server-relay.conf: Removed redundant (duplicate) LoadModule's.
2174 * tools/run-with-remote-server.py: Removed.
2176 2016-02-04 Ryosuke Niwa <rniwa@webkit.org>
2178 Perf dashboard should have a script to setup database
2179 https://bugs.webkit.org/show_bug.cgi?id=153906
2181 Reviewed by Chris Dumez.
2183 Added tools/setup-database.py to setup the database. It retrieves the database name, username, password
2184 and initializes a database at the specified location.
2186 * Install.md: Updated instruction to setup postgres to use setup-database.py.
2187 * tools/setup-database.py: Added.
2189 (load_database_config):
2190 (determine_psql_dir):
2191 (start_or_stop_database):
2192 (execute_psql_command):
2194 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2196 buildbot syncing scripts sometimes schedule more than one requests per builder
2197 https://bugs.webkit.org/show_bug.cgi?id=153047
2199 Reviewed by Chris Dumez.
2201 The bug was caused by the check for singularity of scheduledRequests being conducted per configuration
2202 instead of per builder. So if there were multiple test configurations (e.g. Speedometer and Octane) that
2203 both used the same builder, then we may end up scheduling both at once.
2205 Fixed the bug by sharing a single set to keep track of the scheduled requests for all configurations per
2208 * tools/sync-with-buildbot.py:
2209 (load_config): Share a set amongst test configurations for each builder.
2210 (find_request_updates): Instead of creating a new set for each configuration, reuse the existing sets to
2211 share a single set agmonst test configurations for each builder.
2213 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2215 Analysis results viewer sometimes doesn't show the correct relative difference
2216 https://bugs.webkit.org/show_bug.cgi?id=152930
2218 Reviewed by Chris Dumez.
2220 The bug was caused by single A/B testing result associated with multiple rows when there are multiple data
2221 points with the same root set which matches that of an A/B testing.
2223 Fixed the bug by detecting such a case, and only associating each A/B testing result with the row created
2224 for the first matching point.
2226 * public/v3/components/analysis-results-viewer.js:
2227 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
2229 2016-01-08 Ryosuke Niwa <rniwa@webkit.org>
2231 Make v3 UI analysis task page is hard to understand
2232 https://bugs.webkit.org/show_bug.cgi?id=152917
2234 Reviewed by Antti Koivisto.
2236 Add a dark gray border around the selected block in the analysis results viewer instead of using darker
2237 shades since that looks as if they were bigger regression/progression.
2239 Explicitly show "Failed" as the label instead of omitting with "-" when all build requests in an A/B
2240 testing group fails.
2242 * public/v3/components/analysis-results-viewer.js:
2243 (AnalysisResultsViewer.cssTemplate): Tweaked the style to underline text in the hovered blocks and the
2244 selected blocks and show a dark gray border around the selected blocks.
2245 (AnalysisResultsViewer.TestGroupStackingBlock):
2246 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Use this._title for title.
2247 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
2248 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForRootSet): Deleted.
2250 * public/v3/components/results-table.js:
2251 (ResultsTable.prototype.render):
2252 (ResultsTable.prototype._createRevisionListCells): Extracted from ResultsTable.prototype.render.
2253 (ResultsTable.cssTemplate): Tweaked the style.
2255 (ResultsTableRow.prototype.constructor): Added _labelForWholeRow to store the label for the entire row.
2256 This is used to show the comparison result of two root sets (e.g. A vs B).
2257 (ResultsTableRow.prototype.setLabelForWholeRow): Added.
2258 (ResultsTableRow.prototype.labelForWholeRow): Added.
2259 (ResultsTableRow.prototype.resultContent): Extracted from buildHeading. Creates a hyperlinked bar graph
2260 used for each A/B testing result.
2261 (ResultsTableRow.prototype.buildHeading): Deleted since we need to set colspan on the second table cell
2262 when we're creating a row with _labelForWholeRow.
2264 * public/v3/components/test-group-results-table.js:
2265 (TestGroupResultsTable.prototype.buildRowGroups): Added rows to show relative differences and statistical
2266 significance between root sets (e.g. A vs B).
2268 * public/v3/models/build-request.js:
2269 (BuildRequest.prototype.hasCompleted): Added.
2271 * public/v3/models/test-group.js:
2272 (TestGroup.prototype.compareTestResults): Extracted from AnalysisResultsViewer.TestGroupStackingBlock's
2273 _computeTestGroupStatus and generalized to be reused in TestGroupResultsTable.
2274 (TestGroup.prototype._valuesForRootSet): Moved from AnalysisResultsViewer.TestGroupStackingBlock.
2276 * public/v3/pages/analysis-task-page.js:
2277 (AnalysisTaskPage.cssTemplate): Tweaked the style.
2279 2016-01-07 Ryosuke Niwa <rniwa@webkit.org>
2281 Perf dashboard should automatically add aggregators
2282 https://bugs.webkit.org/show_bug.cgi?id=152818
2284 Reviewed by Chris Dumez.
2286 When an aggregator entry is missing in aggregators table, automatically insert it in /api/report.
2288 In a very early version of the perf dashboard, we had the ability to define a custom aggregator
2289 in an admin page. In practice, nobody used or needed this feature so we got rid of it even before
2290 the dashboard was landed into WebKit repository. This patch cleans up that mess.
2293 (main): Added the filtering capability.
2294 (TestEnvironment): Expose the config JSON in the test environment.
2296 * public/include/report-processor.php:
2297 (ReportProcessor): Renamed name_to_aggregator now that it only contains ID.
2298 (ReportProcessor::__construct): No longer fetches the aggregator table. An equivalent work is done
2299 in newly added ensure_aggregators.
2300 (ReportProcessor::process): Calls ensure_aggregators which populates name_to_aggregator_id.
2301 (ReportProcessor::ensure_aggregators): Added. Add the builtin aggregators: Arithmetic, Geometric,
2302 Harmonic, and Total.
2303 (TestRunsGenerator): Renamed name_to_aggregator now that it only contains ID.
2304 (TestRunsGenerator::__construct):
2305 (TestRunsGenerator::add_aggregated_metric): Don't include aggregator_definition here since it's
2306 never used now that all the aggregations are done natively in PHP.
2307 (TestRunsGenerator::$aggregators): Added. We don't include SquareSum since it's only used for
2308 computing run_square_sum_cache in test_runs table and it's useless elsewhere.
2309 (TestRunsGenerator::aggregate_values): Add a comment about that.
2311 * tests/api-report.js: Updated a test case to reflect the change.
2313 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2315 Perf dashboard JSON API should fail gracefully when postgres is down
2316 https://bugs.webkit.org/show_bug.cgi?id=152812
2318 Reviewed by Chris Dumez.
2320 Even though all JSON APIs returned DatabaseConnectionFailure as the status when Database::connect
2321 returned a falsy value, PHP was spitting out warnings and producing HTTP responses that cannot be
2322 parsed as a JSON when pg_connect failed.
2324 Fixed the bug by suppressing warning messages in pg_connect.
2326 * public/include/db.php:
2327 (Database::connect): Use '@' prefix to suppress warning messages.
2329 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2331 Perf dashboard should auto-generate manifest file when one is missing
2332 https://bugs.webkit.org/show_bug.cgi?id=152813
2334 Reviewed by Chris Dumez.
2336 When /data/manifest.json is missing, fall back to newly added /api/manifest instead of
2337 silently failing to show the UI. This will make the initial setup easier.
2339 * public/api/manifest.php: Added.
2341 * public/include/manifest.php:
2342 (Manifest::manifest): Added.
2343 * public/v3/main.js:
2345 (didFetchManifest): Extracted from fetchManifest.
2347 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2349 Commit another forgotten change, this time, for r194653.
2351 * public/v3/models/measurement-set.js:
2353 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2355 The sampling of time series on v3 UI is too aggressive
2356 https://bugs.webkit.org/show_bug.cgi?id=152804
2358 Reviewed by Chris Dumez.
2360 Fixed a bug that we were always halving the number of data points in _sampleTimeSeries
2361 and increased the number of data points allowed to make the sampling less aggressive.
2363 * public/v3/components/time-series-chart.js:
2364 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Increase the number of maximum points
2365 to 2x the number of pixels divided by the radius of each point.
2366 (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Changed the semantics of endIndex
2367 to mean the index after the last point and renamed it to indexAfterEnd.
2368 (TimeSeriesChart.prototype._sampleTimeSeries): Fixed a bug that this code always coerced two
2369 data points into one sampled data point despite of the fact i and j are sufficiently apart
2370 since data[j].time - data[i].time > timePerSample by definition.
2372 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2374 Commit the forgotten change for r194651.
2376 * public/v3/pages/domain-control-toolbar.js:
2377 (DomainControlToolbar.prototype.setStartTime):
2379 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2381 The right hand side of main chart appears to be cut off as you zoom out on v3 UI
2382 https://bugs.webkit.org/show_bug.cgi?id=152778
2384 Reviewed by Antti Koivisto.
2386 Add a padding on x-axis after the end time to make the main chart more easily interactive.
2388 * public/v3/components/time-series-chart.js:
2389 (TimeSeriesChart.prototype._computeHorizontalRenderingMetrics):
2391 * public/v3/pages/page-with-charts.js:
2392 (PageWithCharts.mainChartOptions): Add a padding of 5px at the end of x-axis.
2394 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2396 v3 UI should use four sig-figs to label y-axis of the main charts
2397 https://bugs.webkit.org/show_bug.cgi?id=152779
2399 Reviewed by Antti Koivisto.
2401 Increase the number of significant figures used in the main charts to four as done in v2 UI.
2403 * public/v3/pages/chart-pane.js:
2404 (ChartPane.constructor): Create a formatter with four significant figures.
2405 * public/v3/pages/page-with-charts.js:
2406 (PageWithCharts.mainChartOptions): Increase the width of y-axis labels.
2408 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2410 v3 UI's time range slider is harder to use than that of v2 UI
2411 https://bugs.webkit.org/show_bug.cgi?id=152780
2413 Reviewed by Antti Koivisto.
2415 Improved the time range slider by using a cubic mapping to time range and providing a text field
2416 to directly edit the number of days to show.
2418 Now an user can enter the text mode to directly edit the number of days to show by clicking on
2419 the number of days (text field is always there with opacity=0).
2421 * public/v3/pages/charts-toolbar.js:
2422 (ChartsToolbar): Store the minimum and maximum number of days allowed. Also rename _inputElement
2423 to _slider and added a new type=number text field as _editor.
2424 (ChartsToolbar.prototype.render):
2425 (ChartsToolbar.prototype.setStartTime): Exit the text mode when the number of days is changed by
2426 an URL state transition (i.e. back/forward navigation).
2427 (ChartsToolbar.prototype._setInputElementValue): Added. Updates the values of _slider and _editor.
2428 (ChartsToolbar.prototype._enterTextMode): Added. Hide the elements used by the slider mode and
2429 show the text field.
2430 (ChartsToolbar.prototype._exitTextMode): Added. Does the opposite.
2431 (ChartsToolbar.prototype._sliderValueMayHaveChanged): Renamed from _inputValueMayHaveChanged.
2432 (ChartsToolbar.prototype._editorValueMayHaveChanged): Added. Similar to _sliderValueMayHaveChanged
2433 but also corrects the value of _editor if needed.
2434 (ChartsToolbar.prototype._callNumberOfDaysCallback): Extracted from _inputValueMayHaveChanged.
2435 Also fixed a bug that we didn't update the URL state when the change event was fired without
2436 modifying the effective number of days.
2437 (ChartsToolbar.cssTemplate): Tweaked the style to support the new mode. Also set a fixed width on
2438 the span showing the number of days in the slider mode.
2440 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2442 Zooming button is broken on v3 UI
2443 https://bugs.webkit.org/show_bug.cgi?id=152777
2445 Reviewed by Chris Dumez.
2447 Bring up the zoom button in z-index so that users can click it.
2449 * public/v3/components/interactive-time-series-chart.js:
2450 (InteractiveTimeSeriesChart.cssTemplate):
2452 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2454 v3 UI doesn't preserve the time range when charts page is opened from a dashboard
2455 https://bugs.webkit.org/show_bug.cgi?id=152776
2457 Reviewed by Chris Dumez.
2459 Fixed the bug by moving the construction of charts URL from DashboardPage.prototype.open to
2460 DashboardPage.prototype.render and re-rendering the entire page upon an URL state transition.
2462 * public/v3/pages/charts-page.js:
2463 (ChartsPage.createStateForDashboardItem): Takes the start time for the charts page.
2465 * public/v3/pages/dashboard-page.js:
2466 (DashboardPage.prototype.updateFromSerializedState): Merged _numberOfDaysDidChange and
2467 _updateChartsDomainFromToolbar into this function since they're not used elsewhere. Also re-render
2468 the entire page when transition between different number of days to show.
2469 (DashboardPage.prototype._numberOfDaysDidChange): Deleted.
2470 (DashboardPage.prototype._updateChartsDomainFromToolbar): Deleted.
2471 (DashboardPage.prototype.render): Construct URL for each charts here.
2472 (DashboardPage.prototype._createChartForCell): Don't construct URL here since this function is
2473 called once when the dashboard page is opened, and not when the time range is changed.
2475 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2477 Build fix for an old version of PHP after r194618.
2479 * public/api/measurement-set.php:
2481 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2483 A/B testing results should be visualized intuitively on v3 UI
2484 https://bugs.webkit.org/show_bug.cgi?id=152496
2486 Rubber-stamped by Chris Dumez.
2488 Add the "stacking block" view of A/B testing results to the analysis task page on v3 UI.
2490 The patch enhances JSON APIs at /api/analysis-task /api/measurement-set/ to reduce the number of
2491 HTTP requests, and adds two UI components: TestGroupResultsTable and AnalysisResultsViewer both
2492 of which inherits from an abstract superclass: ResultsTable.
2494 ResultsTable provides a tabular presentation of measured values in regular measurement sets and
2495 A/B testing results using groups of bar graphs created by BarGraphGroup. TestGroupResultsTable
2496 inherits from this class to display A/B testing configurations and the averaged results for each
2497 configuration, and AnalysisResultsViewer inherits from it to provide an intuitive visualization
2498 of the outcomes of all A/B testing results associated with a given analysis task.
2500 * public/api/analysis-tasks.php:
2501 (main): Add the capability to find the analysis task based on its build request.
2502 This allows /v3/#/analysis/task/?buildRequest=<id> to be hyperlinked on buildbot page.
2504 * public/api/measurement-set.php:
2505 (main): Removed the unused startTime and endTime, and added "analysisTask" to query parameters.
2506 (AnalysisResultsFetcher): Added. Used to fetch measured data associated with every build request
2507 on an analysis task.
2508 (AnalysisResultsFetcher::__construct):
2509 (AnalysisResultsFetcher::fetch): Unlike MeasurementSetFetcher, we fetch the list of commits and
2510 list of measurements separately since there will be a lot less builds and commits than measured
2511 data (since we're fetching measured values for all tests and their metrics).
2512 (AnalysisResultsFetcher::fetch_commits): Fetches commits.
2513 (AnalysisResultsFetcher::format_measurement): Like MeasurementSetFetcher::format_measurement but
2514 with config_type and config_metric since we're returning measured data for all metrics and test
2516 (AnalysisResultsFetcher::format_map): Similar to MeasurementSetFetcher::format_map.
2518 * public/v3/components/analysis-results-viewer.js: Added.
2519 (AnalysisResultsViewer): Added.
2520 (AnalysisResultsViewer.prototype.didUpdateResults): This callback is called by AnalysisTaskPage
2521 when A/B testing results become available.
2522 (AnalysisResultsViewer.prototype.render): Overrides ResultsTable's render to highlight the block
2523 representing the currently selected test group.
2525 (AnalysisResultsViewer.prototype.buildRowGroups): Creates a list of rows with "stacking blocks"
2526 that visualizes A/B testing results. The algorithm works as follows: 1. Create all table rows.
2527 2. Find which row is associated with each set in each test group. 3. Layout "blocks".
2529 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Collects root sets from all data
2530 in the measurement set as well as A/B testing **requests** (results may contain more repositories
2531 than requested but they aren't interesting for the purpose of visualizing results for the entire
2534 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Create table rows. First,
2535 create table rows for measurement set points that have a matching test group (i.e. either set A
2536 or set B of an A/B testing uses the same root set as a point). Second, insert a new row for each
2537 root set in each test group which didn't find a matching measurement set point. There is a little
2538 subtlety that some A/B testing may specify revisions for a subset of repositories and/or some A/B
2539 testing results may appear as if it goes back in time with respect to other A/B testing results.
2540 For example, consider creating two A/B test groups for WebKit changes and OS changes separately.
2541 There could be no coherent linearization of those two A/B testing in which both WebKit and OS
2542 versions move forward.
2544 (AnalysisResultsViewer.RootSetInTestGroup): Added. Represents a pair (test group, root set) since
2545 a root set could be shared by multiple test groups.
2546 (AnalysisResultsViewer.TestGroupStackingBlock): Added. A stacked block representing a test group.
2547 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex): Associates a row number with
2548 either set A or set B.
2549 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Creates a table cell
2551 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Returns true if this test group
2552 has failed and this block should look "thin" without any label.
2553 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus): Computes the
2554 status for this test group.
2556 (AnalysisResultsViewer.TestGroupStackingGrid): Added. AnalysisResultsViewer uses this class to
2557 layout blocks representing test groups.
2558 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.insertBlockToColumn): Inserts a new block
2559 to layout. We keep all test groups doing the same A/B test next to each other.
2560 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.layout): Layouts each block / test group
2561 in the order they are created.
2562 (AnalysisResultsViewer.TestGroupStackingGrid.prototype._layoutBlock): Places the block in the
2563 left-most column that can accommodate it while avoiding columns of a different thin-ness. A column
2564 is thin if its A/B testing has failed, and not thin otherwise.
2565 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.createCellsForRow): Creates table cells for
2566 a given row. For each column, generate a table cell if we're in the first row and the first block
2567 starts in a later row, a block starts in the current row, or the last block ended in the previous
2568 row and the next block or the last row appears later.
2570 * public/v3/components/bar-graph-group.js: Added. A component for showing a group of bar graphs.
2571 (BarGraphGroup): Added. Creates a group of bar graphs with the same value range. It's used by
2572 AnalysisResultsViewer and ResultsTable to show bar graphs to compare values.
2573 (SingleBarGraph): A component created and collectively controlled by BarGraphGroup.
2575 * public/v3/components/results-table.js: Added.
2576 (ResultsTable): An abstract superclass for TestGroupResultsTable and AnalysisResultsViewer.
2578 (ResultsTable.prototype.render): Renders the table. 1. Call "buildRowGroups()" implemented by
2579 a subclass to obtain the list of rows. 2. Compute the list of repositories to show. 3. For each
2580 cell in the table, compute the number of rows to show the same value (for rowspan). 4. Render the
2581 table with an extra list of repositories if exists.
2583 (ResultsTable.prototype._computeRepositoryList): Compute the list of repositories to list
2584 revisions in the table. Omit repositories not present in any row or for which all rows have the
2585 same revision. In the latter case, include it in the extra repositories listed below the table.
2586 This minimizes the amount of redundant information presented to the user.
2588 (ResultsTableRow): Added. Represents a single row in the table. ResultsTable constructs necessary
2589 table cells to tabulate the associated root sets, and shows the associated result using a grouped
2590 bar graph. Additional columns are used by AnalysisResultsViewer to show stacked blocks for A/B
2593 * public/v3/components/test-group-results-table.js: Added.
2594 (TestGroupResultsTable):
2595 (TestGroupResultsTable.prototype.didUpdateResults):
2596 (TestGroupResultsTable.prototype.setTestGroup):
2597 (TestGroupResultsTable.prototype.heading):
2598 (TestGroupResultsTable.prototype.render):
2599 (TestGroupResultsTable.prototype.buildRowGroups):
2601 * public/v3/index.html:
2602 * public/v3/models/analysis-results.js: Added.
2603 (AnalysisResults): Added. Like MeasurementSet, this class represents a set of measured values
2604 associated with a given analysis task.
2605 (AnalysisResults.prototype.find): Returns a measured valued for a given build and metric.
2606 (AnalysisResults.prototype.add): Adds a new measured value. Used by AnalysisResults.fetch.
2607 (AnalysisResults.fetch): Fetches data and creates AnalysisResults for a given analysis task.
2609 * public/v3/models/analysis-task.js:
2610 (AnalysisTask.prototype.startMeasurementId): Added.
2611 (AnalysisTask.prototype.endMeasurementId): Added.
2612 (AnalysisTask.fetchByBuildRequestId): Added.
2613 (AnalysisTask._fetchSubset): Uses DataModelObject.cachedFetch.
2615 * public/v3/models/build-request.js: Added.
2616 (BuildRequest): Added. Represents a single A/B testing request associated with a test group.
2618 * public/v3/models/builder.js:
2619 (Build): Added. Represents a build associated with a given A/B testing result.
2621 * public/v3/models/commit-log.js:
2622 (CommitLog): Made this class inherit from DataModelObject.
2623 (CommitLog.ensureSingleton): Added. Finds the singleton object created for a given revision
2624 in the specified repository. This helps RootSet and other classes compare commits fast.
2625 (CommitLog.prototype.repository): Added.
2626 (CommitLog.fetchBetweenRevisions): Uses CommitLog.ensureSingleton.
2628 * public/v3/models/data-model.js:
2630 (DataModelObject.namedStaticMap): Added.
2631 (DataModelObject.ensureNamedStaticMap): Renamed from namedStaticMap instead of implicitly
2632 assuming that the non-static version always creates the map.
2633 (DataModelObject.prototype.namedStaticMap): Added.
2634 (DataModelObject.cachedFetch): Extracted from AnalysisTask._fetchSubset so that TestGroup's
2635 fetchByTask could also use it.
2638 * public/v3/models/measurement-adaptor.js: Added.
2639 (MeasurementAdaptor): Extracted from MeasurementCluster. This class is responsible for
2640 re-formatting the data received via /api/measurement-set JSON API inside the v3 UI.
2641 (MeasurementAdaptor.prototype.extractId): Added.
2642 (MeasurementAdaptor.prototype.adoptToAnalysisResults): Added. Used by AnalysisResults.
2643 (MeasurementAdaptor.aggregateAnalysisResults): Added. Used by TestGroupResultsTable to
2644 aggregate results for each test configuration; e.g. computing the average for set A.
2645 (MeasurementAdaptor.prototype.adoptToSeries): Extracted from MeasurementCluster.addToSeries.
2646 Added rootSet() to each point. This allows AnalysisResultsViewer to compare them against root
2647 sets associated with A/B testing results.
2648 (MeasurementAdaptor.computeConfidenceInterval): Moved from MeasurementCluster.
2650 * public/v3/models/measurement-cluster.js:
2651 (MeasurementCluster):
2652 (MeasurementCluster.prototype.addToSeries):
2654 * public/v3/models/repository.js:
2655 (Repository.prototype.hasUrlForRevision): Added.
2657 * public/v3/models/root-set.js: Added.
2658 (RootSet): Added. Represents a set of commits in measured results.
2659 (MeasurementRootSet): Added. Ditto for results associated with A/B testing.
2661 * public/v3/models/test-group.js: Added.
2662 (TestGroup): Added. Represents a A/B testing on analysis task.
2663 (TestGroup.prototype.createdAt): Added.
2664 (TestGroup.prototype.buildRequests): Returns the list of build requests associated with this
2666 (TestGroup.prototype.addBuildRequest): Added. Used by BuildRequest's constructor to associate
2667 itself with this group.
2668 (TestGroup.prototype.didSetResult): Added. Called by BuildRequest.setResult when measured
2669 values are fetched and associated with a build request in this group.
2671 * public/v3/models/test.js:
2674 * public/v3/pages/analysis-task-page.js:
2676 (AnalysisTaskPage.prototype.updateFromSerializedState): Fetch the analysis task, test groups
2677 associated with it, and all A/B testing results based on the task id or the build request id
2678 specified in the URL.
2679 (AnalysisTaskPage.prototype._didFetchTask): Added. Start fetching the measured data. This is
2680 the data on charts page for which this analysis task was created, not results of A/B testing.
2681 (AnalysisTaskPage.prototype._didFetchMeasurement): Added. Display the fetched data in a table
2682 inside AnalysisResultsViewer.
2683 (AnalysisTaskPage.prototype._didFetchTestGroups): Added. Display the list of A/B test groups
2684 as well as the results of the first A/B testing.
2685 (AnalysisTaskPage.prototype._didFetchAnalysisResults): Added.
2686 (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Added. Once both the analysis task,
2687 A/B test groups as well as their results are fetched, update build requests in each test group
2689 (AnalysisTaskPage.prototype.render): Show the list of test groups and highlight the currently
2691 (AnalysisTaskPage.prototype._showTestGroup): Added. A callback used by AnalysisResultsViewer
2692 and TestGroupResultsTable to notify this class when the user selects a new test group.
2693 (AnalysisTaskPage.htmlTemplate): Updated the template.
2694 (AnalysisTaskPage.cssTemplate): Ditto.
2696 * public/v3/pages/charts-page.js:
2697 (ChartsPage.createStateForAnalysisTask): Added. Creates a URL state object for opening a chart
2698 associated with an analysis task.
2700 2015-12-22 Ryosuke Niwa <rniwa@webkit.org>
2702 Analysis task page is slow to load
2703 https://bugs.webkit.org/show_bug.cgi?id=152517
2705 Reviewed by Andreas Kling.
2707 The slowness comes from r194130 which made the JSON API at /api/analysis-tasks to report the start
2708 and the end of each analysis task. This query was adding ~2s to the total JSON generation time.
2710 Cache these values on analysis_task table since they never change once an analysis task is created.
2712 * init-database.sql: Added columns task_start_run_time and task_end_run_time to analysis_task table.
2713 Also added the missing drop statements at the top.
2715 * public/api/analysis-tasks.php:
2716 (fetch_and_push_bugs_to_tasks): Don't fetch the latest commit time of the start and the end.
2717 (format_task): Report task_start_run_time and task_end_run_time as startRunTime and endRunTime.
2719 * public/privileged-api/create-analysis-task.php:
2720 (main): Set start_run_time and end_run_time when creating an analysis task.
2721 (time_for_run): Added.
2723 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2725 v3 UI shouldn't open/close pane selector by mouseenter/leave
2726 https://bugs.webkit.org/show_bug.cgi?id=152399
2728 Reviewed by Andreas Kling.
2730 Removed the code to open and close the pane selector by mouseenter and mouseleave
2731 since multiple people have complained about the behavior.
2733 * public/v3/pages/charts-toolbar.js:
2734 (ChartsToolbar): Removed the event listeners.
2735 (ChartsToolbar.prototype._addPane): Don't close the pane selector when adding a new pane
2736 to better support the use case of adding multiple panes.
2737 (ChartsToolbar.cssTemplate): Tweaked CSS.
2739 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2741 Popover for analysis tasks shows up at the left edge of annotation bars in the v3 UI
2742 https://bugs.webkit.org/show_bug.cgi?id=152389
2744 Reviewed by Darin Adler.
2746 Compute the x coordinate of the popover from the center of each annotation bar.
2748 Also adjust the x coordinate to keep the popover within the charts.
2750 * public/v3/components/interactive-time-series-chart.js:
2751 (InteractiveTimeSeriesChart.prototype._renderChartContent):
2753 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2755 Dashboard charts should have uniform widths on v3 UI
2756 https://bugs.webkit.org/show_bug.cgi?id=152395
2758 Reviewed by Chris Dumez.
2760 Fix the bug by applying table-layout: fixed on the dashboard table.
2762 * public/v3/pages/dashboard-page.js:
2763 (DashboardPage.prototype.render): Added header-column as a class name to explicitly set the header column with.
2764 (DashboardPage.cssTemplate): Adjusted CSS accordingly.
2766 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2768 Closing a pane on v3 UI always closes the last pane
2769 https://bugs.webkit.org/show_bug.cgi?id=152388
2771 Reviewed by Chris Dumez.
2773 The bug was caused by closePane being called without arguments. (The first argument to bind is "this" value.)
2774 Fixed it by passing in "this" pane object to the first argument.
2776 * public/v3/pages/chart-pane.js:
2779 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2781 Perf Dashboard v3 UI doesn't show recent data points on v2 UI
2782 https://bugs.webkit.org/show_bug.cgi?id=152368
2784 Reviewed by Chris Dumez.
2786 The bug was caused by the last modified date in measurement set JSON being a string instead of a POSIX timestamp,
2787 which prevented the v3 UI from invalidating the cache. Specifically, the following boolean logic always evaluated
2788 to false because +data['lastModified'] was NaN in MeasurementSet.prototype._fetch (/v3/models/measurement-set.js):
2790 !clusterEndTime && useCache && +data['lastModified'] < self._lastModified
2792 Fixed the bug by calling Database::to_js_time on the last modified date fetched from the database.
2794 * public/api/measurement-set.php:
2795 (MeasurementSetFetcher::fetch_config_list): Convert the string returned by the database to a POSIX timestamp.
2796 * tests/api-measurement-set.js: Added a test to ensure the last modified date in JSON is numeric. Since the value
2797 of the last modified date depends on when tests run, we can't assert it to be a certain value.
2799 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2801 v3 UI should show and link the build number on charts page
2802 https://bugs.webkit.org/show_bug.cgi?id=152359
2804 Reviewed by Chris Dumez.
2806 Show the hyperlinked build number in the v3 UI.
2808 * public/v3/models/builder.js:
2809 (Builder): Renamed _buildURL to _buildUrlTemplate.
2810 (Builder.prototype.urlForBuild): Added.
2811 * public/v3/pages/chart-pane-status-view.js:
2812 (ChartPaneStatusView):
2813 (ChartPaneStatusView.prototype.render): Added the code to render hyperlinked build number when one is available.
2814 (ChartPaneStatusView.prototype.computeChartStatusLabels): Store currentPoint's measurement object as _buildInfo
2815 if the current point is set by an indicator (not by a selection).
2817 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2819 v3 dashboard doesn't stretch charts to fill the screen
2820 https://bugs.webkit.org/show_bug.cgi?id=152354
2822 Reviewed by Chris Dumez.
2824 The bug was caused by a workaround to avoid canvas stretching table cell too much.
2826 Fix the problem instead by making the canvas absolutely positioned inside the "time-series-chart" element
2827 so that it does not contribute to the intrinsic/natural width of the cell.
2829 * public/v3/components/time-series-chart.js:
2830 (TimeSeriesChart.prototype._ensureCanvas): Make the canvas absolutely positioned inside the shadow root.
2831 (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Use the container element's size now that
2832 the canvas does not resize with it.
2833 * public/v3/pages/dashboard-page.js:
2834 (DashboardPage.cssTemplate): Updated the CSS so that the chart stretches all the way.
2836 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2838 The chart status on v3 UI sometimes show wrong revision ranges
2839 https://bugs.webkit.org/show_bug.cgi?id=152331
2841 Reviewed by Chris Dumez.
2843 The bug was caused by the status view not taking the data sampling that happens in TimeSeriesChart into account
2844 when finding the previous point. Take this into account by using InteractiveTimeSeries.currentPoint(-1) which
2845 finds the sampled data point immediately preceding the current point (at which the indicator is shown).
2847 * public/v3/components/chart-status-view.js:
2848 (ChartStatusView.prototype.updateStatusIfNeeded):
2850 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2852 Perf dashboard's cycler page should use v3 UI
2853 https://bugs.webkit.org/show_bug.cgi?id=152324
2855 Reviewed by Chris Dumez.
2857 Use the v3 UI in cycler.html after r194130.
2859 * public/cycler.html:
2860 * public/v3/index.html: Removed the reference to a non-existent platform-selector.js.
2862 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2864 Add v3 UI to perf dashboard
2865 https://bugs.webkit.org/show_bug.cgi?id=152311
2867 Reviewed by Chris Dumez.
2869 Add the third iteration of the perf dashboard UI. UI for viewing and modifying analysis tasks is coming soon.
2870 The v3 UI is focused on speed, and removes all third-party script dependencies including jQuery, d3, and Ember.
2871 Both the DOM-based UI and graphing are implemented manually.
2874 The entire app is structured using new component library implemented in components/base.js. Each component is
2875 an instance of a subclass of ComponentBase which owns a single DOM element. Each subclass may supply static
2876 methods named htmlTemplate and cssTemplate as the template for a component instance. ComponentBase automatically
2877 clones the templates inside the associated element (or its shadow root on the supported browsers). Each subclass
2878 must supply a method called "render()" which constructs and updates the DOM as needed.
2880 There is a special component called Page, which represents an entire page. Each Page is opened by PageRouter's
2881 "route()" function. Each subclass of Page supplies "open()" for initialization and "updateFromSerializedState()"
2882 for a hash URL transition.
2885 The key feature of the v3 UI is the split of time series into chunks called clusters (see r194120). On an internal
2886 instance of the dashboard, the v2 UI downloads 27MB of data whereas the same page loads only 3MB of data in the v3.
2887 The key logic for fetching time series in chunks is implemented by MeasurementSet in /v3/models/measurement-set.js.
2888 We first fetch the cached primary cluster (the cluster that contains the newest data) at:
2889 /data/measurement-set-<platform-id>-<metric-id>.json
2891 If that's outdated according to lastModified in manifest.json, then we immediately re-fetch the primary cluster at:
2892 /api/measurement-set/?platform=<platform-id>&metric=<metric-id>
2894 Once the up-to-date primary cluster is fetched, we fetch all "secondary" clusters. For each cluster being fetched,
2895 including the primary, we invoke registered callbacks.
2898 In addition, the v3 UI reduces the initial page load time by loading a single bundled JS file generated by
2899 tools/bundle-v3-scripts.py. index.html has a fallback to load all 44 JS files individually during development.
2901 * public/api/analysis-tasks.php:
2902 (fetch_and_push_bugs_to_tasks): Added the code to fetch start and end run times. This is necessary in V3 UI
2903 because no longer fetch the entire time series. See r194120 for the new measurement set JSON API.
2904 (format_task): Compute the category of an analysis task based on "result" value. This will be re-vamped once
2905 I add the UI for the analysis task page in v3.
2907 * public/include/json-header.php:
2908 (require_format): CamelCase the name.
2909 (require_match_one_of_values): Ditto.
2910 (validate_arguments): Renamed from require_existence_of and used in measurement-set.php landed in r194120.
2913 * public/v3/components: Added.
2915 * public/v3/components/base.js: Added.
2916 (ComponentBase): The base component class.
2917 (ComponentBase.prototype.element): Returns the DOM element associated with the DOM element.
2918 (ComponentBase.prototype.content): Returns the shadow root if one exists and the associated element otherwise.
2919 (ComponentBase.prototype.render): To be implemented by a subclass.
2920 (ComponentBase.prototype.renderReplace): A helper function to "render" DOM contents.
2921 (ComponentBase.prototype._constructShadowTree): Called inside the constructor to instantiate the templates.
2922 (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Instantiates components referred by
2923 its element name inside the instantiated content.
2924 (ComponentBase.isElementInViewport): A helper function. Returns true if the element is in the viewport and it has
2925 non-zero width and height.
2926 (ComponentBase.defineElement): Defines a custom element that can be automatically instantiated from htmlTemplate.
2927 (ComponentBase.createElement): A helper function to create DOM tree to be used in "render()" method.
2928 (ComponentBase._addContentToElement): A helper for "createElement".
2929 (ComponentBase.createLink): A helper function to create a hyperlink or another clickable element (via callback).
2930 (ComponentBase.createActionHandler): A helper function to create an event listener that prevents the default action
2931 and stops the event propagation.
2933 * public/v3/components/button-base.js: Added.
2935 * public/v3/components/chart-status-view.js: Added.
2936 (ChartStatusView): A component that reports the current status of time-series-chart. It's subclasses by
2937 ChartPaneStatusView to provide additional information in the charts page's panes.
2939 * public/v3/components/close-button.js: Added.
2941 * public/v3/components/commit-log-viewer.js: Added.
2942 (CommitLogViewer): A component that lists commit revisions along with commit messages for a range of data points.
2944 * public/v3/components/interactive-time-series-chart.js: Added.
2945 (InteractiveTimeSeriesChart): A subclass of InteractiveTimeSeriesChart with interactivity (selection & indicator).
2946 Selection and indicator are mutually exclusive.
2948 * public/v3/components/pane-selector.js: Added.
2949 (PaneSelector): A component for selecting (platform, metric) pair to add in the charts page.
2951 * public/v3/components/spinner-icon.js: Added.
2953 * public/v3/components/time-series-chart.js: Added.
2954 (TimeSeriesChart): A canvas-based chart component without interactivity. It takes a source list and options as
2955 the constructor arguments. A source list is a list of measurement sets (measurement-set.js) with drawing options.
2956 This component fetches data via MeasurementSet.fetchBetween inside TimeSeriesChart.prototype.setDomain and
2957 progressively updates the charts as more data arrives. The canvas is updated on animation frame via rAF and all
2958 layout and rendering metrics are lazily computed in _layout. In addition, this component samples data before
2959 rendering the chart when there are more data points per pixel in _ensureSampledTimeSeries.
2961 * public/v3/index.html: Added. Loads bundled-scripts.js if it exists, or individual script files otherwise.
2963 * public/v3/instrumentation.js: Added. This class is used to gather runtime statistics of v3 UI. (It measures
2964 the performance of the perf dashboard UI).
2966 * public/v3/main.js: Added. Bootstraps the app.
2970 * public/v3/models: Added.
2971 * public/v3/models/analysis-task.js: Added.
2972 * public/v3/models/bug-tracker.js: Added.
2973 * public/v3/models/bug.js: Added.
2974 * public/v3/models/builder.js: Added.
2975 * public/v3/models/commit-log.js: Added.
2976 * public/v3/models/data-model.js: Added.
2977 (DataModelObject): The base class for various data objects that correspond to database tables. It supplies static
2978 hash map to find entries by id as well as other keys.
2979 (LabeledObject): A subclass of DataModelObject with the capability to find an object via its name.
2981 * public/v3/models/measurement-cluster.js: Added.
2982 (MeasurementCluster): Represents a single cluster or a chunk of data in a measurement set.
2984 * public/v3/models/measurement-set.js: Added.
2985 (MeasurementSet): Represents a measurement set.
2986 (MeasurementSet.findSet): Returns the singleton set given (metric, platform). We use singleton to avoid issuing
2987 multiple HTTP requests for the same JSON when there are multiple TimeSeriesChart that show the same graph (e.g. on
2988 charts page with overview and main charts).
2989 (MeasurementSet.prototype.findClusters): Finds the list of clusters to fetch in a given time range.
2990 (MeasurementSet.prototype.fetchBetween): Fetch clusters for a given time range and calls callback whenever new data
2991 arrives. The number of callbacks depends on the how many clusters need to be newly fetched.
2992 (MeasurementSet.prototype._fetchSecondaryClusters): Fetches non-primary (non-latest) clusters.
2993 (MeasurementSet.prototype._fetch): Issues a HTTP request to fetch a cluster.
2994 (MeasurementSet.prototype._didFetchJSON): Called when a cluster is fetched.
2995 (MeasurementSet.prototype._failedToFetchJSON): Called when the fetching of a cluster has failed.
2996 (MeasurementSet.prototype._invokeCallbacks): Invokes callbacks upon an approval of a new cluster.
2997 (MeasurementSet.prototype._addFetchedCluster): Adds the newly fetched cluster in the order.
2998 (MeasurementSet.prototype.fetchedTimeSeries): Returns a time series that contains data from all clusters that have
3000 (TimeSeries.prototype.findById): Additions to TimeSeries defined in /v2/data.js.
3001 (TimeSeries.prototype.dataBetweenPoints): Ditto.
3002 (TimeSeries.prototype.firstPoint): Ditto.
3004 * public/v3/models/metric.js: Added.
3005 * public/v3/models/platform.js: Added.
3006 * public/v3/models/repository.js: Added.
3007 * public/v3/models/test.js: Added.
3009 * public/v3/pages: Added.
3010 * public/v3/pages/analysis-category-page.js: Added. The "Analysis" page that lists the analysis tasks.
3011 * public/v3/pages/analysis-category-toolbar.js: Added. The toolbar to filter analysis tasks based on its category
3012 (unconfirmed, bisecting, identified, closed) and a keyword.
3014 * public/v3/pages/analysis-task-page.js: Added. Not implemented yet. It just has the hyperlink to the v2 UI.
3016 * public/v3/pages/chart-pane-status-view.js: Added.
3017 (ChartPaneStatusView): A subclass of ChartStatusView used in the charts page. In addition to the current value,
3018 comparison to baseline/target, it shows the list of repository revisions (e.g. WebKit revision, OS version).
3020 * public/v3/pages/chart-pane.js: Added.
3021 (ChartPane): A component a pane in the charts page. Each pane has the overview chart and the main chart. The zooming
3022 is synced across all panes in the charts page.
3024 * public/v3/pages/charts-page.js: Added. Charts page.
3025 * public/v3/pages/charts-toolbar.js: Added. The toolbar to set the number of days to show. This affects the overview
3026 chart's domain in each pane.
3028 * public/v3/pages/create-analysis-task-page.js: Added.
3029 (CreateAnalysisTaskPage): A page that gets shown momentarily while creating a new analysis task.
3031 * public/v3/pages/dashboard-page.js: Added. A dashboard page.
3032 * public/v3/pages/dashboard-toolbar.js: Added. Its toolbar with buttons to select the number of days to show.
3033 * public/v3/pages/domain-control-toolbar.js: Added. An abstract superclass of charts and dashboard toolbars.
3035 * public/v3/pages/heading.js: Added. A component for displaying the header and toolbar, if exists, on each page.
3036 * public/v3/pages/page-router.js: Added. This class is responsible for updating the URL hashes as well as opening
3037 and updating each page when the hash changes (via back/forward navigation).
3038 * public/v3/pages/page-with-charts.js: Added. An abstract subclass of page used by dashboards and charts page.
3039 Supplies helper functions for creating TimeSeriesChart options.
3040 * public/v3/pages/page-with-heading.js: Added. An abstract subclass of page that uses the heading component.
3041 * public/v3/pages/page.js: Added. The Page component.
3042 * public/v3/pages/toolbar.js: Added. An abstract toolbar component.
3044 * public/v3/remote.js: Added.
3045 (getJSON): Fetches JSON from the remote server.
3046 (getJSONWithStatus): Ditto. Rejects the response if the status is not "OK".
3047 (PrivilegedAPI.sendRequest): Posts a HTTP request to a privileged API in /privileged-api/.
3048 (PrivilegedAPI.requestCSRFToken): Creates a new CSRF token to request a privileged API post.
3050 * tools/bundle-v3-scripts.py: Added.
3051 (main): Bundles js files together and minifies them by jsmin.py for the v3 UI. Without this script, we're forced to
3052 download 44 JS files or making each JS file contain multiple classes.
3054 * tools/jsmin.py: Copied from WebInspector / JavaScriptCore code.
3056 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
3058 Fix v2 UI after r194093.
3060 * public/v2/data.js:
3062 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
3064 Add /api/measurement-set for v3 UI
3065 https://bugs.webkit.org/show_bug.cgi?id=152312
3067 Rubber-stamped by Chris Dumez.
3069 The new API JSON allows the front end to fetch measured data in chunks called a "cluster" as specified
3070 in config.json for each measurement set specified by the pair of a platform and a metric.
3072 When the front end needs measured data in a given time range (t_0, t_1) for a measurement set, it first
3073 fetches the primary cluster by /api/measurement-set/?platform=<platform-id>&metric=<metric-id>.
3074 The primary cluster is the last cluster in the set (returning the first cluster here is not useful
3075 since we don't typically show very old data), and provides the information needed to fetch other clusters.
3077 Fetching the primary cluster also creates JSON files at:
3078 /data/measurement-set-<platform-id>-<metric-id>-<cluster-end-time>.json
3079 to allow latency free access for secondary clusters. The front end code can also fetch the cache of
3080 the primary cluster at: /data/measurement-set-<platform-id>-<metric-id>.json.
3082 Because the front end code has to behave as if all data is fetched, each cluster contains one data point
3083 immediately before the first data point and one immediately after the last data point. This avoids having
3084 to fetch multiple empty clusters for manually specified baseline data. To support this behavior, we generate
3085 all clusters for a given measurement set at once when the primary cluster is requested.
3087 Furthermore, all measurement sets are divided at the same time into clusters so that the boundary of clusters
3088 won't shift as more data are reported to the server.
3090 * config.json: Added clusterStart and clusterSize as options.
3091 * public/api/measurement-set.php: Added.
3093 (MeasurementSetFetcher::__construct):
3094 (MeasurementSetFetcher::fetch_config_list): Finds configurations that belongs to this (platform, metric) pair.
3095 (MeasurementSetFetcher::at_end): Returns true if we've reached the end of all clusters for this set.
3096 (MeasurementSetFetcher::fetch_next_cluster): Generates the JSON data for the next cluster. We generate clusters
3097 in increasing chronological order (the oldest first and the newest last).
3098 (MeasurementSetFetcher::execute_query): Executes the main query.
3099 (MeasurementSetFetcher::format_map): Returns the mapping of a measurement field to an array index. This removes
3100 the need to have key names for each measurement and reduces the JSON size by ~10%.
3101 (MeasurementSetFetcher::format_run): Creates an array that contains data for a single measurement. The order
3102 matches that of keys in format_map.
3103 (MeasurementSetFetcher::parse_revisions_array): Added. Copied from runs.php.
3104 * tests/api-measurement-set.js: Added. Added tests for /api/measurement-set.
3106 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3108 Using fake timestamp in OS version make some results invisible
3109 https://bugs.webkit.org/show_bug.cgi?id=152289
3111 Reviewed by Stephanie Lewis.
3113 Fix various bugs after r194088.
3115 * public/api/commits.php:
3116 (format_commit): Include the commit order.
3117 * public/v2/data.js:
3118 (CommitLogs._cacheConsecutiveCommits): Sort by commit order when commit time is missing.
3119 * tools/pull-os-versions.py:
3120 (OSBuildFetcher._assign_order): Use integer instead of fake time for commit order.
3121 (available_builds_from_command): Exit early when an exception is thrown.
3123 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3125 Fix a typo in the previous commit.
3127 * public/include/report-processor.php:
3129 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3131 Build fix after r192965. Suppress a warning about log being referred to as a closure variable.
3133 * public/include/report-processor.php:
3135 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3137 Using fake timestamp in OS version make some results invisible
3138 https://bugs.webkit.org/show_bug.cgi?id=152289
3140 Reviewed by Stephanie Lewis.
3142 Added commit_order column to explicitly order OS versions. This fixes the bug whereby which
3143 baseline results reported with only OS versions are shown with x coordinate set to 10 years ago.
3145 To migrate the existing database, run:
3146 ALTER TABLE commits ADD COLUMN commit_order integer;
3147 CREATE INDEX commit_order_index ON commits(commit_order);
3149 Then for each repository $1,
3150 UPDATE commits SET (commit_time, commit_order) = (NULL, CAST(EXTRACT(epoch from commit_time) as integer))
3151 WHERE commit_repository = $1;
3154 * init-database.sql: Added the column.
3155 * public/api/commits.php:
3156 (fetch_commits_between): Use commit_order to order commits when commit_time is missing.
3157 * public/api/report-commits.php:
3158 (main): Set commit_order.
3159 * tools/pull-os-versions.py:
3160 (OSBuildFetcher.fetch_and_report_new_builds):
3161 (OSBuildFetcher._assign_order): Renamed from _assign_fake_timestamps. Set the order instead of a fake timestmap.
3163 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3165 Perf dashboard can't merge when the destination platform is missing baseline/target
3166 https://bugs.webkit.org/show_bug.cgi?id=152286
3168 Reviewed by Stephanie Lewis.
3170 The bug was caused by the query to migrate test configurations to new platform checking
3171 configuration type and metric separately; that is, it assumes the configuration exists
3172 only if either the same type or the same metric exists in the destination.
3174 Fixed the bug by checking both conditions simultaneously for each configuration.
3176 * public/admin/platforms.php:
3177 * tests/admin-platforms.js: Added a test.
3179 2015-12-11 Ryosuke Niwa <rniwa@webkit.org>
3181 Perf dashboard's buildbot sync config JSON duplicates too much information
3182 https://bugs.webkit.org/show_bug.cgi?id=152196
3184 Reviewed by Stephanie Lewis.
3186 Added shared, per-builder, and per-test (called type) configurations.
3188 * tools/sync-with-buildbot.py:
3190 (load_config.merge):
3192 2015-12-02 Ryosuke Niwa <rniwa@webkit.org>
3194 Perf dashboard should avoid overflow during geometric mean computation
3195 https://bugs.webkit.org/show_bug.cgi?id=151773
3197 Reviewed by Chris Dumez.
3199 * public/include/report-processor.php:
3201 2015-11-30 Ryosuke Niwa <rniwa@webkit.org>
3203 Perf dashboard should extend baseline and target to the future
3204 https://bugs.webkit.org/show_bug.cgi?id=151511
3206 Reviewed by Darin Adler.
3208 * public/v2/data.js:
3209 (RunsData.prototype.timeSeriesByCommitTime): Added extendToFuture as an argument.
3210 (RunsData.prototype.timeSeriesByBuildTime): Ditto.
3211 (RunsData.prototype._timeSeriesByTimeInternal): Ditto.
3212 (TimeSeries): Add a new point to the end if extendToFuture is set and the series is not empty.
3213 * public/v2/manifest.js:
3214 (App.Manifest._formatFetchedData): Set extendToFuture to true for baselines and targets.
3216 2015-11-30 Ryosuke Niwa <rniwa@webkit.org>
3218 Perf dashboard should always show comparison to baseline and target even if one is missing
3219 https://bugs.webkit.org/show_bug.cgi?id=151510
3221 Reviewed by Darin Adler.
3223 Show the comparison status against the baseline when baseline is present but target is missing.
3225 To make the code more readable, this patch splits the logic into three cases:
3226 1. Both baseline and target are present
3227 2. Only baseline is present
3228 3. Only target is present
3230 Also extracted a helper function to construct the label.
3233 (.labelForDiff): Added.
3234 (App.Pane.computeStatus):
3236 2015-11-23 Commit Queue <commit-queue@webkit.org>
3238 Unreviewed, rolling out r192716 and r192717.
3239 https://bugs.webkit.org/show_bug.cgi?id=151582
3241 The patch was incorrect. We always need at least one data
3242 point in each configuration (Requested by rniwa on #webkit).
3244 Reverted changesets:
3246 "Perf dashboard's should not include results more than 366
3248 https://bugs.webkit.org/show_bug.cgi?id=151529
3249 http://trac.webkit.org/changeset/192716
3251 "Build fix for old version of PHP."
3252 http://trac.webkit.org/changeset/192717
3254 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3256 Build fix for old version of PHP.
3258 * public/api/runs.php:
3260 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3262 Perf dashboard's should not include results more than 366 days old in JSON
3263 https://bugs.webkit.org/show_bug.cgi?id=151529
3265 Reviewed by Timothy Hatcher.
3267 Don't return results more than 366 days old in /api/runs/ JSON API.
3268 This is a ~5% runtime improvement and reduces the JSON file size by 20-50% in the internal perf dashboard.
3270 * public/api/runs.php:
3271 (main): Added the support for "?noResults" to avoid echoing results. This is useful for debugging.
3272 Also instantiate RunsGenerator before issuing the query to find all configurations so that the runtime cost
3273 of doing so will be included in elapsedTime.
3274 (RunsGenerator::fetch_runs): Skip a row when its build and commit times are more than 366 days old.
3275 (RunsGenerator::format_run): Takes build_time and revisions as arguments since fetch_runs uses them now.
3276 (RunsGenerator::parse_revisions_array): Compute the max of commit times.
3278 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3280 Remove chartPointRadius from interactive chart component
3281 https://bugs.webkit.org/show_bug.cgi?id=151480
3283 Reviewed by Darin Adler.
3285 Replaced the parameter by CSS rules.
3287 * public/v2/chart-pane.css:
3289 (.chart .dot.foreground):
3290 (.chart .highlight):
3292 * public/v2/index.html:
3293 * public/v2/interactive-chart.js:
3294 (App.InteractiveChartComponent.Ember.Component.extend._constructGraphIfPossible):
3295 (App.InteractiveChartComponent.Ember.Component.extend._highlightedItemsChanged):
3297 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3299 Perf dashboard's runs API uses more than 128MB of memory
3300 https://bugs.webkit.org/show_bug.cgi?id=151478
3302 Reviewed by Andreas Kling.
3304 Don't fetch all query results at once to avoid using twice as much memory as needed.
3305 Use iterative API to format each result at a time.
3307 This change is also a 5% runtime performance gain.
3309 * public/api/runs.php:
3310 (RunsGenerator::__construct): Takes a Database instance instead of a list of configurations. The latter is
3311 no longer needed as we pass in each configuration type explicitly to fetch_runs.
3312 (RunsGenerator::fetch_runs): Renamed from add_runs since it now executes the database query via execute_query.
3313 Also moved the logic to compute the last modified time here.
3314 (RunsGenerator::execute_query): Moved from fetch_runs_for_config. Use Database::query instead of query_and_fetch_all.
3315 (RunsGeneratorForTestGroup):
3316 (RunsGeneratorForTestGroup::__construct):
3317 (RunsGeneratorForTestGroup::execute_query): Moved from fetch_runs_for_config_and_test_group.
3319 * public/include/db.php:
3320 (generate_data_file): Lock the file to avoid corruption.
3322 2015-11-19 Ryosuke Niwa <rniwa@webkit.org>
3324 Perf dashboard always fetches charts JSON twice
3325 https://bugs.webkit.org/show_bug.cgi?id=151483
3327 Reviewed by Andreas Kling.
3329 Only re-generate "runs" JSON via /api/runs/ when the cache doesn't exist in /data/ or the cached JSON is
3330 obsolete (shouldRefetch is set true) or corrupt (the second closure).
3335 2015-11-18 Ryosuke Niwa <rniwa@webkit.org>
3337 Internal perf dashboard takes forever to load
3338 https://bugs.webkit.org/show_bug.cgi?id=151430
3340 Rubber-stamped by Antti Koivisto.
3342 Fix a few performance problems with the perf dashboard v2 UI.
3345 (App.DashboardRow._createPane): Set "inDashboard" to true.
3346 (App.Pane._fetch): Immediately show the cached chart instead of waiting for the refetched data which invokes
3347 a PHP JSON API. Also don't fetch the analysis tasks when the chart is shown in the dashboard since we don't
3348 show annotate charts in the dashboard.
3350 2015-10-15 Ryosuke Niwa <rniwa@webkit.org>
3352 Unreviewed fix of a test after r190687.
3354 * tests/admin-regenerate-manifest.js:
3356 2015-10-12 Ryosuke Niwa <rniwa@webkit.org>
3358 Perf dashboard tools shouldn't require server credentials in multiple configuration files
3359 https://bugs.webkit.org/show_bug.cgi?id=149994
3361 Reviewed by Chris Dumez.
3363 Made detect-changes.js and pull-svn.py pull username and passwords from the server config JSON to reduce
3364 the number of JSON files that need to include credentials.
3366 Also made each script reload the server config after sleep to allow dynamic credential updates.
3368 In addition, change the server config JSON's format to include scheme, host, and port numbers separately
3369 instead of a url since detect-changes.js needs each value separately.
3371 This reduces the number of JSONs with credentials to two for our internal dashboard.
3373 * tools/detect-changes.js:
3374 (main): Added a property argument parsing. Now takes --server-config-json, --change-detection-config-json,
3375 and --seconds-to-sleep like other scripts.
3376 (parseArgument): Added.
3377 (fetchManifestAndAnalyzeData): Reload the server config JSON.
3378 (loadServerConfig): Added. Set settings.perfserver and settings.slave from the server config JSON. Also
3379 add settings.perfserver.host to match the old format.
3380 (configurationsForTesting): Fixed a bug that we throw an exception when a dashboard contains an empty cell.
3382 * tools/pull-os-versions.py:
3383 (main): Use load_server_config after each sleep.
3385 * tools/pull-svn.py:
3386 (main): Use load_server_config after each sleep.
3387 (fetch_commits_and_submit): Use the perf dashboard's auth as subversion credential when useServerAuth is set.
3389 * tools/sync-with-buildbot.py:
3390 (main): Use load_server_config after each sleep.
3393 (load_server_config): Extracted from python scripts. Computes server's url from scheme, host, and port number
3394 to match the old format python scripts except.
3396 2015-10-11 Ryosuke Niwa <rniwa@webkit.org>
3398 Build fix after r190817. Now that pull-os-versions store fake timestamps, we need to bypass timestamp
3399 checks for OS versions when bots try to report new results. Otherwise, we fail to process the reports
3400 with a MismatchingCommitTime error.
3402 * public/include/report-processor.php:
3403 (ReportProcessor::resolve_build_id):
3405 2015-10-08 Ryosuke Niwa <rniwa@webkit.org>
3407 Perf dashboard erroneously shows an old OS build in A/B testing range
3408 https://bugs.webkit.org/show_bug.cgi?id=149942
3410 Reviewed by Darin Adler.
3412 Ordering OS builds lexicologically turned out be a bad idea since 15A25 falls between 15A242 and 15A251.
3413 Use a fake/synthetic timestamp to force the commonly understood total order instead.
3415 Refactored pull-os-versions.py to share the server config JSON with other scripts. Also made the script
3416 support pulling multiple sources; e.g. both OS X and iOS.
3418 Also removed superfluous feature to submit results in chunks. The perf dashboard can handle thousands of
3419 revisions being submitted at once just fine.
3421 * public/api/commits.php:
3422 (main): A partial revert of r185574 since we no longer need to order builds lexicologically.
3424 * tools/pull-os-versions.py:
3425 (main): Takes --os-config-json, --server-config-json, and --seconds-to-sleep as arguments instead of
3426 a single --config argument to share the server config JSON with other scripts.
3427 (OSBuildFetcher): Extracted out of main. This class is instantiated for each OS kind (e.g. OS X).
3428 (OSBuildFetcher.__init__): Added.
3429 (OSBuildFetcher._fetch_available_builds): Extracted out of main. Fetches available builds from a website
3431 (OSBuildFetcher.fetch_and_report_new_builds): Extracted out of main. Submits the fetched builds after
3432 filtering out the ones we've already reported.
3433 (OSBuildFetcher._assign_fake_timestamps): Creates a fake timestamp to establish a total order amongst each
3434 OS X / iOS style build number such as 12A3456b.
3436 2015-10-08 Ryosuke Niwa <rniwa@webkit.org>
3438 pull-svn.py fails to sync revisions when SVN credentials is not setup
3439 https://bugs.webkit.org/show_bug.cgi?id=149941
3441 Reviewed by Chris Dumez.
3443 Added the support for specifying subversion credentials.
3445 Also added the support for pulling from multiple subversion servers. Subversion servers are specified
3446 in a JSON configuration file specified by --svn-config formatted as follows:
3451 "url": "http://svn.webkit.org/repository/webkit",
3452 "username": "webkitten",
3453 "password": "webkitten's password",
3454 "trustCertificate": true,
3455 "accountNameFinderScript":
3456 ["python", "/Volumes/Data/WebKit/Tools/Scripts/webkit-patch", "find-users"]
3461 In addition, refactored it to use the shared server config JSON for the dashboard access.
3463 * tools/pull-svn.py:
3464 (main): Now takes --svn-config-json, --server-config-json, --seconds-to-sleep and --max-fetch-count
3465 as required options instead of seven unnamed arguments.
3466 (fetch_commits_and_submit): Extracted from main. Fetches at most max_fetch_count new revisions from
3467 the subversion server, and submits them in accordance with server_config.
3468 (fetch_commit_and_resolve_author): Now takes a single repository dictionary instead of two separate
3469 arguments for name and URL to pass down the repository's authentication info to fetch_commit.
3470 (fetch_commit): Ditto. Add appropriate arguments when username and passwords are specified.
3471 (resolve_author_name_from_account): Use a list argument instead of a single string argument now that
3472 the argument comes from a JSON instead of sys.argv.
3474 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3476 Unreviewed race condition fix. Exit early when xScale or yScale is not defined.
3478 * public/v2/interactive-chart.js:
3479 (App.InteractiveChartComponent._updateRangeBarRects):
3481 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3483 Add a page that cycles through v2 dashboards
3484 https://bugs.webkit.org/show_bug.cgi?id=149907
3486 Reviewed by Chris Dumez.
3488 Add cycler.html that goes through each dashboard on v2 UI.
3490 This allows the dashboards to be cycled through on a TV screen.
3492 * public/cycler.html: Added.
3493 (loadURLAt): Appends a new iframe to load the next URL (i is the index of the dashboard to be shown)
3494 at the end of body. We don't immediately show the new iframe since it might take a while to load.
3495 (showNewFrameIfLoaded): Remove the current iframe and show the next iframe if the next dashboard has
3496 finished loading. We can't rely on DOMContentLoaded or load events because we use asynchronous XHR to
3497 load each chart's data. Instead, wait until some chart becomes available or fails to load and none of
3498 charts are still in progress to be shown.
3500 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3502 Allow custom revisions to be specified in A/B testing
3503 https://bugs.webkit.org/show_bug.cgi?id=149905
3505 Reviewed by Chris Dumez.
3507 Allow custom revision number on each "repository" when creating a test group.
3509 * public/v2/app.css:
3510 (form .analysis-group [name=customValue]): Added.
3513 (App.AnalysisTaskController._createConfiguration): Added "Custom" as a revision option.
3514 Also added point labels such as (point 3) on "None" for when some points are missing revision info.
3515 (App.AnalysisTaskController._labelForPoints): Extracted from _createConfiguration.
3516 (App.AnalysisTaskController.actions.createTestGroup): Respect the custom revision number when custom
3517 revision option is selected.
3519 * public/v2/index.html: Added a text field for specifying a custom revision number.
3521 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3523 Make the site name configurable in perf dashboard
3524 https://bugs.webkit.org/show_bug.cgi?id=149894
3526 Reviewed by Chris Dumez.
3528 Added "siteTitle" as a new configuration key to specify the site name.
3530 * public/include/db.php:
3531 (config): Now takes the default value as an argument.
3532 * public/include/manifest.php:
3533 (ManifestGenerator::generate): Include siteTitle in the manifest.
3534 * public/index.html: Update the title and the heading when the manifest is loaded.
3535 * public/v2/index.html: Use App.Manifest.siteTitle as the heading. document.title needs to be updated manually.
3536 * public/v2/manifest.js:
3537 (App.MetricSerializer.normalizePayload): Update document.title and App.Manifest.siteTitle.
3539 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3541 Perf dashboard doesn't show analysis tasks anchored at outliers
3542 https://bugs.webkit.org/show_bug.cgi?id=149870
3544 Reviewed by Chris Dumez.
3546 The bug was caused by the computation of start and end times of analysis tasks being dependent on
3547 time series provided to the interactive chart component even though they are already filtered.
3549 Since the interactive chart component shouldn't be messing with the underlying data models, moved
3550 the code to compute start and end times to App.Pane, to where it belongs, and made the moved code use
3551 the unfiltered time series newly exposed on ChartData.
3553 Also fixed a bug in fetch-from-remote.php which resulted in Ember endlessly fetching same JSON files.
3555 * public/admin/fetch-from-remote.php:
3556 (.): Use the full request URI for HTTP requests and caching. Otherwise, we're going to mix up caches
3557 and Ember can start hanging browsers (took me three hours to debug this).
3560 (App.Pane._showOutlierChanged): Added. Resets chartData when showOutlier flag has been changed.
3561 (App.Pane.fetchAnalyticRanges): The old code wasn't filtering analysis tasks by platforms and metrics
3562 at all since it relied on the server-side REST API to do the filtering, which I haven't implemented yet.
3563 Filter the results manually instead.
3564 (App.Pane.ranges): Moved the logic to compute startTime and endTime here from InteractiveChartComponent.
3565 (App.PaneController.toggleShowOutlier): Now that App.Pane responds to showOutlier changes, we don't
3566 need to call a private method on it.
3567 (App.AnalysisTaskController._chartDataChanged): When end points are not found, try showing outliers.
3568 This will cause chartData to be modified so just exit early and wait for getting called again.
3570 * public/v2/interactive-chart.js:
3571 (App.InteractiveChartComponent._rangesChanged): The code to compute start and end time has been moved
3574 * public/v2/manifest.js:
3575 (App.Manifest._formatFetchedData): Added unfiltered time series as new properties as they are now used
3576 to compute the end points of analysis tasks when their end points are outliers.
3578 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3580 Unreviewed. Fix a typo in r190645.
3582 * public/include/db.php:
3584 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3586 V2 UI shouldn't sort dashboards lexicologically
3587 https://bugs.webkit.org/show_bug.cgi?id=149856
3589 Reviewed by Chris Dumez.
3591 Don't sort the dashboards by name in App.Manifest.
3594 (App.IndexRoute.beforeModel): Don't transition to "undefined" (string) dashboard.
3595 * public/v2/manifest.js:
3596 (App.Manifest.._fetchedManifest):
3598 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3600 V2 UI fails to show the data for the very first point in charts
3601 https://bugs.webkit.org/show_bug.cgi?id=149857
3603 Reviewed by Chris Dumez.
3605 The bug was caused by seriesBetweenPoints returning null for when point.seriesIndex is 0.
3606 Explicitly check the type of this property instead.
3608 * public/v2/data.js:
3609 (TimeSeries.prototype.seriesBetweenPoints):
3611 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3613 Perf dashboard should have the capability to test local UI with production data
3614 https://bugs.webkit.org/show_bug.cgi?id=149834
3616 Reviewed by Chris Dumez.
3618 Added tools/run-with-remote-server.py which runs a local httpd server and pulls data from a remote server.
3620 * Install.md: Added the instruction on how to use the script. Also updated the remaining instructions
3622 * config.json: Added remote server configurations.
3623 * public/admin/fetch-from-remote.php: Added. This script fetches JSON from the remote server specified in
3624 config.json and caches the results in the location specified as "cacheDirectory" in config.json.
3627 * public/include/db.php:
3628 (config_path): Extracted from generate_data_file.
3629 (generate_data_file):
3630 * tools/remote-server-relay.conf: Added. Apache 2.4 configuration file for a local http server launched by
3631 run-with-remote-server.py.
3632 * tools/run-with-remote-server.py: Added. Launches Apache with the right set of directives.
3634 (abspath_from_root):
3636 2015-07-13 Ryosuke Niwa <rniwa@webkit.org>
3640 * public/js/helper-classes.js:
3642 2015-06-27 Ryosuke Niwa <rniwa@webkit.org>
3644 build-requests should use conform to JSON API format
3645 https://bugs.webkit.org/show_bug.cgi?id=146375
3647 Reviewed by Stephanie Lewis.
3649 Instead of returning single dictionary that maps root set id to a dictionary of repository names
3650 to revisions, timestamps, simply return root sets and roots "rows" or "objects" as defined in
3651 JSON API (http://jsonapi.org/). This API change makes it easier to resolve the bug 146374 and
3652 matches what we do in /api/test-groups.
3654 Also add the support for /api/build-requests/?id=<id> to fetch the build request with <id>.
3655 This is useful for debugging purposes.
3657 * public/api/build-requests.php:
3658 (main): Added the support for $_GET['id']. Also return "rootSets" and "roots".
3659 (update_builds): Extracted from main.
3661 * public/include/build-requests-fetcher.php:
3662 (BuildRequestFetcher::fetch_request): Added. Used for /api/build-requests/?id=<id>.
3663 (BuildRequestFetcher::results_internal): Always call fetch_roots_for_set_if_needed.
3664 (BuildRequestFetcher::fetch_roots_for_set_if_needed): Renamed from fetch_roots_for_set.
3665 Moved the logic to exit early when the root set had already been fetched here.
3667 * public/v2/analysis.js:
3668 (App.TestGroup._fetchTestResults): Fixed the bug that test groups without any successful results
3671 * tools/pull-os-versions.py:
3673 (setup_auth): Moved to util.py
3675 * tools/sync-with-buildbot.py:
3676 (main): Replaced a bunch of perf dashboard related options by --server-config-json.
3677 (update_and_fetch_build_requests): No longer takes build_request_auth since that's now taken care
3679 (organize_root_sets_by_id_and_repository_names): Added. Builds the old rootsSets directory based
3680 on "roots" and "rootSets" dictionaries returned by /api/build-requests.
3681 (config_for_request): Fixed a bug that the script blows up when the build request is missing
3682 the repository specified in the configuration. This tolerance is necessary when a new repository
3683 dependency is added but we want to run A/B tests for old builds without the dependency.
3684 (fetch_json): No longer takes auth.
3687 (setup_auth): Moved from pull-os-versions.py to be shared with sync-with-buildbot.py.
3689 2015-06-23 Ryosuke Niwa <rniwa@webkit.org>
3691 Build fix. A/B testing is broken when continuous builders report revisions out of order.
3694 (App.AnalysisTaskController.Ember.Co