1 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
3 Fix various bugs in the new syncing script
4 https://bugs.webkit.org/show_bug.cgi?id=156393
6 Reviewed by Darin Adler.
8 * server-tests/resources/common-operations.js: Added. This file was supposed to be added in r199191.
11 (connectToDatabaseInEveryTest):
13 * tools/js/buildbot-triggerable.js:
14 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
15 builder as this dramatically increases the amount of log we generate.
16 * tools/js/parse-arguments.js:
17 (parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
19 (RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
20 (RemoteAPI.prototype.configure): Added more validations with nice error messages.
21 (RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
22 the right port in configure instead based on the scheme.
23 * tools/sync-buildbot.js:
24 (syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
25 and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
26 properly in Manifest.fetch() because we do need to "forget" about some tests and platforms in some cases.
27 For now, delete all v3 model objects and start over in each syncing cycle.
28 * unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.
30 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
32 sync-buildbot.js doesn't mark disappeared builds as failed
33 https://bugs.webkit.org/show_bug.cgi?id=156386
35 Reviewed by Chris Dumez.
37 Fix a bug that new syncing script doesn't mark builds that it scheduled but doesn't appear when queried
38 by buildbot's JSON API. These are builds that got canceled by humans (e.g. buildbot was restarted, data
39 loss, pending build was canceled, etc...)
41 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case.
42 * tools/js/buildbot-triggerable.js:
43 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added a set of build requests we've matched
44 against BuildbotBuildEntry's. Mark build requests that didn't have any entry but supposed to be in either
45 'scheduled' or 'running' status as failed.
47 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
49 A/B testing bots should prioritize user created test groups
50 https://bugs.webkit.org/show_bug.cgi?id=156375
52 Reviewed by Chris Dumez.
54 Order build requests preferring user created ones over ones automatically created by detect-changes.js.
56 Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new
57 build request on a builder/slave even when we had previously scheduled another build request.
59 * public/include/build-requests-fetcher.php:
60 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on
61 author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js.
62 Since we're using ascending order, this would put user created test groups first.
63 * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case
64 for testing that build requests for an user created test group shows up first.
65 * server-tests/resources/mock-data.js:
66 (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name.
67 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests
68 for an user created test group shows up first.
69 * tools/js/buildbot-syncer.js:
70 (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already
71 scheduled new build requests. Don't schedule more requests on these slaves.
72 (BuildbotSyncer.prototype.scheduleRequest):
73 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null
74 when slaveList is not specified) to _slavesWithNewRequests.
75 (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request
76 we have previously scheduled should be included in one of the entires now.
77 * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug.
78 (sampleiOSConfig): Added a second slave for new test cases.
80 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
82 Migrate legacy perf dashboard tests to mocha.js based tests
83 https://bugs.webkit.org/show_bug.cgi?id=156335
85 Reviewed by Chris Dumez.
87 Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise
88 for most of asynchronous operations, refactored the tests to use Promises as well, and added more
89 assertions where appropriate.
91 Also consolidated common helper functions into server-tests/resources/common-operations.js.
92 Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were
93 taking an array of reports while others were taking a single report. New shared implementation in
94 common-operations.js now takes a single report.
96 Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout.
97 Most of tests are passing under 100ms on my computer so 1s should be plenty still.
99 * run-tests.js: Removed.
100 * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js.
101 (reportsForDifferentPlatforms):
102 * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js.
103 (.addBuilder): Moved to common-operations.js.
104 * server-tests/api-build-requests-tests.js:
105 * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps.
106 * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js.
107 (.queryPlatformAndMetric):
109 * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js.
110 * server-tests/api-report-tests.js: Moved from tests/api-report.js.
113 (.reportWithSameSubtestName):
114 * server-tests/resources/common-operations.js: Added.
115 (addBuilderForReport): Extracted from tests.
116 (addSlaveForReport): Ditto.
117 (connectToDatabaseInEveryTest): Added.
118 (submitReport): Extracted from admin-platforms-tests.js.
119 * server-tests/resources/test-server.js:
120 (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start
121 its own Apache instance (that would certainly will fail).
122 * server-tests/tools-buildbot-triggerable-tests.js:
124 * tools/js/database.js:
125 (Database.prototype.selectAll): Added.
126 (Database.prototype.selectFirstRow): Added.
127 (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments.
129 2016-04-05 Ryosuke Niwa <rniwa@webkit.org>
131 New buildbot syncing scripts that supports multiple builders and slaves
132 https://bugs.webkit.org/show_bug.cgi?id=156269
134 Reviewed by Chris Dumez.
136 Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves.
137 The old python script (sync-with-buildbot.py) could only support a single builder and slave
138 for each platform, test pair.
140 The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added
141 throughout the codebase and tests have been refactored.
143 BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible
144 for syncing everything on each builder (on a buildbot).
146 Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored
147 test helpers and mocks as needed.
149 * public/v3/models/build-request.js:
150 (BuildRequest.prototype.status): Added.
151 (BuildRequest.prototype.isScheduled): Added.
152 * public/v3/models/metric.js:
153 (Metric.prototype.fullName): Added.
154 * public/v3/models/platform.js:
155 (Platform): Added the map based on platform name.
156 (Platform.findByName): Added.
157 * public/v3/models/test.js:
158 (Test.topLevelTests):
159 (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would
160 find the test whose name is "B" which has a parent test named "A".
161 (Test.prototype.fullName): Added.
162 * server-tests/api-build-requests-tests.js:
163 (addMockData): Moved to resources/mock-data.js.
164 (addAnotherMockTestGroup): Ditto.
165 * server-tests/resources/mock-data.js: Added.
166 (MockData.resetV3Models): Added.
167 (MockData.addMockData): Moved from api-build-requests-tests.js.
168 (MockData.addAnotherMockTestGroup): Ditto.
169 (MockData.mockTestSyncConfigWithSingleBuilder): Added.
170 (MockData.mockTestSyncConfigWithTwoBuilders): Added.
171 (MockData.pendingBuild): Added.
172 (MockData.runningBuild): Added.
173 (MockData.finishedBuild): Added.
174 * server-tests/resources/test-server.js:
176 (TestServer.prototype.remoteAPI):
177 (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit.
178 (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever.
179 (TestServer.prototype._waitForPid): Increase the timeout.
180 (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards.
181 * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce.
183 (MockLogger.prototype.log): Added.
184 (MockLogger.prototype.error): Added.
185 * tools/detect-changes.js:
186 (parseArgument): Moved to js/parse-arguments.js.
187 * tools/js/buildbot-syncer.js:
188 (BuildbotBuildEntry):
189 (BuildbotBuildEntry.prototype.syncer): Added.
190 (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status
191 for a build request (of the matching build request ID) if it needs to be updated in the server.
192 (BuildbotSyncer): This class
193 (BuildbotSyncer.prototype.addTestConfiguration): Added.
194 (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations.
195 (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on
197 (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request.
198 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for
199 the specified build request on the first slave that's available.
200 (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object.
201 Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it.
202 (BuildbotSyncer.prototype._pullRecentBuilds):
203 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now
204 only returns the path instead of the full URL since RemoteAPI takes a path, not full URL.
205 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON.
206 (BuildbotSyncer.prototype.pathForForceBuild): Added.
207 (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL.
208 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
209 (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test
210 configurations associated with it, find the one matching for this request.
211 (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it.
212 (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of
213 slave names present on this builder.
214 * tools/js/buildbot-triggerable.js: Added.
215 (BuildbotTriggerable): Added.
216 (BuildbotTriggerable.prototype.name): Added.
217 (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls
218 existing build requests from the perf dashboard, pulls buildbot for pending and running/completed
219 builds on each builder (represented by each syncer), schedules build requests on buildbot if there
220 is any builder/slave available, and updates the status of build requests in the database.
221 (BuildbotTriggerable.prototype._validateRequests): Added.
222 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added.
223 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added.
224 (BuildbotTriggerable._testGroupMapForBuildRequests): Added.
225 * tools/js/database.js:
226 * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js.
228 * tools/js/remote.js:
229 (RemoteAPI): Now optionally takes the server configuration.
230 (RemoteAPI.prototype.url): Added.
231 (RemoteAPI.prototype.getJSON): Removed the code for specifying request content.
232 (RemoteAPI.prototype.getJSONWithStatus): Ditto.
233 (RemoteAPI.prototype.postJSON): Added.
234 (RemoteAPI.prototype.postFormUrlencodedData): Added.
235 (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth.
236 * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host.
237 * tools/sync-buildbot.js: Added.
238 (main): Added. Parse the arguments and start the loop.
240 * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as
241 scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed.
243 (smallConfiguration): Added.
244 (smallPendingBuild): Added.
245 (smallInProgressBuild): Added.
246 (smallFinishedBuild): Added.
247 (createSampleBuildRequest): Create a unique build request for each platform.
248 (samplePendingBuild): Optionally specify build time and slave name.
249 (sampleInProgressBuild): Optionally specify slave name.
250 (sampleFinishedBuild): Ditto.
251 * unit-tests/resources/mock-remote-api.js:
252 (assert.notReached.assert.notReached):
253 (MockRemoteAPI.url): Added.
254 (MockRemoteAPI.postFormUrlencodedData): Added.
255 (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus.
256 (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we
257 need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI.
258 (MockRemoteAPI.inject):
259 (MockRemoteAPI.reset): Added.
261 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
263 Simplify API of Test model by removing Test.setParentTest
264 https://bugs.webkit.org/show_bug.cgi?id=156055
266 Reviewed by Joseph Pecoraro.
268 Removed Test.setParentTest. Keep track of the child-parent relationship using the static map instead.
270 Now each test only stores parent's id and uses the ID static map in Test.parentTest().
272 * public/v3/models/manifest.js:
273 (Manifest._didFetchManifest.buildObjectsFromIdMap): Removed the code to create the map of child-parent
274 relationship and call setParentTest.
275 * public/v3/models/test.js:
276 (Test): Updated a static map by the name of "childTestMap" to store itself. We should probably sort
277 child tests using some fixed criteria in the future instead of relying on the creation order but
278 preserve the old code's ordering for now.
279 (Test.prototype.parentTest): Look up the static map by the parent test's id.
280 (Test.prototype.onlyContainsSingleMetric):
281 (Test.prototype.setParentTest): Deleted.
282 (Test.prototype.childTests): Look up the child test map.
284 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
286 BuildRequest should have associated platform and test
287 https://bugs.webkit.org/show_bug.cgi?id=156054
289 Reviewed by Joseph Pecoraro.
291 Added methods to retrieve the platform and the test associated with a build request with tests.
293 * public/v3/models/build-request.js:
295 (BuildRequest.prototype.platform): Added.
296 (BuildRequest.prototype.test): Added.
297 * server-tests/api-build-requests-tests.js:
298 * server-tests/api-manifest.js: Fixed a typo. This tests /api/manifest, not /api/build-requests.
299 * unit-tests/buildbot-syncer-tests.js:
300 (.createSampleBuildRequest): Now takes Platform and Test objects to avoid hitting assertions in
301 BuildRequest's constructor.
303 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
305 BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
306 https://bugs.webkit.org/show_bug.cgi?id=156008
308 Reviewed by Darin Adler.
310 Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.
312 Now, new syncing scripts must be able to figure out the build slave the first build requests in
313 a given test group had used in order to schedule subsequent build requests in the test group.
315 For this purpose, /api/build-requests has been modified to return all build requests whose test
316 group had not finished yet. A test group is finished if all build requests in the test group had
317 finished (completed, failed, or canceled).
319 * public/include/build-requests-fetcher.php:
320 (BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
321 groups that have not been finished.
322 * public/v3/models/build-request.js:
324 (BuildRequest.prototype.testGroupId): Added.
325 (BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
326 (BuildRequest.fetchForTriggerable): Added.
327 (BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
329 * public/v3/models/manifest.js:
330 (Manifest.fetch): Use the full path from root so that it works in server tests.
331 * public/v3/models/test-group.js:
332 (TestGroup.hasPending):
333 (TestGroup._createModelsFromFetchedTestGroups):
334 * server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
335 is present in the response returned by /api/build-requests iff any build request in the group had not
338 (.addAnotherMockTestGroup): Added.
339 * unit-tests/test-groups-tests.js:
341 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
343 Make dependency injection in unit tests more explicit
344 https://bugs.webkit.org/show_bug.cgi?id=156006
346 Reviewed by Joseph Pecoraro.
348 Make the dependency injection of model objects in unit tests explicit so that server tests that create
349 "real" model objects won't create these mock objects. Now each test that uses mock model objects would call
350 MockModels.inject() to inject before / beforeEach and access each object using a property on MockModels
351 instead of them being implicitly defined on the global object.
353 Similarly, MockRemoteAPI now only replaces global.RemoteAPI during each test so that server tests can use
354 real RemoteAPI to access the test Apache server.
356 * unit-tests/analysis-task-tests.js:
357 * unit-tests/buildbot-syncer-tests.js:
358 (createSampleBuildRequest):
359 * unit-tests/measurement-adaptor-tests.js:
360 * unit-tests/measurement-set-tests.js:
361 * unit-tests/resources/mock-remote-api.js:
362 (MockRemoteAPI.getJSONWithStatus):
363 (MockRemoteAPI.inject): Added. Override RemoteAPI on the global object during each test.
364 * unit-tests/resources/mock-v3-models.js:
365 (MockModels.inject): Added. Create mock model objects before each test, and clear all static maps of
366 various v3 model classes (to remove all singleton objects for those model classes).
367 * unit-tests/test-groups-tests.js:
369 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
371 BuildbotSyncer should be able to fetch JSON from buildbot
372 https://bugs.webkit.org/show_bug.cgi?id=155921
374 Reviewed by Joseph Pecoraro.
376 Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot
377 with lots of unit tests as this has historically been a source of subtle bugs in the old script.
379 New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that
380 the state of some builds may change between each HTTP request. In the old script, we fetched the list
381 of the pending builds, and requested -1, -2, etc... builds for N times. But between each request,
382 a pending build may start running or an in-progress build finish and shift the offset by one. The new
383 script avoids this problem by first requesting all pending builds, then all in-progress and finished
384 builds in a single HTTP request. The results are then merged so that entries for in-progress and
385 finished builds would override the entries for pending builds if they overlap.
387 Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes
388 the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js).
390 * server-tests/api-build-requests-tests.js:
391 * server-tests/api-manifest.js:
392 * tools/js/buildbot-syncer.js:
393 (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as
394 we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished
395 builds as 'currentStep' is always defined but null in those builds.
396 (BuildbotBuildEntry.prototype.buildNumber): Added.
397 (BuildbotBuildEntry.prototype.isPending): Added.
398 (BuildbotBuildEntry.prototype.hasFinished): Added.
399 (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds.
400 (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds.
401 (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added.
402 (BuildbotSyncer.prototype.urlForBuildJSON): Added.
403 (BuildbotSyncer.prototype.url): Added.
404 (BuildbotSyncer.prototype.urlForBuildNumber): Added.
405 * tools/js/remote.js:
406 (RemoteAPI.prototype.getJSON): Renamed from fetchJSON.
407 (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus.
408 * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node.
409 * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot
410 (samplePendingBuild):
411 (sampleInProgressBuild): Added.
412 (sampleFinishedBuild): Added.
413 * unit-tests/resources/mock-remote-api.js:
414 (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus.
416 2016-03-24 Ryosuke Niwa <rniwa@webkit.org>
418 Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
419 https://bugs.webkit.org/show_bug.cgi?id=155863
421 Reviewed by Joseph Pecoraro.
423 Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability
424 added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed
425 /admin/regenerate-manifest since it has been superseded by /api/manifest.
427 This patch also extracts manifest.js out of main.js so that it could be used and tested without the
430 * public/admin/regenerate-manifest.php: Deleted.
431 * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with
432 a trailing backslash.
433 * public/include/manifest.php:
434 (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories.
435 * public/v3/index.html:
438 * public/v3/models/bug-tracker.js:
439 (BugTracker.prototype.newBugUrl): Added.
440 (BugTracker.prototype.repositories): Added.
441 * public/v3/models/manifest.js: Added. Extracted from main.js.
442 (Manifest.fetch): Moved from main.js' fetchManifest.
443 (Manifest._didFetchManifest): Moved from main.js' didFetchManifest.
444 * public/v3/models/platform.js:
445 (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of
446 the same name. This is tested by the newly added test cases.
447 * server-tests/api-build-requests-tests.js:
448 * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js
449 with additional assertions for v3 UI model objects.
450 * server-tests/resources/test-server.js:
451 (TestServer.prototype.start):
452 (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API.
453 Also no longer takes dataDirectory as an argument since it's always the same.
454 (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data.
455 (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests.
456 (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an
457 unintended side effect of slowing down unit tests even through they don't need Postgres or Apache.
458 * tests/admin-regenerate-manifest.js: Removed.
459 * tools/js/database.js:
460 * tools/js/v3-models.js:
462 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
464 Add mocha server tests for /api/build-requests
465 https://bugs.webkit.org/show_bug.cgi?id=155831
467 Reviewed by Chris Dumez.
469 Added the new mocha.js based server-tests for /api/build-requests. The new harness automatically:
470 - starts a new Apache instance
471 - switches the database during testing via setting an environmental variable
472 - backups and restores public/data directory during testing
474 As a result, developer no longer has to manually setup Apache, edit config.json manually to use
475 a testing database, or run /api/manifest.php to re-generate the manifest file after testing.
477 This patch also makes ID resolution optional on /api/build-requests so that v3 model based syncing
478 scripts can re-use the same code as the v3 UI to process the JSON. tools/sync-with-buildbot.py has
479 been modified to use this option (useLegacyIdResolution).
481 * config.json: Added configurations for the test httpd server.
482 * init-database.sql: Don't error when tables and types don't exist (when database is empty).
483 * public/api/build-requests.php:
484 (main): Made the ID resolution optional with useLegacyIdResolution. Also removed "updates" from the
485 results JSON since it's never used.
486 * public/include/build-requests-fetcher.php:
487 (BuildRequestsFetcher::__construct):
488 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Fixed the bug that we would include the same
489 commit multiple times for each root set.
490 * public/include/db.php:
491 (config): If present, use ORG_WEBKIT_PERF_CONFIG_PATH instead of Websites/perf.webkit.org/config.json.
492 * server-tests: Added.
493 * server-tests/api-build-requests-tests.js: Added. Tests for /api/build-requests.
495 * server-tests/resources: Added.
496 * server-tests/resources/test-server.conf: Added. Apache configuration file for testing.
497 * server-tests/resources/test-server.js: Added.
499 (TestSever.prototype.start): Added.
500 (TestSever.prototype.stop): Added.
501 (TestSever.prototype.remoteAPI): Added. Configures RemoteAPI to be used with the test sever.
502 (TestSever.prototype.database): Added. Returns Database configured to use the test database.
503 (TestSever.prototype._constructTestConfig): Creates config.json for testing. The file is generated by
504 _start and db.php's config() reads it from the environmental variable: ORG_WEBKIT_PERF_CONFIG_PATH.
505 (TestSever.prototype._ensureDataDirectory): Renames public/data to public/original-data if exists,
506 and creates a new empty public/data.
507 (TestSever.prototype._restoreDataDirectory): Deletes public/data and renames public/original-data
509 (TestSever.prototype._ensureTestDatabase): Drops the test database if exists and creates a new one.
510 (TestSever.prototype.initDatabase): Run init-database.sql to start each test with a consistent state.
511 (TestSever.prototype._executePgsqlCommand): Executes a postgres command line tool such as psql.
512 (TestSever.prototype._determinePgsqlDirectory): Finds the directory that contains psql.
513 (TestSever.prototype._startApache): Starts an Apache instance for testing.
514 (TestSever.prototype._stopApache): Stops the Apache instance for testing.
515 (TestSever.prototype._waitForPid): Waits for the Apache pid file to appear or disappear.
516 (before): Start the test server at the beginning.
517 (beforeEach): Re-initialize all tables before each test.
518 (after): Stop the test server at the end.
519 * tools/js/config.js:
520 (Config.prototype.path):
521 (Config.prototype.serverRoot): Added. The path to Websites/perf.webkit.org/public/.
522 (Config.prototype.pathFromRoot): Added. Resolves a path from Websites/perf.webkit.org.
523 * tools/js/database.js:
524 (Database): Now optionally takes the database name to use a different database during testing.
525 (Database.prototype.connect):
526 (Database.prototype.query): Added.
527 (Database.prototype.insert): Added.
528 (tableToPrefixMap): Maps table name to its prefix. Used by Database.insert.
529 * tools/js/remote.js: Added.
530 (RemoteAPI): Added. This is node.js equivalent of RemoteAPI in public/v3/remote.js.
531 (RemoteAPI.prototype.configure): Added.
532 (RemoteAPI.prototype.fetchJSON): Added.
533 (RemoteAPI.prototype.fetchJSONWithStatus): Added.
534 (RemoteAPI.prototype.sendHttpRequest): Added.
535 * tools/sync-with-buildbot.py:
536 (main): Use useLegacyIdResolution as this script relies on the legacy behavior.
537 * unit-tests/checkconfig.js: pg was never directly used in this test.
539 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
541 Delete a file that was supposed to be removed in r198614 for real.
543 * unit-tests/resources/v3-models.js: Removed.
545 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
547 Add a model for parsing buildbot JSON with unit tests
548 https://bugs.webkit.org/show_bug.cgi?id=155814
550 Reviewed by Joseph Pecoraro.
552 Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests.
553 They will be used in the new syncing scripts to improve A/B testing.
555 * public/v3/models/build-request.js:
557 * tools/js/buildbot-syncer.js: Added.
558 (BuildbotBuildEntry): Added.
559 (BuildbotBuildEntry.prototype.slaveName): Added.
560 (BuildbotBuildEntry.prototype.buildRequestId): Added.
561 (BuildbotBuildEntry.prototype.isInProgress): Added.
562 (BuildbotSyncer): Added.
563 (BuildbotSyncer.prototype.testPath): Added.
564 (BuildbotSyncer.prototype.builderName): Added.
565 (BuildbotSyncer.prototype.platformName): Added.
566 (BuildbotSyncer.prototype.fetchPendingRequests): Added.
567 (BuildbotSyncer.prototype._propertiesForBuildRequest): Added.
568 (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added.
569 (BuildbotSyncer._loadConfig): Added.
570 (BuildbotSyncer._validateAndMergeConfig): Added.
571 (BuildbotSyncer._validateAndMergeProperties): Added.
572 * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js.
573 (beforeEach): Deleted since this only defined inside mocha.
574 * unit-tests/analysis-task-tests.js:
575 * unit-tests/buildbot-syncer-tests.js: Added.
577 (createSampleBuildRequest):
578 (.smallConfiguration):
579 * unit-tests/measurement-adaptor-tests.js:
580 * unit-tests/measurement-set-tests.js:
581 * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js.
583 * unit-tests/test-groups-tests.js:
586 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
588 Add unit tests for test-group.js
589 https://bugs.webkit.org/show_bug.cgi?id=155781
591 Reviewed by Joseph Pecoraro.
593 Added unit tests for test-group.js that would have caught regressions fixed in r198503.
595 * public/v3/components/chart-pane-base.js:
596 (ChartPaneBase.prototype._renderAnnotations): Added a forgotten break statement.
597 * public/v3/models/build-request.js:
598 (BuildRequest.prototype.setResult):
600 * public/v3/models/test-group.js:
601 * unit-tests/measurement-set-tests.js: Use ./resources/v3-models.js to reduce the code duplication.
602 * unit-tests/resources/v3-models.js: Import more stuff from v3 models.
604 * unit-tests/test-groups-tests.js: Added. Added some unit tests for TestGroup.
606 (.testGroupWithStatusList):
608 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
614 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
616 Commit log viewer repaints too frequently after r198499
617 https://bugs.webkit.org/show_bug.cgi?id=155732
619 Reviewed by Joseph Pecoraro.
621 The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
622 if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
623 and avoiding work in the commit log viewer when the requested repository and the revision range were
624 the same as those of the last request.
626 * public/v3/components/commit-log-viewer.js:
628 (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
629 identical to the one we already have to avoid repaints and issuing multiple network requests.
630 * public/v3/components/interactive-time-series-chart.js:
631 (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
632 indicator hadn't changed.
633 * public/v3/pages/chart-pane.js:
634 (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
635 the URL. We need to check whether the lock state had changed. The old condition was also redundant
636 since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
638 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
640 Fix A/B testing after r198503.
642 * public/include/build-requests-fetcher.php:
644 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
646 Analysis task page is broken after r198479
647 https://bugs.webkit.org/show_bug.cgi?id=155735
649 Rubber-stamped by Chris Dumez.
651 * public/api/measurement-set.php:
652 (AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
653 * public/include/build-requests-fetcher.php:
654 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
655 * public/v3/models/commit-log.js:
656 (CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
657 * public/v3/models/root-set.js:
658 (RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
659 we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
660 find the repository with "[object]" as the ID.
661 * public/v3/models/test-group.js:
662 (TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.
664 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
666 v3 UI sometimes don't update the list of revisions on the commit log viewer
667 https://bugs.webkit.org/show_bug.cgi?id=155729
669 Rubber-stamped by Chris Dumez.
671 Fixed multiple bugs that were affecting the list of blame range and commit logs for the range weren't
672 updated in some cases on v3 UI. Also, the commit log viewer state is now a part of the URL state so
673 opening and closing the commit log viewer will persist across page loads.
675 Also fixed a regression from r198479 that Test object can't be created for a top level test.
677 * public/v3/components/chart-pane-base.js:
678 (ChartPaneBase.prototype.configure):
679 (ChartPaneBase.prototype._mainSelectionDidChange): Fixed the bug that the list of blame range nor the
680 commit log viewer don't get updated when the selected range changes.
681 (ChartPaneBase.prototype._indicatorDidChange):
682 (ChartPaneBase.prototype._didFetchData):
683 (ChartPaneBase.prototype._updateStatus): Extracted from _indicatorDidChange and _didFetchData.
684 (ChartPaneBase.prototype._requestOpeningCommitViewer): Renamed from _openCommitViewer.
686 * public/v3/components/chart-status-view.js:
687 (ChartStatusView.prototype.updateStatusIfNeeded): Fixed the bug that the blame range doesn't get set
688 on the initial page load when the selection range is set but the chart data hadn't been fetched yet.
690 * public/v3/components/commit-log-viewer.js:
691 (CommitLogViewer.prototype.view): Fixed the bug that we don't clear out the old list of commits while
692 loading the next set of commits to show as it looked as if the list was never updated.
693 (CommitLogViewer.prototype.render): Fixed the bug that the view always show the last repository name
694 even if there were nothing being fetched or commits to show.
696 * public/v3/components/pane-selector.js:
697 (PaneSelector.prototype.focus): Removed superfluous call to console.log.
699 * public/v3/models/data-model.js:
700 (DataModelObject.listForStaticMap): Generalized the code for all to fix the bug in Test.
701 (DataModelObject.all):
703 * public/v3/models/test.js:
704 (Test): Fixed the bug that this code was relying on the static map to be an array.
705 (Test.topLevelTests): Use newly added listForStaticMap to convert the dictionary to an array.
707 * public/v3/pages/chart-pane-status-view.js:
708 (ChartPaneStatusView): Always initialize _usedRevisionRange as a triple to simplify code elsewhere.
709 (ChartPaneStatusView.prototype.render): Invoke _revisionCallback when user clicks on a repository
710 expansion mark (>>). Also fixed click handler from the row since this made selecting revision range
711 on the view cumbersome. Now user has to explicitly click on the expansion mark (>>).
712 (ChartPaneStatusView.prototype._setRevisionRange): Now takes shouldNotify, from, and to as arguments
713 as this function must not invoke_revisionCallback inside _updateRevisionListForNewCurrentRepository.
714 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Use newly added setCurrentRepository
715 instead of manually invoking setCurrentRepository and updateRevisionListWithNotification.
716 (ChartPaneStatusView.prototype.setCurrentRepository): Fixed the bug that we weren't updating the
718 (ChartPaneStatusView.prototype.updateRevisionList): Renamed from updateRevisionListWithNotification
719 since we no longer call _revisionCallback. In general, callbacks are only meant to communicate user
720 initiated actions, and not program induced updates like this API so this was a bad pattern anyway.
721 ChartPane now explicitly updates the commit log viewer instead of relying on this function calling
722 _requestOpeningCommitViewer implicitly.
723 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Extracted from
724 updateRevisionListWithNotification so that setCurrentRepository can also call this function.
726 * public/v3/pages/chart-pane.js:
727 (ChartPane.prototype._requestOpeningCommitViewer): Overrides ChartPaneBase's method. Open the same
728 repository in other panes via ChartsPage.setOpenRepository.
729 (ChartPane.prototype.setOpenRepository): This method is called when the user selected a repository in
730 another pane. Open the same repository in this pane if it wasn't already open.
732 * public/v3/pages/charts-page.js:
733 (ChartsPage): Added this._currentRepositoryId.
734 (ChartsPage.prototype.serializeState): Serialize _currentRepositoryId.
735 (ChartsPage.prototype.updateFromSerializedState): Set the commit log viewer's
736 (ChartsPage.prototype.setOpenRepository): Added.
738 * tests/api-measurement-set.js: Fixed a test after r198479.
740 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
742 V3 Perf Dashboard should automatically select initial range when creating a new task
743 https://bugs.webkit.org/show_bug.cgi?id=155677
745 Reviewed by Joseph Pecoraro.
747 Select the entire range of points for which the analysis task is created by default so that creating
748 a test group to confirm the regression / progression is easy.
750 * public/v3/pages/analysis-task-page.js:
751 (AnalysisTaskPage): Added a boolean flag which indicates the user had modified main chart's selection.
752 * public/v3/pages/analysis-task-page.js:
753 (AnalysisTaskPage.prototype.render): Set the main chart's selection to the entire range of points in
754 the analysis task if the user had never modified selection.
755 (AnalysisTaskPage.prototype._chartSelectionDidChange): This callback is invoked only when the user had
756 modified the selection so set _selectionWasModifiedByUser true here unconditionally.
758 2016-03-19 Ryosuke Niwa <rniwa@webkit.org>
760 Associated commits don't immediately show up on an analysis task page
761 https://bugs.webkit.org/show_bug.cgi?id=155692
763 Reviewed by Darin Adler.
765 The bug was caused by resolveCommits in AnalysisTask._constructAnalysisTasksFromRawData not being
766 able to find the matching commit log if the commit log had been created by the charts which don't
767 set the remote identifiers on each CommitLog objects.
769 Fixed the bug by modifying /api/measurement-set to include the commit ID, and making CommitLog
770 use the real database ID as its ID instead of a fake ID we create from repository and revision.
772 Also added a bunch of Mocha unit tests for AnalysisTask.fetchAll.
774 * public/api/measurement-set.php:
775 (MeasurementSetFetcher::execute_query): Fetch commit_id.
776 (MeasurementSetFetcher::format_run): Use pass-by-reference to avoid making a copy of the row.
777 (MeasurementSetFetcher::parse_revisions_array): Include commit_id as the first item in the result.
778 * public/v3/instrumentation.js:
779 * public/v3/models/analysis-task.js:
780 (AnalysisTask): Fixed a bug that _buildRequestCount and _finishedBuildRequestCount could be kept
781 as strings and hasPendingRequests() could return a wrong result because it would perform string
782 inequality instead of numerical inequality.
783 (AnalysisTask.prototype.updateSingleton): Ditto.
784 (AnalysisTask.prototype.dissociateCommit):
785 (AnalysisTask._constructAnalysisTasksFromRawData):
786 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Use findById now that CommitLog
787 objects all use the same id as the database id.
788 * public/v3/models/commit-log.js:
790 (CommitLog.prototype.remoteId): Deleted since we no longer create a fake id for commit logs for
792 (CommitLog.findByRemoteId): Deleted.
793 (CommitLog.ensureSingleton): Deleted.
794 (CommitLog.fetchBetweenRevisions):
796 * public/v3/models/data-model.js:
797 (DataModelObject.clearStaticMap): Added to aid unit testing.
798 (DataModelObject.ensureNamedStaticMap): Fixed a typo. Each map is a dictionary, not an array.
799 * public/v3/models/metric.js:
800 * public/v3/models/platform.js:
801 * public/v3/models/root-set.js:
802 (RootSet): Updated per the interface change in CommitLog.ensureSingleton.
803 (MeasurementRootSet): Updated per /api/measurement-set change. Use the first value as the id.
804 * public/v3/models/test.js:
805 * unit-tests/analysis-task-tests.js: Added.
806 (sampleAnalysisTask):
807 (measurementCluster):
808 * unit-tests/checkconfig.js: Added some assertion message to help aid diagnosing the failure.
809 * unit-tests/measurement-adaptor-tests.js: Updated the sample data per the API change in
810 /api/measurement-set and also added assertions for commit log ids.
811 * unit-tests/measurement-set-tests.js:
813 * unit-tests/resources: Added.
814 * unit-tests/resources/mock-remote-api.js: Added. Extracted from measurement-set-tests.js to be
815 used in analysis-task-tests.js.
816 (assert.notReached.assert.notReached):
817 (global.RemoteAPI.getJSON):
818 (global.RemoteAPI.getJSONWithStatus):
820 * unit-tests/resources/v3-models.js: Added. Extracted from measurement-set-tests.js to be used in
821 analysis-task-tests.js and added more imports as needed.
825 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
827 Build fix after r198464.
829 * public/v3/components/analysis-results-viewer.js:
830 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
832 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
834 Build fix after r198234.
836 * public/api/commits.php:
837 (main): Typo: fetch_latest_reported -> fetch_last_reported.
838 * public/include/commit-log-fetcher.php:
839 (CommitLogFetcher::format_single_commit): commits should be an array.
841 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
843 Perf Dashboard v3 confuses better and worse on A/B task page
844 https://bugs.webkit.org/show_bug.cgi?id=155675
845 <rdar://problem/25208723>
847 Reviewed by Joseph Pecoraro.
849 The analysis results viewer on v3 UI sometimes treats regressions as progressions and vice versa when
850 the first set (i.e. set A) of the revisions used in an A/B testing never appears in the original graph,
851 and its latest commit time matches that of the second set, which appears in the original graph.
853 Because the analysis results viewer compares results in the increasing row number, this results in
854 B to be compared to A instead of A to be compared to B. Fixed the bug by preventing the wrong ordering
855 to occur in _buildRowsForPointsAndTestGroups by always inserting a root set A before B when B appears
856 and A doesn't appear in the original graph.
858 * public/v3/components/analysis-results-viewer.js:
859 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Remember the succeeding root set B
860 when creating an entry for root set A.
861 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Fixed the bug. Also un-duplicated
862 the code to create a new row.
863 (AnalysisResultsViewer.RootSetInTestGroup): Now takes a succeeding root set. e.g. it's B for A and
864 undefined for B in A/B testing.
865 (AnalysisResultsViewer.RootSetInTestGroup.prototype.succeedingRootSet): Added.
866 * public/v3/components/time-series-chart.js:
867 (TimeSeriesChart.computeTimeGrid): Fixed the bug that we would end up showing 0 AM instead of dates
868 when both dates and months change.
870 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
872 Add unit tests for measurement-set.js and measurement-adapter.js
873 https://bugs.webkit.org/show_bug.cgi?id=155673
875 Reviewed by Daniel Bates.
877 Add tests which were supposed to be added in r198462.
879 * unit-tests/measurement-adaptor-tests.js: Added.
880 * unit-tests/measurement-set-tests.js: Added.
881 (assert.notReached): Added.
882 (global.RemoteAPI.getJSON): Added.
883 (global.RemoteAPI.getJSONWithStatus): Added. A mock.
885 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
887 Add unit tests for measurement-set.js and measurement-adapter.js
888 https://bugs.webkit.org/show_bug.cgi?id=155673
890 Reviewed by Darin Adler.
892 Added mocha unit tests for MeasurementSet and MeasurementAdapter classes along with the necessary
893 refactoring to run these tests in node.
895 getJSON and getJSONStatus are now under RemoteAPI so that unit tests can mock them.
897 Removed the dependency on v2 UI's TimeSeries and Measurement class by adding a new implementation
898 of TimeSeries in v3 and removing the dependency on Measurement in chart-pane-status-view.js with
899 new helper methods on Build and CommitLog.
901 Many js files now use 'use strict' (node doesn't support class syntax in non-strict mode) and
902 module.exports to export symbols in node's require function.
904 * public/v3/index.html:
906 * public/v3/models/analysis-results.js:
907 (AnalysisResults.fetch):
908 * public/v3/models/analysis-task.js:
909 (AnalysisTask.fetchAll):
910 * public/v3/models/builder.js:
912 (Build.prototype.builder): Added. Used by ChartPaneStatusView.
913 (Build.prototype.buildNumber): Ditto.
914 (Build.prototype.buildTime): Ditto.
915 * public/v3/models/commit-log.js:
916 (CommitLog.prototype.diff): Ditto.
917 (CommitLog.fetchBetweenRevisions):
918 * public/v3/models/data-model.js:
919 (DataModelObject.cachedFetch):
920 * public/v3/models/measurement-adaptor.js:
921 (MeasurementAdaptor.prototype.applyToAnalysisResults): Renamed from adoptToAnalysisResults.
922 (MeasurementAdaptor.prototype.applyTo): Renamed from adoptToSeries. Now shares a lot more
923 code with applyToAnalysisResults. The code to set 'series' and 'seriesIndex' has been moved
924 to TimeSeries.append. 'measurement' is no longer needed as this patch removes its only use
925 in ChartPaneStatusView.
926 * public/v3/models/measurement-cluster.js:
927 (MeasurementCluster.prototype.addToSeries): Use TimeSeries.append instead of directly mutating
929 * public/v3/models/measurement-set.js:
930 (Array.prototype.includes): Added a polyfill for node.
931 (MeasurementSet.prototype._fetchSecondaryClusters): Removed a bogus assertion. When fetchBetween
932 is called with a mixture of clusters that have been fetched and not fetched, this assertion fails.
933 (MeasurementSet.prototype._fetch):
934 (TimeSeries.prototype.findById): Moved to time-series.js.
935 (TimeSeries.prototype.dataBetweenPoints): Ditto.
936 (TimeSeries.prototype.firstPoint): Ditto.
937 (TimeSeries.prototype.fetchedTimeSeries): Moved the code to extend the last point to TimeSeries'
939 * public/v3/models/repository.js:
940 * public/v3/models/root-set.js:
941 (MeasurementRootSet): Ignore repositories that had not been defined (e.g. it could be added after
942 manifest.json had been downloaded but before a given root set is created for an A/B testing).
943 * public/v3/models/time-series.js:
945 (TimeSeries.prototype.append): Added.
946 (TimeSeries.prototype.extendToFuture): Added.
947 (TimeSeries.prototype.firstPoint): Moved from measurement-set.js.
948 (TimeSeries.prototype.lastPoint): Added.
949 (TimeSeries.prototype.previousPoint): Added.
950 (TimeSeries.prototype.nextPoint): Added.
951 (TimeSeries.prototype.findPointByIndex): Added.
952 (TimeSeries.prototype.findById): Moved from measurement-set.js.
953 (TimeSeries.prototype.findPointAfterTime): Added.
954 (TimeSeries.prototype.dataBetweenPoints): Moved from measurement-set.js.
955 * public/v3/pages/chart-pane-status-view.js:
956 (ChartPaneStatusView.prototype.render): Use newly added helper functions on Build.
957 (ChartPaneStatusView.prototype._formatTime): Added.
958 (ChartPaneStatusView.prototype.setCurrentRepository):
959 (ChartPaneStatusView.prototype.computeChartStatusLabels): Rewrote the code using RootSet object on
960 currentPoint and previousPoint instead of Measurement class from v2 UI. Also sort the results using
961 sortByNamePreferringOnesWithURL.
962 * public/v3/remote.js:
963 (RemoteAPI.getJSON): Moved under RemoteAPI.
964 (RemoteAPI.getJSONWithStatus): Ditto.
966 (PrivilegedAPI.requestCSRFToken):
968 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
970 Add unit tests for config.json and statistics.js
971 https://bugs.webkit.org/show_bug.cgi?id=155626
973 Reviewed by Darin Adler.
975 Added mocha unit tests for statistics.js and validating config.json. For segmentations, I've extracted
976 real data from our internal perf dashboard.
978 Also fixed some bugs covered by these new tests.
980 * public/shared/statistics.js:
981 (Statistics.movingAverage): Fixed a bug that forwardWindowSize was never used.
982 (Statistics.exponentialMovingAverage): Fixed the bug that the moving average starts at 0. It should
983 start at the first value instead.
984 (.splitIntoSegmentsUntilGoodEnough): Fixed the bug that we may try to segment a time series into
985 more parts than there are data points. Clearly, that doesn't make any sense.
986 (.findOptimalSegmentation): Renamed local variables so that they're more descriptive, and rewrote
987 the debugging code was the old code was emitting some useless data. Also fixed the bug that the length
988 of "segmentation" was off by one (we need segmentCount + 1 elements in the array sine we always
989 include the start of the first segment = 0 and the end of the last segment = values.length).
990 (.SampleVarianceUpperTriangularMatrix):
991 (Statistics): Modernized the export code.
993 * tools/js/config.js: Added.
995 (Config.prototype.configFilePath): Added.
996 (Config.prototype.value): Added.
997 (Config.prototype.path): Added.
998 * tools/js/database.js: Added.
1000 (Database.prototype.connect): Added.
1001 (Database.prototype.disconnect): Added.
1002 * unit-tests: Added.
1003 * unit-tests/checkconfig.js: Added. Validates config.json. This is useful while setting up
1004 a local instance of the perf dashboard.
1005 * unit-tests/statistics-tests.js: Added.
1006 (assert.almostEqual): Added. Asserts that two floating values are within a given significant digits.
1011 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1013 Fix a typo which was supposed to be fixed in r198351.
1015 * public/v3/pages/analysis-task-page.js:
1016 (AnalysisTaskPage.prototype.render):
1018 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1020 An analysis task should be closed if a progression cause is identified
1021 https://bugs.webkit.org/show_bug.cgi?id=155549
1023 Reviewed by Chris Dumez.
1025 Since a progression is desirable, we should close an analysis task once its cause is identified.
1027 Also fix some typos.
1029 * init-database.sql: Fixed a typo.
1030 * public/api/analysis-tasks.php:
1031 * public/v3/models/analysis-task.js:
1032 (AnalysisTask.prototype.dissociateBug): Renamed from dissociateBug.
1033 * public/v3/pages/analysis-task-page.js:
1034 (AnalysisTaskPage.prototype.render):
1035 (AnalysisTaskPage.prototype._dissociateBug): Renamed from _dissociateBug.
1036 (AnalysisTaskPage.prototype._dissociateCommit): Fixed the typo in the alert.
1038 2016-03-16 Ryosuke Niwa <rniwa@webkit.org>
1040 Analysis task page should allow specifying commits that caused or fixed a regression or a progression
1041 https://bugs.webkit.org/show_bug.cgi?id=155529
1043 Reviewed by Chris Dumez.
1045 Added the capability to associate revisions that caused or fixed a progression or a regression for which
1046 an analysis task was created. Added task_commits that stores this relationship and added the backend
1047 support to retrieve this table in /api/analysis-tasks and an privileged API to update this table at
1048 /privileged-api/associate-commit.
1050 Also extracted a new component, MutableListView, out of AnalysisTaskPage to render and manipulate a list
1051 of mutable items, and used it to render the list of associated bugs and commits. The view takes a list of
1052 kinds (e.g. repositories or bug trackers), and accepts a pair of a kind and arbitrary text as a new item
1055 * init-database.sql: Added task_commits table.
1057 * public/api/analysis-tasks.php:
1059 (fetch_associated_data_for_tasks): Renamed from fetch_and_push_bugs_to_tasks now that it also fetches
1060 the list of commits associated with each analysis task by calling CommitLogFetcher::fetch_for_tasks.
1061 Also fixe the bug that we were not taking
1062 (format_task): No longer sets 'category' since the computation of category now depends on the list of
1063 commits associated with this analysis task which aren't available until fetch_associated_data_for_tasks.
1064 (determine_category): Added. Categorize any analysis tasks with "fixes" commits as "closed" and "causes"
1065 commits as "identified".
1067 * public/include/commit-log-fetcher.php:
1068 (CommitLogFetcher::__construct): Remove the unused instance variable.
1069 (CommitLogFetcher::fetch_for_tasks): Added. Fetches all commits associated with a list of analysis tasks.
1070 Assumes the caller (fetch_associated_data_for_tasks) had setup "fixes" and "causes" fields on each task.
1072 * public/privileged-api/associate-commit.php: Added. Updates task_commits table to associate or disassociate
1073 a commit with an analysis task. When the specified analysis task and the specified commit are already
1074 associated, we simply update the table instead of adding a duplicating entry or error. For dissociation,
1075 the front-end specifies the commit ID.
1078 * public/v3/index.html:
1079 * public/v3/components/mutable-list-view.js: Added. Used by the list associated bugs and commits.
1080 (MutableListView): Added.
1081 (MutableListView.prototype.setList): Added.
1082 (MutableListView.prototype.setKindList): Added.
1083 (MutableListView.prototype.setAddCallback): Added. This callback is invoked when the user tries to add
1084 a new item to the list.
1085 (MutableListView.prototype.render): Added.
1086 (MutableListView.prototype._submitted): Added.
1087 (MutableListView.cssTemplate):
1088 (MutableListView.htmlTemplate):
1089 (MutableListItem): Added. RemovalLink could be a hyperlink or a callback and gets involved when the user
1090 tries to delete this item.
1091 (MutableListItem.prototype.content):
1093 * public/v3/models/analysis-task.js:
1094 (AnalysisTask): Added the support of the list of commits that fixed and caused changes.
1095 (AnalysisTask.prototype.updateSingleton): Ditto.
1096 (AnalysisTask.prototype.causes): Added.
1097 (AnalysisTask.prototype.fixes): Added.
1098 (AnalysisTask.prototype.associateCommit): Added. Use the API added at /privileged-api/associate-commit
1099 to associate a new commit with this analysis task. Each commit has either caused or fixed the change.
1100 (AnalysisTask.prototype.dissociateCommit): Added. Use the same API to disassociate each commit.
1101 (AnalysisTask._constructAnalysisTasksFromRawData): Find all commits associated with each analysis task.
1102 Because commit log objects use a fake ID fdue to /api/measurement-set not providing commit IDs, we must
1103 use CommitLog.findByRemoteId to find each commit instead of usual CommitLog.findById.
1104 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Added.
1106 * public/v3/models/build-request.js:
1107 (BuildRequest.prototype.hasFinished): Renamed from hasCompleted since it was confusing for this._status
1108 being "completed" wasn't a necessary condition for this function to return true.
1110 * public/v3/models/commit-log.js:
1111 (CommitLog): Added the static map for actual commit ID instead of a fake ID created in ensureSingleton.
1112 (CommitLog.prototype.remoteId): Added. Returns the real commit ID.
1113 (CommitLog.findByRemoteId): Added. Finds an CommitLog object using the real ID.
1115 * public/v3/models/test-group.js:
1116 (TestGroup.prototype.hasFinished): Renamed from hasCompleted to match the rename in BuildRequest.
1118 * public/v3/pages/analysis-task-page.js:
1119 (AnalysisTaskPage): Added lists for the commits that fixed and caused the change using MutableListView.
1120 Also adopted MutableListView for the list of associated bugs.
1121 (AnalysisTaskPage.prototype.render): Added the code to populate the newly added lists.
1122 (AnalysisTaskPage.prototype._makeCommitListItem): Added.
1123 (AnalysisTaskPage.prototype._associateBug): Now this is a callback from MutableListView.
1124 (AnalysisTaskPage.prototype._associateCommit): Added.
1125 (AnalysisTaskPage.prototype._dissociateCommit): Added.
1126 (AnalysisTaskPage.htmlTemplate):
1127 (AnalysisTaskPage.cssTemplate):
1129 * public/v3/remote.js:
1130 (getJSON): Spit out the entire responseText when JSON failed to parse to make debugging easier.
1132 2016-03-15 Ryosuke Niwa <rniwa@webkit.org>
1134 Extract the code to format commit logs into its own PHP file
1135 https://bugs.webkit.org/show_bug.cgi?id=155514
1137 Rubber-stamped by Chris Dumez.
1139 Extracted CommitLogFetcher out of /api/commits so that it could be used in analysis-tasks.php
1140 in the future to support associating cause/fix for each analysis task.
1142 * public/api/commits.php:
1143 * public/include/commit-log-fetcher.php: Added.
1145 (CommitLogFetcher::__construct): Added.
1146 (CommitLogFetcher::repository_id_from_name): Added.
1147 (CommitLogFetcher::fetch_between): Added.
1148 (CommitLogFetcher::fetch_oldest): Added.
1149 (CommitLogFetcher::fetch_latest): Added.
1150 (CommitLogFetcher::fetch_last_reported): Added.
1151 (CommitLogFetcher::fetch_revision): Added.
1152 (CommitLogFetcher::commit_for_revision): Added.
1153 (CommitLogFetcher::format_single_commit): Added.
1154 (CommitLogFetcher::format_commit): Added.
1156 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1158 Build fix after r196870.
1160 * public/include/report-processor.php:
1162 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1164 Add Size metric to perf dashboard
1165 https://bugs.webkit.org/show_bug.cgi?id=155266
1167 Reviewed by Chris Dumez.
1169 Added the "Size" metric and use bytes as its unit.
1171 * public/js/helper-classes.js:
1173 * public/v2/data.js:
1174 (RunsData.unitFromMetricName):
1176 2016-02-20 Ryosuke Niwa <rniwa@webkit.org>
1178 Add the support for universal slave password
1179 https://bugs.webkit.org/show_bug.cgi?id=154476
1181 Reviewed by David Kilzer.
1183 Added the support for universalSlavePassword.
1186 * public/include/report-processor.php:
1187 (ReportProcessor::process):
1188 (ReportProcessor::authenticate_and_construct_build_data): Extracted from process().
1190 2016-02-19 Ryosuke Niwa <rniwa@webkit.org>
1192 Analysis tasks page complains about missing repository but with a wrong name
1193 https://bugs.webkit.org/show_bug.cgi?id=154468
1195 Reviewed by Chris Dumez.
1197 Fixed the bug by using the right variable in the template literal.
1199 * public/v3/components/customizable-test-group-form.js:
1200 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use querySelector here since Chrome doesn't have
1201 getElementsByClassName on ShadowRoot.
1202 * public/v3/pages/analysis-task-page.js:
1203 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Use name which is the name of
1206 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1208 Revert an unintended change made in the previous commit.
1210 * init-database.sql:
1212 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1214 Perf dashboard should let user cancel pending A/B testing and hide failed ones
1215 https://bugs.webkit.org/show_bug.cgi?id=154433
1217 Reviewed by Chris Dumez.
1219 Added a button to hide a test group in the details view (the bottom table) in the analysis task page, and
1220 "Show hidden tests" link to show the hidden test groups on demand. When a test group is hidden, all pending
1221 requests in the group will also be canceled since a common scenario of using this feature is that the user
1222 had triggered an useless A/B testing; e.g. all builds will fail, wrong, etc... We can revisit and add the
1223 capability to just cancel the pending requests and leaving the group visible later if necessary.
1225 Run `ALTER TYPE build_request_status_type ADD VALUE 'canceled';` to add the new type.
1227 * init-database.sql: Added testgroup_hidden column to analysis_test_groups table and added 'canceled'
1228 as a value to build_request_status_type table.
1229 * public/api/test-groups.php:
1230 (format_test_group): Added 'hidden' field in the JSON result.
1231 * public/privileged-api/update-test-group.php:
1232 (main): Added the support for updating testgroup_hidden column. When this column is set to true, also
1233 cancel all pending build requests (by setting its request_status to 'canceled' which will be ignore by
1234 the syncing script).
1235 * public/v3/components/test-group-results-table.js:
1236 (TestGroupResultsTable.prototype.setTestGroup): Reset _renderedTestGroup here so that the next call to
1237 render() will update the table; e.g. when build requests' status change from 'Pending' to 'Canceled'.
1238 * public/v3/models/build-request.js:
1239 (BuildRequest.prototype.hasCompleted): A build request is considered complete/finished if it's canceled.
1240 (BuildRequest.prototype.hasPending): Added.
1241 (BuildRequest.prototype.statusLabel): Handle 'canceled' status.
1242 * public/v3/models/test-group.js:
1244 (TestGroup.prototype.updateSingleton): Added to update 'hidden' field.
1245 (TestGroup.prototype.isHidden): Added.
1246 (TestGroup.prototype.hasPending): Added.
1247 (TestGroup.prototype.hasPending): Added.
1248 (TestGroup.prototype.updateHiddenFlag): Added. Uses the privileged API to update testgroup_hidden column.
1249 The JSON API also updates the status of the 'pending' build requests in the group to 'canceled'.
1250 * public/v3/pages/analysis-task-page.js:
1251 (AnalysisTaskPage): Added _showHiddenTestGroups and _filteredTestGroups as instance variables.
1252 (AnalysisTaskPage.prototype._didFetchTestGroups):
1253 (AnalysisTaskPage.prototype._showAllTestGroups): Added.
1254 (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState): Extracted from _didFetchTestGroups.
1255 (AnalysisTaskPage.prototype._renderTestGroupList): Use the filtered list of test groups to show the list
1256 of test groups. When all test groups are shown, we would first show the hidden ones after the regular ones.
1257 (AnalysisTaskPage.prototype._createTestGroupListItem): Extracted from _renderTestGroupList.
1258 (AnalysisTaskPage.prototype._renderTestGroupDetails): Update the text inside the button to hide the test
1259 group. Also show a warning text that the pending requests will be canceled if there are any.
1260 (AnalysisTaskPage.prototype._hideCurrentTestGroup): Added.
1261 (AnalysisTaskPage.cssTemplate): Updated the style.
1263 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1265 The rows in the analysis results table should be expandable
1266 https://bugs.webkit.org/show_bug.cgi?id=154427
1268 Reviewed by Chris Dumez.
1270 Added "(Expand)" link between rows that have hidden points. Upon click it inserts the hidden rows.
1272 We insert around five rows at a time when there are hundreds of hidden points but we also avoid leaving
1273 behind expandable rows of less than two rows.
1275 Also fixed a bug in CustomizableTestGroupForm that getElementsById would throw in the shipping Safari
1276 because getElementsById doesn't exist on Element.prototype by using class name instead.
1278 * public/v3/components/analysis-results-viewer.js:
1279 (AnalysisResultsViewer):
1280 (AnalysisResultsViewer.prototype.setCurrentTestGroup): Removed superfluous call to render().
1281 (AnalysisResultsViewer.prototype.setPoints): Always show the start and the end points.
1282 (AnalysisResultsViewer.prototype.buildRowGroups):
1283 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Add an instance of ExpandableRow which
1284 shows a "(Expand)" link to show hidden rows here.
1285 (AnalysisResultsViewer.prototype._expandBetween): Added. Expands rows between two points.
1286 (AnalysisResultsViewer.cssTemplate): Added rules for "(Expand)" links.
1287 (AnalysisResultsViewer.ExpandableRow): Added.
1288 (AnalysisResultsViewer.ExpandableRow.prototype.resultContent): Added. Overrides what's in the results column.
1289 (AnalysisResultsViewer.ExpandableRow.prototype.heading): Added. Generates "(Expand)" link.
1291 * public/v3/components/customizable-test-group-form.js:
1292 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use getElementsByClassName instead of
1294 (CustomizableTestGroupForm.prototype._classForLabelAndRepository): Renamed from _idForLabelAndRepository.
1295 (CustomizableTestGroupForm._constructRevisionRadioButtons): Set class name instead of id.
1297 * public/v3/components/results-table.js:
1298 (ResultsTable.prototype.render): Don't generate radio buttons to select a row when root set is missing;
1299 e.g. for rows that show "(Expand)" links.
1301 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1303 Statistically significant A/B testing results should be color coded in details view
1304 https://bugs.webkit.org/show_bug.cgi?id=154414
1306 Reviewed by Chris Dumez.
1308 Color code the statistically significant comparisions in TestGroupResultsTable as done in the analysis
1311 * public/v3/components/customizable-test-group-form.js:
1312 (CustomizableTestGroupForm.cssTemplate): Build fix after r196768.
1313 * public/v3/components/test-group-results-table.js:
1314 (TestGroupResultsTable.prototype.buildRowGroups): Add the status as a class name.
1315 (TestGroupResultsTable.cssTemplate): Added styles to color-code statistically significant results.
1317 2016-02-17 Ryosuke Niwa <rniwa@webkit.org>
1319 v3 UI should allow custom revisions for A/B testing
1320 https://bugs.webkit.org/show_bug.cgi?id=154379
1322 Reviewed by Chris Dumez.
1324 Added the capability to customize revisions selected in the overview chart and the results viewer.
1326 Newly added CustomizableTestGroupForm is responsible for allowing users to modify the set of revisions in
1327 a new A/B testing group. Unlike TestGroupForm which doesn't know anything about which revisions are selected
1328 for each project/repository, CustomizableTestGroupForm is aware of the list of revisions used in each set.
1330 The list of revisions used in each set is represented by RootSet if users had not customized them, and
1331 CustomRootSet otherwise; the latter was added since regular RootSet object requires CommitLog and other
1332 DataModelObjects which are hard to create without corresponding database entries.
1334 * public/v3/components/customizable-test-group-form.js: Added.
1335 (CustomizableTestGroupForm): Added.
1336 (CustomizableTestGroupForm.prototype.setRootSetMap): Added.
1337 (CustomizableTestGroupForm.prototype._submitted): Overrides the superclass' method.
1338 (CustomizableTestGroupForm.prototype._customize): Ditto. Unlike TestGroupForm's callback, this class'
1339 callback passes in a root set map as the third argument.
1340 (CustomizableTestGroupForm.prototype._computeRootSetMap): Added. Returns this._rootSetMap, which is set by
1341 AnalysisTaskPage if user had not customized the root sets. Otherwise return a new map with CustomRootSet's.
1342 (CustomizableTestGroupForm.prototype.render): Added. Creates a table to allow customization of root sets.
1343 (CustomizableTestGroupForm._constructRevisionRadioButtons): Added.
1344 (CustomizableTestGroupForm._createRadioButton): Added.
1345 (CustomizableTestGroupForm.cssTemplate): Added.
1346 (CustomizableTestGroupForm.formContent): Added. This method is called by TestGroupForm.htmlTemplate.
1347 * public/v3/components/test-group-form.js:
1348 (TestGroupForm): Updated the various methods to not directly mutate DOM. Store the state in instance
1349 variables and update DOM in render() as done elsewhere.
1350 (TestGroupForm.prototype.setNeedsName): Deleted. We no longer need this flag since TestGroupForm which is
1351 used for retries never needs a name and CustomizableTestGroupForm which is used to create a new test group
1352 always requires a name.
1353 (TestGroupForm.prototype.setDisabled):
1354 (TestGroupForm.prototype.setLabel):
1355 (TestGroupForm.prototype.setRepetitionCount):
1356 (TestGroupForm.prototype.render): Added.
1357 (TestGroupForm.prototype._submitted): Moved the code to prevent the default action has been moved to the
1358 constructor since this method is overridden by CustomizableTestGroupForm.
1359 (TestGroupForm.cssTemplate): Added.
1360 (TestGroupForm.htmlTemplate):
1361 (TestGroupForm.formContent): Extracted from htmlTemplate.
1362 * public/v3/index.html:
1363 * public/v3/models/repository.js:
1364 (Repository.sortByNamePreferringOnesWithURL): Added.
1365 * public/v3/models/root-set.js:
1366 (RootSet.prototype.revisionForRepository): Added so that _createTestGroupAfterVerifyingRootSetList can retrieve
1367 the revision information from CustomRootSet without going through CommitLog objects since CustomRootSet doesn't
1368 have associated CommitLog objects.
1369 (CustomRootSet): Added. Used by CustomizableTestGroupForm to create a custom root map since regular RootSet
1370 requires CommitLog and other related objects which are hard to create without database entries.
1371 (CustomRootSet.prototype.setRevisionForRepository): Added.
1372 (CustomRootSet.prototype.repositories): Added.
1373 (CustomRootSet.prototype.revisionForRepository): Added.
1374 * public/v3/pages/analysis-task-page.js:
1376 (AnalysisTaskPage.prototype.render): Removed the reference to v2 UI since v3 UI is now strictly more powerful
1377 than v2 UI. Also update the root set maps in each form here.
1378 (AnalysisTaskPage.prototype._retryCurrentTestGroup): No longer takes unused name argument as it got removed
1380 (AnalysisTaskPage.prototype._chartSelectionDidChange): No longer updates the disabled-ness here since it's now
1381 done in render() via setRootSetMap().
1382 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Now takes rootSetMap as an argument.
1383 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): No longer updates the disabled-ness here
1384 since it's now done in render() via setRootSetMap().
1385 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Now takes rootSetMap as an argument.
1386 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Take a dictionary of root set labels
1387 such as A and B, which maps to a RootSet or a newly-added CustomRootSet.
1388 (AnalysisTaskPage.htmlTemplate): Use customizable-test-group-form for creating a new A/B testing group. Retry
1389 form will continue to use TestGroupForm since customizing revisions is non-sensical in retries.
1390 (AnalysisTaskPage.cssTemplate): Updated the style.
1392 2016-02-16 Ryosuke Niwa <rniwa@webkit.org>
1394 v3 UI has the capability to schedule an A/B testing in a specific range
1395 https://bugs.webkit.org/show_bug.cgi?id=154329
1397 Reviewed by Chris Dumez.
1399 Extended AnalysisTaskChartPane and ResultsTable so that users can select a range of points in either
1400 the overview chart pane and the results viewer table. Extracted TestGroupForm out of the analysis task
1401 page and used right below those two components in the analysis task page.
1403 * public/v3/components/results-table.js:
1405 (ResultsTable.prototype.setRangeSelectorLabels): Added.
1406 (ResultsTable.prototype.setRangeSelectorCallback): Added.
1407 (ResultsTable.prototype.selectedRange): Added.
1408 (ResultsTable.prototype._rangeSelectorClicked): Added.
1409 (ResultsTable.prototype.render): Generate radio boxes to select a range.
1411 * public/v3/components/test-group-form.js:
1413 (TestGroupForm.prototype.setStartCallback): Added.
1414 (TestGroupForm.prototype.setNeedsName): Added.
1415 (TestGroupForm.prototype.setDisabled): Added.
1416 (TestGroupForm.prototype.setLabel): Added.
1417 (TestGroupForm.prototype.setRepetitionCount): Added.
1418 (TestGroupForm.prototype._submitted): Added.
1419 (TestGroupForm.htmlTemplate): Extracted from AnalysisTaskPage.htmlTemplate.
1421 * public/v3/index.html:
1423 * public/v3/pages/analysis-task-page.js:
1424 (AnalysisTaskChartPane.prototype._mainSelectionDidChange): Added. Delegates the work to AnalysisTaskPage.
1425 (AnalysisTaskChartPane.prototype.selectedPoints): Added.
1427 (AnalysisTaskPage.prototype.title):
1428 (AnalysisTaskPage.prototype.render):
1429 (AnalysisTaskPage.prototype._renderTestGroupDetails): Use TestGroupForm's methods instead of mutating DOM.
1430 (AnalysisTaskPage.prototype._retryCurrentTestGroup):
1431 (AnalysisTaskPage.prototype._chartSelectionDidChange): Added.
1432 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Added.
1433 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Added.
1434 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Added.
1435 (AnalysisTaskPage.prototype._createRetryNameForTestGroup):
1436 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Extracted from _retryCurrentTestGroup
1437 so that we can call it in _createNewTestGroupFromChart and _createNewTestGroupFromViewer.
1438 (AnalysisTaskPage.htmlTemplate):
1440 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1442 Extract the code specific to v2 UI out of shared statistics.js
1443 https://bugs.webkit.org/show_bug.cgi?id=154277
1445 Reviewed by Chris Dumez.
1447 Extracted statistics-strategies.js out of statistics.js for v2 UI and detect-changes.js. The intent is to
1448 deprecate this file once we implement refined statistics tools in v3 UI and adopt it in detect-changes.js.
1450 * public/shared/statistics.js:
1451 (Statistics.movingAverage): Extracted from the "Simple Moving Average" strategy.
1452 (Statistics.cumultaiveMovingAverage): Extracted from the "Cumulative Moving Average" strategy.
1453 (Statistics.exponentialMovingAverage): Extracted from the "Exponential Moving Average" strategy.
1454 Use a temporary "movingAverage" to keep the last moving average instead of relying on the previous
1455 entry in "averages" array to avoid special casing an array of length 1 and starting the loop at i = 1.
1456 (Statistics.segmentTimeSeriesGreedyWithStudentsTTest): Extracted from "Segmentation: Recursive t-test"
1457 strategy. Don't create the list of averages to match segmentTimeSeriesByMaximizingSchwarzCriterion here.
1458 It's done in newly added averagesFromSegments.
1459 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Extracted from
1460 "Segmentation: Schwarz criterion" strategy.
1461 (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Just store the start index to match
1463 (App.Pane.updateStatisticsTools):
1464 (App.Pane._computeMovingAverageAndOutliers):
1465 * public/v2/data.js:
1466 * public/v2/index.html:
1467 * public/v2/statistics-strategies.js: Added.
1468 (StatisticsStrategies.MovingAverageStrategies): Added.
1469 (averagesFromSegments): Extracted from "Segmentation: Schwarz criterion" strategy. Now used by both
1470 "Segmentation: Recursive t-test" and "Segmentation: Schwarz criterion" strategies.
1471 (StatisticsStrategies.EnvelopingStrategies): Moved from Statistics.EnvelopingStrategies.
1472 (StatisticsStrategies.TestRangeSelectionStrategies): Moved from Statistics.TestRangeSelectionStrategies.
1473 (createWesternElectricRule): Moved from statistics.js.
1474 (countValuesOnSameSide): Ditto.
1475 (StatisticsStrategies.executeStrategy): Moved from Statistics.executeStrategy.
1476 * tools/detect-changes.js:
1477 (computeRangesForTesting):
1479 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1481 v1 UI and v2 UI should share statistics.js
1482 https://bugs.webkit.org/show_bug.cgi?id=154262
1484 Reviewed by Chris Dumez.
1486 Share statistics.js between v1 and v2 UI.
1488 * public/index.html:
1489 * public/js/shared.js: Deleted.
1490 * public/js/statistics.js: Removed.
1491 * public/shared: Added.
1492 * public/shared/statistics.js: Moved from Websites/perf.webkit.org/public/v2/js/statistics.js.
1493 * public/v2/index.html:
1494 * public/v2/js/statistics.js: Removed.
1495 * public/v3/index.html:
1496 * tools/detect-changes.js:
1498 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1500 v3 UI sometimes shows same dates twice on the x-axis of time series charts
1501 https://bugs.webkit.org/show_bug.cgi?id=154210
1503 Reviewed by Chris Dumez.
1505 The bug was caused by the label generation code in TimeSeriesChart.computeTimeGrid never emitting hours.
1507 Use hours instead of dates as labels when the current time's date is same as the previous label's date.
1508 Always include dates before entering this mode to avoid just having hours as labels on the entire x-axis.
1510 * public/v3/components/time-series-chart.js:
1511 (TimeSeriesChart.prototype._renderXAxis): Slightly increase the "average" width of x-axis label.
1512 (TimeSeriesChart.computeTimeGrid): See above. Also assert that the number of labels we generate never
1513 exceeds maxLabels as a sanity check.
1514 (TimeSeriesChart._timeIterators): Added an iterator that increments by two hours for zoomed graphs.
1516 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1518 v3 UI should show status and associated bugs on analysis task pages
1519 https://bugs.webkit.org/show_bug.cgi?id=154212
1521 Reviewed by Chris Dumez.
1523 Added the capability to see and modify the status and the list of associated of bugs on analysis task pages.
1525 Also added the list of related tasks, which are analysis tasks associated with the same bug or have
1526 overlapping time ranges with the same test metric but on a potentially different platform.
1528 In addition, categorize analysis tasks with the status of "no change" or "inconclusive" as "closed" as no
1529 further action can be taken (users can bring them back to non-closed state without any restrictions).
1531 * public/api/analysis-tasks.php:
1532 (format_task): Categorize 'unchanged' and 'inconclusive' analysis tasks as closed.
1534 * public/privileged-api/associate-bug.php:
1535 (main): Added shouldDelete as a new mechanism to disassociate a bug since v3 UI shares a single Bug object
1536 between multiple analysis tasks (as it should have been in the first place).
1538 * public/v3/components/chart-pane-base.js:
1540 (ChartPaneBase.prototype._fetchAnalysisTasks): Since each analysis task's change type (status/result) could
1541 change, we need to create annotation objects during each render() call.
1542 (ChartPaneBase.prototype.render):
1543 (ChartPaneBase.prototype._renderAnnotations): Extracted from ChartPaneBase.prototype._fetchAnalysisTasks to
1544 do that. I was afraid of the perf impact of this but it doesn't seem to be an issue in my testing.
1545 (ChartPaneBase.cssTemplate): Removed superfluous margins (moved to ChartPane.cssTemplate) around the charts
1546 since they are only useful in the charts page.
1548 * public/v3/models/analysis-task.js:
1550 (AnalysisTask.prototype.updateSingleton): Added a comment as to why object.result cannot be renamed to
1551 object.changeType in the JSON API.
1552 (AnalysisTask.prototype.updateName): Added.
1553 (AnalysisTask.prototype.updateChangeType): Added.
1554 (AnalysisTask.prototype._updateRemoteState): Added.
1555 (AnalysisTask.prototype.associateBug): Added.
1556 (AnalysisTask.prototype.disassociateBug): Added.
1557 (AnalysisTask.fetchRelatedTasks): Added. See above for the criteria of related-ness.
1559 * public/v3/pages/analysis-task-page.js:
1561 (AnalysisTaskPage.prototype.updateFromSerializedState):
1562 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): Extracted from updateFromSerializedState.
1563 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks): Added.
1564 (AnalysisTaskPage.prototype.render): Render the list of associated bugs, the list of bug trackers (so that
1565 users can use it to associate with a new bug), and the list of related analysis tasks.
1566 (AnalysisTaskPage.prototype._renderTestGroupList): Extracted from render since it was getting too long.
1567 (AnalysisTaskPage.prototype._renderTestGroupDetails): Ditto.
1568 (AnalysisTaskPage.prototype._updateChangeType): Added.
1569 (AnalysisTaskPage.prototype._associateBug): Added.
1570 (AnalysisTaskPage.prototype._disassociateBug): Added.
1571 (AnalysisTaskPage.htmlTemplate): Added various elements to show and modify the status, associate bugs,
1572 and a list of related analysis tasks.
1573 (AnalysisTaskPage.cssTemplate): Added various styles for those form controls.
1575 * public/v3/pages/chart-pane.js:
1576 (ChartPane.cssTemplate): Moved the margins from ChartPaneBase.cssTemplate.
1578 2016-02-12 Ryosuke Niwa <rniwa@webkit.org>
1580 Perf dashboard should allow renaming analysis tasks and test groups
1581 https://bugs.webkit.org/show_bug.cgi?id=154200
1583 Reviewed by Chris Dumez.
1585 Allow editing names of analysis tasks and A/B testing groups in the v3 UI.
1587 Added the support for updating the name to the privileged API at /privileged-api/update-analysis-task
1588 and added a new prevailed API to update A/B testing groups at /privileged-api/update-test-group.
1590 * public/privileged-api/update-analysis-task.php: Added the support for renaming the analysis task.
1593 * public/privileged-api/update-test-group.php: Added. Supports updating the test group's name.
1596 * public/v3/components/editable-text.js: Added.
1597 (EditableText): Added. A new editable text label control. It looks like a text node with "(Edit)" link
1598 at the end which allow users to go into the "editing mode", which reveals an input element.
1599 The user can exit the editing mode by either moving the focus away from the control or clicking on
1600 "(Save)" at the end. It calls _updateCallback in the latter case.
1601 (EditableText.prototype.editedText): Returns the current value of the input element user.
1602 (EditableText.prototype.setText): Sets the label. This does not live-update the input element until
1603 the user exists the current editing mode and re-enters it.
1604 (EditableText.prototype.setStartedEditingCallback): Sets a callback which gets called when the user
1605 requested to enter the editing mode. Since EditableText relies on AnalysisTaskPage to render, this
1606 callback only exits to call EditableText.render() in AnalysisTask._didStartEditingTaskName.
1607 (EditableText.prototype.setUpdateCallback): Sets a callback which gets called when the user exits
1608 the editing mode by activating the "(Save)" link. This callback MUST return a promise upon resolution
1609 of which the control gets out of the editing mode. While the promise is in flight, the input element
1611 (EditableText.prototype.render): Updates various states of the elements. When _updatingPromise is not
1612 falsy, we make the input element readonly and show '(...)' on the link. Don't show the action link
1613 if the label is empty (e.g. analysis task or test group is still being fetched).
1614 (EditableText.prototype._didClick): Called when the user clicked on the action link. Enter the editing
1615 mode or save the edited label via _updateCallback.
1616 (EditableText.prototype._didBlur): Exit the editing mode without saving if the input element is not
1617 focused, there is no inflight promise returned by _updateCallback, and the action link "(Save)" does
1619 (EditableText.prototype._didUpdate): Called when exiting the editing mode.
1620 (EditableText.htmlTemplate):
1621 (EditableText.cssTemplate):
1623 * public/v3/index.html: Include newly added editable-text.js.
1625 * public/v3/models/analysis-task.js:
1626 (AnalysisTask.prototype.updateSingleton): Added.
1627 (AnalysisTask.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1628 the analysis task from the sever.
1629 (AnalysisTask._constructAnalysisTasksFromRawData): Use ensureSingleton instead of manually calling
1630 findById since we need to update the name of the singleton object we found (via updateSingleton).
1632 * public/v3/models/bug.js:
1633 (Bug.ensureSingleton): Moved the code to compute the synthetic id from AnalysisTask's
1634 _constructAnalysisTasksFromRawData.
1635 (Bug.prototype.updateSingleton): Added. Just assert that nothing changes.
1637 * public/v3/models/build-request.js:
1638 (BuildRequest.prototype.updateSingleton): Added. Assert that the intrinsic values of a build request
1639 doesn't change and update status text, status url, and build id as they could change.
1641 * public/v3/models/commit-log.js:
1642 (CommitLog): Made the constructor argument conform to the convention of id, object pair so that we can
1643 use DataModelObject.ensureSingleton.
1644 (CommitLog.ensureSingleton):
1645 (CommitLog.prototype.updateSingleton): Extracted from CommitLog.ensureSingleton.
1647 * public/v3/models/data-model.js:
1648 (DataModelObject.ensureSingleton): Call newly added updateSingleton.
1649 (DataModelObject.prototype.updateSingleton):
1650 (LabeledObject): Removed the name map since it's never used (findByName is never called anywhere).
1651 (LabeledObject.prototype.updateSingleton): Added. Updates _name.
1652 (LabeledObject.findByName): Deleted.
1654 * public/v3/models/test-group.js:
1655 (TestGroup.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1656 the test group from the sever.
1657 (TestGroup._createModelsFromFetchedTestGroups): Removed bogus code. A root set doesn't have a test
1658 group associated with it since multiple test groups can share a single root set (this property doesn't
1661 * public/v3/pages/analysis-task-page.js:
1662 (AnalysisTaskPage): Removed useless _taskId and added this._testGroupLabelMap and this._taskNameLabel.
1663 (AnalysisTaskPage.prototype.updateFromSerializedState): Cleanup.
1664 (AnalysisTaskPage.prototype._didFetchTask): Assert that this function is called exactly once.
1665 (AnalysisTaskPage.prototype.render): Use this._task.id() to show the v2 link. Use EditableText to show
1666 the names of the analysis task and the associated test groups. Hide the overview chart and the list of
1667 test groups (along with the retry/confirm button) when the analysis task failed to fetch. We always
1668 update the names of the analysis task and the associated test groups since they could be updated by
1670 (AnalysisTaskPage.prototype._didStartEditingTaskName): Added.
1671 (AnalysisTaskPage.prototype._updateTaskName): Added.
1672 (AnalysisTaskPage.prototype._updateTestGroupName): Added.
1673 (AnalysisTaskPage.htmlTemplate): Updated the style.
1675 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1677 Land the change that was supposed to be the part of r196463.
1679 * public/v3/pages/analysis-task-page.js:
1680 (AnalysisTaskPage.prototype._didFetchTestGroups): Select the latest test group by default.
1682 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1684 Refine v3 UI's analysis task page
1685 https://bugs.webkit.org/show_bug.cgi?id=154152
1687 Reviewed by Chris Dumez.
1689 This patch makes the following refinements to the analysis task page:
1690 - Always show the relative different of in-progress A/B testing.
1691 - Make the annotations (colored bars) in the chart open other analysis tasks.
1692 - Order the A/B testing groups in the reverse chronological order.
1693 - Select the time range corresponding to the current test group.
1695 * public/v3/components/analysis-results-viewer.js:
1696 (AnalysisResultsViewer.cssTemplate): Fixed the bug that pending and running testing groups are no longer
1697 colored after r196440. Use a slightly more opaque color for currently running groups compared to pending ones.
1699 * public/v3/components/chart-pane-base.js:
1700 (ChartPaneBase.prototype.setMainSelection): Added.
1701 (ChartPaneBase.prototype._openAnalysisTask): Moved the code from ChartPane._openAnalysisTask so that it can be
1702 reused in both AnalysisTaskChartPane and ChartPane (in charts page).
1703 (ChartPaneBase.prototype.router): Added. Overridden by each subclass.
1705 * public/v3/components/test-group-results-table.js:
1706 (TestGroupResultsTable.prototype.buildRowGroups): Always show the summary (relative difference of A to B) as
1707 long as there are some results in each set.
1709 * public/v3/models/test-group.js:
1710 (TestGroup.prototype.compareTestResults): Always set .label and .fullLabel with the relative change as long as
1711 there are some values. Keep using "pending" and "running" in .status since that would determine the color of
1712 stacking blocks representing those A/B testing groups.
1714 * public/v3/pages/analysis-task-page.js:
1715 (AnalysisTaskChartPane):
1716 (AnalysisTaskChartPane.prototype.setPage): Added.
1717 (AnalysisTaskChartPane.prototype.router): Added.
1719 (AnalysisTaskPage.prototype.render): Show the list of A/B testing groups in the reverse chronological order.
1720 Also set the main chart's selection to the time range of the current test group.
1722 * public/v3/pages/chart-pane.js:
1723 (ChartPane.prototype.router): Added.
1724 (ChartPane.prototype._openAnalysisTask): Moved to ChartPaneBase.prototype._openAnalysisTask.
1726 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1728 Add a script to process backlogs created while perf dashboard was in the maintenance mode
1729 https://bugs.webkit.org/show_bug.cgi?id=154140
1731 Reviewed by Chris Dumez.
1733 Added a script to process the backlog JSONs created while the perf dashboard was put in the maintenance mode.
1734 It re-submits each JSON file to the perf dashboard using the same server config file used by syncing scripts.
1736 * public/include/report-processor.php:
1737 (TestRunsGenerator::test_value_list_to_values_by_iterations): Fixed a bug in the error message code. It was
1738 referencing an undeclared variable.
1739 * tools/process-maintenance-backlog.py: Added.
1741 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1743 AnalysisResultsViewer never uses this._smallerIsBetter
1744 https://bugs.webkit.org/show_bug.cgi?id=154134
1746 Reviewed by Chris Dumez.
1748 Removed the unused instance variable _smallerIsBetter from AnalysisResultsViewer and TestGroupStackingBlock.
1750 * public/v3/components/analysis-results-viewer.js:
1751 (AnalysisResultsViewer): Removed the unused _smallerIsBetter.
1752 (AnalysisResultsViewer.prototype.setSmallerIsBetter): Deleted.
1753 (AnalysisResultsViewer.prototype.buildRowGroups):
1754 (AnalysisResultsViewer.TestGroupStackingBlock): Removed the unused _smallerIsBetter.
1755 * public/v3/pages/analysis-task-page.js:
1756 (AnalysisTaskPage.prototype._didFetchTask):
1758 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1760 Build fix after r196440.
1762 * public/v3/models/test-group.js:
1763 (TestGroup.prototype.addBuildRequest): Clear the map instead of setting the property to null.
1765 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
1767 Perf dashboard should have UI to retry A/B testing
1768 https://bugs.webkit.org/show_bug.cgi?id=154090
1770 Reviewed by Chris Dumez.
1772 Added a button to re-try an existing A/B testing group with a custom repetition count. The same button functions
1773 as a way of confirming the progression/regression when there have been no A/B testing scheduled in the task.
1775 Also fixed the bug that A/B testing groups that have been waiting for other test groups will be shown as "running".
1777 * public/v3/components/results-table.js:
1778 (ResultsTable.cssTemplate): Don't pad the list of extra repositories when it's empty.
1780 * public/v3/components/test-group-results-table.js:
1781 (TestGroupResultsTable.prototype.buildRowGroups): Use TestGroup.labelForRootSet instead of manually
1782 computing the letter for each configuration set.
1784 * public/v3/models/build-request.js:
1785 (BuildRequest.prototype.hasStarted): Added.
1787 * public/v3/models/data-model.js:
1788 (DataModelObject.ensureSingleton): Added.
1789 (DataModelObject.cachedFetch): Added noCache option. This is used when re-fetching the test groups after
1792 * public/v3/models/measurement-cluster.js:
1793 (MeasurementCluster.prototype.startTime): Added.
1795 * public/v3/models/measurement-set.js:
1796 (MeasurementSet.prototype.hasFetchedRange): Added. Returns true only if there are no "holes" (cluster
1797 yet to be fetched) between the specified time range. This was added to fix a bug in AnalysisTaskPage's
1798 _didFetchMeasurement.
1800 * public/v3/models/test-group.js:
1801 (TestGroup): Added this._rootSetToLabel.
1802 (TestGroup.prototype.addBuildRequest): Reset this._rootSetToLabel along with this._requestedRootSets.
1803 (TestGroup.prototype.repetitionCount): Added. Returns the number of iterations executed per set. We assume that
1804 every root set in the test group shares a single repetition count.
1805 (TestGroup.prototype.requestedRootSets): Now populates this._rootSetToLabel for labelForRootSet.
1806 (TestGroup.prototype.labelForRootSet): Added.
1807 (TestGroup.prototype.hasStarted): Added.
1808 (TestGroup.prototype.compareTestResults): Use 'running' and 'pending' to differentiate test groups that are waiting
1809 for other groups to finish running from the ones that are actually running ('incomplete' before this patch).
1810 (TestGroup.fetchByTask):
1811 (TestGroup.createAndRefetchTestGroups): Added. Creates a new test group using the privileged-api/create-test-group
1812 and fetches the list of test groups for the specified analysis task.
1813 (TestGroup._createModelsFromFetchedTestGroups): Extracted from TestGroup.fetchByTask.
1815 * public/v3/pages/analysis-task-page.js:
1816 (AnalysisTaskPage): Initialize _renderedCurrentTestGroup to undefined so that we'd always can differentiate
1817 the initial call to AnalysisTaskPage.render and subsequent calls in which it's identical to _currentTestGroup.
1818 (AnalysisTaskPage.prototype._didFetchMeasurement): Fixed a bug that we don't exit early even when some
1819 clusters in between startPoint and endPoint are still being fetched via newly added hasFetchedRange.
1820 (AnalysisTaskPage.prototype.render): Update the default repetition count based on the current test group.
1821 Also update the label of the button to "Confirm the change" if there is no A/B testing in this task.
1822 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Added. Re-triggers an existing A/B testing group or creates
1823 the A/B testing for the entire range of the analysis task.
1824 (AnalysisTaskPage.prototype._hasDuplicateTestGroupName): Added.
1825 (AnalysisTaskPage.prototype._createRetryNameForTestGroup): Added.
1826 (AnalysisTaskPage.htmlTemplate): Added form controls to re-trigger A/B testing.
1827 (AnalysisTaskPage.cssTemplate): Updated the style.
1829 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
1831 Removed the duplicated definition of ChartPaneBase.
1833 * public/v3/components/chart-pane-base.js:
1835 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
1837 Analysis task page on v3 UI should show charts
1838 https://bugs.webkit.org/show_bug.cgi?id=154057
1840 Reviewed by Chris Dumez.
1842 Extracted ChartPaneBase out of ChartPane and added an instance of its new subclass, AnalysisTaskChartPane,
1843 to the analysis task page. The main difference is that ChartPaneBase doesn't depend on the presence of
1844 this._chartsPage unlike ChartPane. It also doesn't have the header with toolbar (to show breakdown, etc...).
1846 * public/v3/components/base.js:
1847 (ComponentBase.prototype._constructShadowTree): Call htmlTemplate() and cssTemplate() with the right "this".
1849 * public/v3/components/chart-pane-base.js: Added.
1850 (ChartPaneBase): Extracted from ChartPane.
1851 (ChartPaneBase.prototype.configure): Extracted from the constructor. Separating this function allows the
1852 component to be instantiated inside a HTML template.
1853 (ChartPaneBase.prototype._fetchAnalysisTasks): Moved from ChartPane._fetchAnalysisTasks.
1854 (ChartPaneBase.prototype.platformId): Ditto.
1855 (ChartPaneBase.prototype.metricId): Ditto.
1856 (ChartPaneBase.prototype.setOverviewDomain): Ditto.
1857 (ChartPaneBase.prototype.setMainDomain): Ditto.
1858 (ChartPaneBase.prototype._overviewSelectionDidChange): Extracted from the constructor. This is overridden in
1859 ChartPane and unused in AnalysisTaskChartPane.
1860 (ChartPaneBase.prototype._mainSelectionDidChange): Extracted from ChartPane._mainSelectionDidChange.
1861 (ChartPaneBase.prototype._mainSelectionDidZoom): Extracted from ChartPane._mainSelectionDidZoom.
1862 (ChartPaneBase.prototype._indicatorDidChange): Extracted from ChartPane._indicatorDidChange.
1863 (ChartPaneBase.prototype._didFetchData): Moved from ChartPane._fetchAnalysisTasks.
1864 (ChartPaneBase.prototype._openAnalysisTask): Ditto.
1865 (ChartPaneBase.prototype._openCommitViewer): Ditto. Also fixed a bug that we don't show the spinner while
1866 waiting for the data to be fetched by calling this.render() here.
1867 (ChartPaneBase.prototype._keyup): Moved from ChartPane._keyup. Also fixed the bug that the revisions list
1868 doesn't update by calling this.render() here.
1869 (ChartPaneBase.prototype.render): Extracted from ChartPane.render.
1870 (ChartPaneBase.htmlTemplate): Extracted from ChartPane.htmlTemplate.
1871 (ChartPaneBase.paneHeaderTemplate): Added. This is overridden in ChartPane and unused in AnalysisTaskChartPane.
1872 (ChartPaneBase.cssTemplate): Extracted from ChartPane.htmlTemplate.
1874 * public/v3/components/chart-styles.js: Renamed from public/v3/pages/page-with-charts.js.
1875 (PageWithCharts): Renamed from PageWithCharts since it no longer extends PageWithHeading.
1876 (ChartStyles.createChartSourceList):
1878 * public/v3/components/commit-log-viewer.js:
1879 (CommitLogViewer.prototype.view): Set this._repository right away instead of waiting for the fetched data
1880 so that spinner will be shown while the data is being fetched.
1882 * public/v3/index.html:
1884 * public/v3/pages/analysis-task-page.js:
1885 (AnalysisTaskChartPane): Added extends ChartPaneBase.
1886 (AnalysisTaskPage): Added. this._chartPane.
1887 (AnalysisTaskPage.prototype._didFetchTask): Initialize this._chartPane with a domain.
1888 (AnalysisTaskPage.prototype.render): Render this._chartPane.
1889 (AnalysisTaskPage.htmlTemplate):
1891 * public/v3/pages/chart-pane-status-view.js:
1892 (ChartPaneStatusView): Removed the unused router from the argument list.
1893 (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Renamed from analyzeData() since it was ambiguous.
1894 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Fixed the bug that we don't update the list
1895 of the revisions here.
1896 (ChartPaneStatusView.prototype.computeChartStatusLabels):
1898 * public/v3/pages/chart-pane.js:
1899 (ChartPane): Now extends ChartPaneBase.
1900 (ChartPane.prototype._overviewSelectionDidChange): Extracted from the constructor.
1901 (ChartPane.prototype._mainSelectionDidChange):
1902 (ChartPane.prototype._mainSelectionDidZoom):
1903 (ChartPane.prototype._indicatorDidChange):
1904 (ChartPane.prototype.render):
1905 (ChartPane.prototype._renderActionToolbar):
1906 (ChartPane.paneHeaderTemplate): Extracted from htmlTemplate.
1907 (ChartPane.cssTemplate):
1908 (ChartPane.overviewOptions.selection.onchange): Deleted.
1909 (ChartPane.prototype._fetchAnalysisTasks): Deleted.
1910 (ChartPane.prototype.platformId): Deleted.
1911 (ChartPane.prototype.metricId): Deleted.
1912 (ChartPane.prototype.setOverviewDomain): Deleted.
1913 (ChartPane.prototype.setMainDomain): Deleted.
1914 (ChartPane.prototype._openCommitViewer): Deleted.
1915 (ChartPane.prototype._didFetchData): Deleted.
1916 (ChartPane.prototype._keyup): Deleted.
1918 * public/v3/pages/charts-page.js:
1920 (ChartsPage.createDomainForAnalysisTask): Extracted by createDomainForAnalysisTask; used to set the domain
1921 of the charts in the analysis task page.
1922 (ChartsPage.createStateForAnalysisTask):
1924 * public/v3/pages/dashboard-page.js:
1926 (DashboardPage.prototype._createChartForCell):
1928 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
1930 Add the support for maintenance mode
1931 https://bugs.webkit.org/show_bug.cgi?id=154072
1933 Reviewed by Chris Dumez.
1935 Added the crude support for maintenance mode whereby which the reports are stored in the filesystem
1936 instead of the database.
1938 * config.json: Added maintenanceMode and maintenanceDirectory as well as forgotten siteTitle and
1939 remoteServer.httpdMutexDir.
1940 * public/api/report.php:
1941 (main): Don't connect to the database or modify database when maintenanceMode is set.
1942 * public/include/json-header.php:
1943 (ensure_privileged_api_data): Exit with InMaintenanceMode when maintenanceMode is set. This prevents
1944 privileged API such as creating analysis tasks and new A/B testing groups from modifying the database.
1946 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
1948 Analysis task page on v3 show progression as regressions
1949 https://bugs.webkit.org/show_bug.cgi?id=154045
1951 Reviewed by Chris Dumez.
1953 The bug was caused by TestGroup.compareTestResults referring to undefined _smallerIsBetter.
1954 Retrieve it from the associated metric object via the owner analysis task.
1956 * public/v3/models/test-group.js:
1958 2016-02-05 Ryosuke Niwa <rniwa@webkit.org>
1960 Testing with remote server cache is unusably slow
1961 https://bugs.webkit.org/show_bug.cgi?id=153928
1963 Reviewed by Chris Dumez.
1965 Don't use the single process mode of httpd as it's way too slow even for testing.
1966 Also we'll hit a null pointer crash (http://svn.apache.org/viewvc?view=revision&revision=1711479)
1968 Since httpd exits immediately when launched in multi-process mode, remote-cache-server.py (renamed from
1969 run-with-remote-server.py) now has "start" and "stop" commands to start/stop the Apache. Also added
1970 "reset" command to reset the cache for convenience.
1972 * Install.md: Updated the instruction.
1973 * config.json: Fixed a typo: httpdErro*r*Log.
1974 * tools/remote-cache-server.py: Copied from Websites/perf.webkit.org/tools/run-with-remote-server.py.
1975 Now takes one of the following commands: "start", "stop", and "reset".
1977 (start_httpd): Extracted from main.
1978 (stop_httpd): Added.
1979 * tools/remote-server-relay.conf: Removed redundant (duplicate) LoadModule's.
1980 * tools/run-with-remote-server.py: Removed.
1982 2016-02-04 Ryosuke Niwa <rniwa@webkit.org>
1984 Perf dashboard should have a script to setup database
1985 https://bugs.webkit.org/show_bug.cgi?id=153906
1987 Reviewed by Chris Dumez.
1989 Added tools/setup-database.py to setup the database. It retrieves the database name, username, password
1990 and initializes a database at the specified location.
1992 * Install.md: Updated instruction to setup postgres to use setup-database.py.
1993 * tools/setup-database.py: Added.
1995 (load_database_config):
1996 (determine_psql_dir):
1997 (start_or_stop_database):
1998 (execute_psql_command):
2000 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2002 buildbot syncing scripts sometimes schedule more than one requests per builder
2003 https://bugs.webkit.org/show_bug.cgi?id=153047
2005 Reviewed by Chris Dumez.
2007 The bug was caused by the check for singularity of scheduledRequests being conducted per configuration
2008 instead of per builder. So if there were multiple test configurations (e.g. Speedometer and Octane) that
2009 both used the same builder, then we may end up scheduling both at once.
2011 Fixed the bug by sharing a single set to keep track of the scheduled requests for all configurations per
2014 * tools/sync-with-buildbot.py:
2015 (load_config): Share a set amongst test configurations for each builder.
2016 (find_request_updates): Instead of creating a new set for each configuration, reuse the existing sets to
2017 share a single set agmonst test configurations for each builder.
2019 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2021 Analysis results viewer sometimes doesn't show the correct relative difference
2022 https://bugs.webkit.org/show_bug.cgi?id=152930
2024 Reviewed by Chris Dumez.
2026 The bug was caused by single A/B testing result associated with multiple rows when there are multiple data
2027 points with the same root set which matches that of an A/B testing.
2029 Fixed the bug by detecting such a case, and only associating each A/B testing result with the row created
2030 for the first matching point.
2032 * public/v3/components/analysis-results-viewer.js:
2033 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
2035 2016-01-08 Ryosuke Niwa <rniwa@webkit.org>
2037 Make v3 UI analysis task page is hard to understand
2038 https://bugs.webkit.org/show_bug.cgi?id=152917
2040 Reviewed by Antti Koivisto.
2042 Add a dark gray border around the selected block in the analysis results viewer instead of using darker
2043 shades since that looks as if they were bigger regression/progression.
2045 Explicitly show "Failed" as the label instead of omitting with "-" when all build requests in an A/B
2046 testing group fails.
2048 * public/v3/components/analysis-results-viewer.js:
2049 (AnalysisResultsViewer.cssTemplate): Tweaked the style to underline text in the hovered blocks and the
2050 selected blocks and show a dark gray border around the selected blocks.
2051 (AnalysisResultsViewer.TestGroupStackingBlock):
2052 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Use this._title for title.
2053 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
2054 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForRootSet): Deleted.
2056 * public/v3/components/results-table.js:
2057 (ResultsTable.prototype.render):
2058 (ResultsTable.prototype._createRevisionListCells): Extracted from ResultsTable.prototype.render.
2059 (ResultsTable.cssTemplate): Tweaked the style.
2061 (ResultsTableRow.prototype.constructor): Added _labelForWholeRow to store the label for the entire row.
2062 This is used to show the comparison result of two root sets (e.g. A vs B).
2063 (ResultsTableRow.prototype.setLabelForWholeRow): Added.
2064 (ResultsTableRow.prototype.labelForWholeRow): Added.
2065 (ResultsTableRow.prototype.resultContent): Extracted from buildHeading. Creates a hyperlinked bar graph
2066 used for each A/B testing result.
2067 (ResultsTableRow.prototype.buildHeading): Deleted since we need to set colspan on the second table cell
2068 when we're creating a row with _labelForWholeRow.
2070 * public/v3/components/test-group-results-table.js:
2071 (TestGroupResultsTable.prototype.buildRowGroups): Added rows to show relative differences and statistical
2072 significance between root sets (e.g. A vs B).
2074 * public/v3/models/build-request.js:
2075 (BuildRequest.prototype.hasCompleted): Added.
2077 * public/v3/models/test-group.js:
2078 (TestGroup.prototype.compareTestResults): Extracted from AnalysisResultsViewer.TestGroupStackingBlock's
2079 _computeTestGroupStatus and generalized to be reused in TestGroupResultsTable.
2080 (TestGroup.prototype._valuesForRootSet): Moved from AnalysisResultsViewer.TestGroupStackingBlock.
2082 * public/v3/pages/analysis-task-page.js:
2083 (AnalysisTaskPage.cssTemplate): Tweaked the style.
2085 2016-01-07 Ryosuke Niwa <rniwa@webkit.org>
2087 Perf dashboard should automatically add aggregators
2088 https://bugs.webkit.org/show_bug.cgi?id=152818
2090 Reviewed by Chris Dumez.
2092 When an aggregator entry is missing in aggregators table, automatically insert it in /api/report.
2094 In a very early version of the perf dashboard, we had the ability to define a custom aggregator
2095 in an admin page. In practice, nobody used or needed this feature so we got rid of it even before
2096 the dashboard was landed into WebKit repository. This patch cleans up that mess.
2099 (main): Added the filtering capability.
2100 (TestEnvironment): Expose the config JSON in the test environment.
2102 * public/include/report-processor.php:
2103 (ReportProcessor): Renamed name_to_aggregator now that it only contains ID.
2104 (ReportProcessor::__construct): No longer fetches the aggregator table. An equivalent work is done
2105 in newly added ensure_aggregators.
2106 (ReportProcessor::process): Calls ensure_aggregators which populates name_to_aggregator_id.
2107 (ReportProcessor::ensure_aggregators): Added. Add the builtin aggregators: Arithmetic, Geometric,
2108 Harmonic, and Total.
2109 (TestRunsGenerator): Renamed name_to_aggregator now that it only contains ID.
2110 (TestRunsGenerator::__construct):
2111 (TestRunsGenerator::add_aggregated_metric): Don't include aggregator_definition here since it's
2112 never used now that all the aggregations are done natively in PHP.
2113 (TestRunsGenerator::$aggregators): Added. We don't include SquareSum since it's only used for
2114 computing run_square_sum_cache in test_runs table and it's useless elsewhere.
2115 (TestRunsGenerator::aggregate_values): Add a comment about that.
2117 * tests/api-report.js: Updated a test case to reflect the change.
2119 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2121 Perf dashboard JSON API should fail gracefully when postgres is down
2122 https://bugs.webkit.org/show_bug.cgi?id=152812
2124 Reviewed by Chris Dumez.
2126 Even though all JSON APIs returned DatabaseConnectionFailure as the status when Database::connect
2127 returned a falsy value, PHP was spitting out warnings and producing HTTP responses that cannot be
2128 parsed as a JSON when pg_connect failed.
2130 Fixed the bug by suppressing warning messages in pg_connect.
2132 * public/include/db.php:
2133 (Database::connect): Use '@' prefix to suppress warning messages.
2135 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2137 Perf dashboard should auto-generate manifest file when one is missing
2138 https://bugs.webkit.org/show_bug.cgi?id=152813
2140 Reviewed by Chris Dumez.
2142 When /data/manifest.json is missing, fall back to newly added /api/manifest instead of
2143 silently failing to show the UI. This will make the initial setup easier.
2145 * public/api/manifest.php: Added.
2147 * public/include/manifest.php:
2148 (Manifest::manifest): Added.
2149 * public/v3/main.js:
2151 (didFetchManifest): Extracted from fetchManifest.
2153 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2155 Commit another forgotten change, this time, for r194653.
2157 * public/v3/models/measurement-set.js:
2159 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2161 The sampling of time series on v3 UI is too aggressive
2162 https://bugs.webkit.org/show_bug.cgi?id=152804
2164 Reviewed by Chris Dumez.
2166 Fixed a bug that we were always halving the number of data points in _sampleTimeSeries
2167 and increased the number of data points allowed to make the sampling less aggressive.
2169 * public/v3/components/time-series-chart.js:
2170 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Increase the number of maximum points
2171 to 2x the number of pixels divided by the radius of each point.
2172 (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Changed the semantics of endIndex
2173 to mean the index after the last point and renamed it to indexAfterEnd.
2174 (TimeSeriesChart.prototype._sampleTimeSeries): Fixed a bug that this code always coerced two
2175 data points into one sampled data point despite of the fact i and j are sufficiently apart
2176 since data[j].time - data[i].time > timePerSample by definition.
2178 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2180 Commit the forgotten change for r194651.
2182 * public/v3/pages/domain-control-toolbar.js:
2183 (DomainControlToolbar.prototype.setStartTime):
2185 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2187 The right hand side of main chart appears to be cut off as you zoom out on v3 UI
2188 https://bugs.webkit.org/show_bug.cgi?id=152778
2190 Reviewed by Antti Koivisto.
2192 Add a padding on x-axis after the end time to make the main chart more easily interactive.
2194 * public/v3/components/time-series-chart.js:
2195 (TimeSeriesChart.prototype._computeHorizontalRenderingMetrics):
2197 * public/v3/pages/page-with-charts.js:
2198 (PageWithCharts.mainChartOptions): Add a padding of 5px at the end of x-axis.
2200 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2202 v3 UI should use four sig-figs to label y-axis of the main charts
2203 https://bugs.webkit.org/show_bug.cgi?id=152779
2205 Reviewed by Antti Koivisto.
2207 Increase the number of significant figures used in the main charts to four as done in v2 UI.
2209 * public/v3/pages/chart-pane.js:
2210 (ChartPane.constructor): Create a formatter with four significant figures.
2211 * public/v3/pages/page-with-charts.js:
2212 (PageWithCharts.mainChartOptions): Increase the width of y-axis labels.
2214 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2216 v3 UI's time range slider is harder to use than that of v2 UI
2217 https://bugs.webkit.org/show_bug.cgi?id=152780
2219 Reviewed by Antti Koivisto.
2221 Improved the time range slider by using a cubic mapping to time range and providing a text field
2222 to directly edit the number of days to show.
2224 Now an user can enter the text mode to directly edit the number of days to show by clicking on
2225 the number of days (text field is always there with opacity=0).
2227 * public/v3/pages/charts-toolbar.js:
2228 (ChartsToolbar): Store the minimum and maximum number of days allowed. Also rename _inputElement
2229 to _slider and added a new type=number text field as _editor.
2230 (ChartsToolbar.prototype.render):
2231 (ChartsToolbar.prototype.setStartTime): Exit the text mode when the number of days is changed by
2232 an URL state transition (i.e. back/forward navigation).
2233 (ChartsToolbar.prototype._setInputElementValue): Added. Updates the values of _slider and _editor.
2234 (ChartsToolbar.prototype._enterTextMode): Added. Hide the elements used by the slider mode and
2235 show the text field.
2236 (ChartsToolbar.prototype._exitTextMode): Added. Does the opposite.
2237 (ChartsToolbar.prototype._sliderValueMayHaveChanged): Renamed from _inputValueMayHaveChanged.
2238 (ChartsToolbar.prototype._editorValueMayHaveChanged): Added. Similar to _sliderValueMayHaveChanged
2239 but also corrects the value of _editor if needed.
2240 (ChartsToolbar.prototype._callNumberOfDaysCallback): Extracted from _inputValueMayHaveChanged.
2241 Also fixed a bug that we didn't update the URL state when the change event was fired without
2242 modifying the effective number of days.
2243 (ChartsToolbar.cssTemplate): Tweaked the style to support the new mode. Also set a fixed width on
2244 the span showing the number of days in the slider mode.
2246 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2248 Zooming button is broken on v3 UI
2249 https://bugs.webkit.org/show_bug.cgi?id=152777
2251 Reviewed by Chris Dumez.
2253 Bring up the zoom button in z-index so that users can click it.
2255 * public/v3/components/interactive-time-series-chart.js:
2256 (InteractiveTimeSeriesChart.cssTemplate):
2258 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2260 v3 UI doesn't preserve the time range when charts page is opened from a dashboard
2261 https://bugs.webkit.org/show_bug.cgi?id=152776
2263 Reviewed by Chris Dumez.
2265 Fixed the bug by moving the construction of charts URL from DashboardPage.prototype.open to
2266 DashboardPage.prototype.render and re-rendering the entire page upon an URL state transition.
2268 * public/v3/pages/charts-page.js:
2269 (ChartsPage.createStateForDashboardItem): Takes the start time for the charts page.
2271 * public/v3/pages/dashboard-page.js:
2272 (DashboardPage.prototype.updateFromSerializedState): Merged _numberOfDaysDidChange and
2273 _updateChartsDomainFromToolbar into this function since they're not used elsewhere. Also re-render
2274 the entire page when transition between different number of days to show.
2275 (DashboardPage.prototype._numberOfDaysDidChange): Deleted.
2276 (DashboardPage.prototype._updateChartsDomainFromToolbar): Deleted.
2277 (DashboardPage.prototype.render): Construct URL for each charts here.
2278 (DashboardPage.prototype._createChartForCell): Don't construct URL here since this function is
2279 called once when the dashboard page is opened, and not when the time range is changed.
2281 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2283 Build fix for an old version of PHP after r194618.
2285 * public/api/measurement-set.php:
2287 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2289 A/B testing results should be visualized intuitively on v3 UI
2290 https://bugs.webkit.org/show_bug.cgi?id=152496
2292 Rubber-stamped by Chris Dumez.
2294 Add the "stacking block" view of A/B testing results to the analysis task page on v3 UI.
2296 The patch enhances JSON APIs at /api/analysis-task /api/measurement-set/ to reduce the number of
2297 HTTP requests, and adds two UI components: TestGroupResultsTable and AnalysisResultsViewer both
2298 of which inherits from an abstract superclass: ResultsTable.
2300 ResultsTable provides a tabular presentation of measured values in regular measurement sets and
2301 A/B testing results using groups of bar graphs created by BarGraphGroup. TestGroupResultsTable
2302 inherits from this class to display A/B testing configurations and the averaged results for each
2303 configuration, and AnalysisResultsViewer inherits from it to provide an intuitive visualization
2304 of the outcomes of all A/B testing results associated with a given analysis task.
2306 * public/api/analysis-tasks.php:
2307 (main): Add the capability to find the analysis task based on its build request.
2308 This allows /v3/#/analysis/task/?buildRequest=<id> to be hyperlinked on buildbot page.
2310 * public/api/measurement-set.php:
2311 (main): Removed the unused startTime and endTime, and added "analysisTask" to query parameters.
2312 (AnalysisResultsFetcher): Added. Used to fetch measured data associated with every build request
2313 on an analysis task.
2314 (AnalysisResultsFetcher::__construct):
2315 (AnalysisResultsFetcher::fetch): Unlike MeasurementSetFetcher, we fetch the list of commits and
2316 list of measurements separately since there will be a lot less builds and commits than measured
2317 data (since we're fetching measured values for all tests and their metrics).
2318 (AnalysisResultsFetcher::fetch_commits): Fetches commits.
2319 (AnalysisResultsFetcher::format_measurement): Like MeasurementSetFetcher::format_measurement but
2320 with config_type and config_metric since we're returning measured data for all metrics and test
2322 (AnalysisResultsFetcher::format_map): Similar to MeasurementSetFetcher::format_map.
2324 * public/v3/components/analysis-results-viewer.js: Added.
2325 (AnalysisResultsViewer): Added.
2326 (AnalysisResultsViewer.prototype.didUpdateResults): This callback is called by AnalysisTaskPage
2327 when A/B testing results become available.
2328 (AnalysisResultsViewer.prototype.render): Overrides ResultsTable's render to highlight the block
2329 representing the currently selected test group.
2331 (AnalysisResultsViewer.prototype.buildRowGroups): Creates a list of rows with "stacking blocks"
2332 that visualizes A/B testing results. The algorithm works as follows: 1. Create all table rows.
2333 2. Find which row is associated with each set in each test group. 3. Layout "blocks".
2335 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Collects root sets from all data
2336 in the measurement set as well as A/B testing **requests** (results may contain more repositories
2337 than requested but they aren't interesting for the purpose of visualizing results for the entire
2340 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Create table rows. First,
2341 create table rows for measurement set points that have a matching test group (i.e. either set A
2342 or set B of an A/B testing uses the same root set as a point). Second, insert a new row for each
2343 root set in each test group which didn't find a matching measurement set point. There is a little
2344 subtlety that some A/B testing may specify revisions for a subset of repositories and/or some A/B
2345 testing results may appear as if it goes back in time with respect to other A/B testing results.
2346 For example, consider creating two A/B test groups for WebKit changes and OS changes separately.
2347 There could be no coherent linearization of those two A/B testing in which both WebKit and OS
2348 versions move forward.
2350 (AnalysisResultsViewer.RootSetInTestGroup): Added. Represents a pair (test group, root set) since
2351 a root set could be shared by multiple test groups.
2352 (AnalysisResultsViewer.TestGroupStackingBlock): Added. A stacked block representing a test group.
2353 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex): Associates a row number with
2354 either set A or set B.
2355 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Creates a table cell
2357 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Returns true if this test group
2358 has failed and this block should look "thin" without any label.
2359 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus): Computes the
2360 status for this test group.
2362 (AnalysisResultsViewer.TestGroupStackingGrid): Added. AnalysisResultsViewer uses this class to
2363 layout blocks representing test groups.
2364 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.insertBlockToColumn): Inserts a new block
2365 to layout. We keep all test groups doing the same A/B test next to each other.
2366 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.layout): Layouts each block / test group
2367 in the order they are created.
2368 (AnalysisResultsViewer.TestGroupStackingGrid.prototype._layoutBlock): Places the block in the
2369 left-most column that can accommodate it while avoiding columns of a different thin-ness. A column
2370 is thin if its A/B testing has failed, and not thin otherwise.
2371 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.createCellsForRow): Creates table cells for
2372 a given row. For each column, generate a table cell if we're in the first row and the first block
2373 starts in a later row, a block starts in the current row, or the last block ended in the previous
2374 row and the next block or the last row appears later.
2376 * public/v3/components/bar-graph-group.js: Added. A component for showing a group of bar graphs.
2377 (BarGraphGroup): Added. Creates a group of bar graphs with the same value range. It's used by
2378 AnalysisResultsViewer and ResultsTable to show bar graphs to compare values.
2379 (SingleBarGraph): A component created and collectively controlled by BarGraphGroup.
2381 * public/v3/components/results-table.js: Added.
2382 (ResultsTable): An abstract superclass for TestGroupResultsTable and AnalysisResultsViewer.
2384 (ResultsTable.prototype.render): Renders the table. 1. Call "buildRowGroups()" implemented by
2385 a subclass to obtain the list of rows. 2. Compute the list of repositories to show. 3. For each
2386 cell in the table, compute the number of rows to show the same value (for rowspan). 4. Render the
2387 table with an extra list of repositories if exists.
2389 (ResultsTable.prototype._computeRepositoryList): Compute the list of repositories to list
2390 revisions in the table. Omit repositories not present in any row or for which all rows have the
2391 same revision. In the latter case, include it in the extra repositories listed below the table.
2392 This minimizes the amount of redundant information presented to the user.
2394 (ResultsTableRow): Added. Represents a single row in the table. ResultsTable constructs necessary
2395 table cells to tabulate the associated root sets, and shows the associated result using a grouped
2396 bar graph. Additional columns are used by AnalysisResultsViewer to show stacked blocks for A/B
2399 * public/v3/components/test-group-results-table.js: Added.
2400 (TestGroupResultsTable):
2401 (TestGroupResultsTable.prototype.didUpdateResults):
2402 (TestGroupResultsTable.prototype.setTestGroup):
2403 (TestGroupResultsTable.prototype.heading):
2404 (TestGroupResultsTable.prototype.render):
2405 (TestGroupResultsTable.prototype.buildRowGroups):
2407 * public/v3/index.html:
2408 * public/v3/models/analysis-results.js: Added.
2409 (AnalysisResults): Added. Like MeasurementSet, this class represents a set of measured values
2410 associated with a given analysis task.
2411 (AnalysisResults.prototype.find): Returns a measured valued for a given build and metric.
2412 (AnalysisResults.prototype.add): Adds a new measured value. Used by AnalysisResults.fetch.
2413 (AnalysisResults.fetch): Fetches data and creates AnalysisResults for a given analysis task.
2415 * public/v3/models/analysis-task.js:
2416 (AnalysisTask.prototype.startMeasurementId): Added.
2417 (AnalysisTask.prototype.endMeasurementId): Added.
2418 (AnalysisTask.fetchByBuildRequestId): Added.
2419 (AnalysisTask._fetchSubset): Uses DataModelObject.cachedFetch.
2421 * public/v3/models/build-request.js: Added.
2422 (BuildRequest): Added. Represents a single A/B testing request associated with a test group.
2424 * public/v3/models/builder.js:
2425 (Build): Added. Represents a build associated with a given A/B testing result.
2427 * public/v3/models/commit-log.js:
2428 (CommitLog): Made this class inherit from DataModelObject.
2429 (CommitLog.ensureSingleton): Added. Finds the singleton object created for a given revision
2430 in the specified repository. This helps RootSet and other classes compare commits fast.
2431 (CommitLog.prototype.repository): Added.
2432 (CommitLog.fetchBetweenRevisions): Uses CommitLog.ensureSingleton.
2434 * public/v3/models/data-model.js:
2436 (DataModelObject.namedStaticMap): Added.
2437 (DataModelObject.ensureNamedStaticMap): Renamed from namedStaticMap instead of implicitly
2438 assuming that the non-static version always creates the map.
2439 (DataModelObject.prototype.namedStaticMap): Added.
2440 (DataModelObject.cachedFetch): Extracted from AnalysisTask._fetchSubset so that TestGroup's
2441 fetchByTask could also use it.
2444 * public/v3/models/measurement-adaptor.js: Added.
2445 (MeasurementAdaptor): Extracted from MeasurementCluster. This class is responsible for
2446 re-formatting the data received via /api/measurement-set JSON API inside the v3 UI.
2447 (MeasurementAdaptor.prototype.extractId): Added.
2448 (MeasurementAdaptor.prototype.adoptToAnalysisResults): Added. Used by AnalysisResults.
2449 (MeasurementAdaptor.aggregateAnalysisResults): Added. Used by TestGroupResultsTable to
2450 aggregate results for each test configuration; e.g. computing the average for set A.
2451 (MeasurementAdaptor.prototype.adoptToSeries): Extracted from MeasurementCluster.addToSeries.
2452 Added rootSet() to each point. This allows AnalysisResultsViewer to compare them against root
2453 sets associated with A/B testing results.
2454 (MeasurementAdaptor.computeConfidenceInterval): Moved from MeasurementCluster.
2456 * public/v3/models/measurement-cluster.js:
2457 (MeasurementCluster):
2458 (MeasurementCluster.prototype.addToSeries):
2460 * public/v3/models/repository.js:
2461 (Repository.prototype.hasUrlForRevision): Added.
2463 * public/v3/models/root-set.js: Added.
2464 (RootSet): Added. Represents a set of commits in measured results.
2465 (MeasurementRootSet): Added. Ditto for results associated with A/B testing.
2467 * public/v3/models/test-group.js: Added.
2468 (TestGroup): Added. Represents a A/B testing on analysis task.
2469 (TestGroup.prototype.createdAt): Added.
2470 (TestGroup.prototype.buildRequests): Returns the list of build requests associated with this
2472 (TestGroup.prototype.addBuildRequest): Added. Used by BuildRequest's constructor to associate
2473 itself with this group.
2474 (TestGroup.prototype.didSetResult): Added. Called by BuildRequest.setResult when measured
2475 values are fetched and associated with a build request in this group.
2477 * public/v3/models/test.js:
2480 * public/v3/pages/analysis-task-page.js:
2482 (AnalysisTaskPage.prototype.updateFromSerializedState): Fetch the analysis task, test groups
2483 associated with it, and all A/B testing results based on the task id or the build request id
2484 specified in the URL.
2485 (AnalysisTaskPage.prototype._didFetchTask): Added. Start fetching the measured data. This is
2486 the data on charts page for which this analysis task was created, not results of A/B testing.
2487 (AnalysisTaskPage.prototype._didFetchMeasurement): Added. Display the fetched data in a table
2488 inside AnalysisResultsViewer.
2489 (AnalysisTaskPage.prototype._didFetchTestGroups): Added. Display the list of A/B test groups
2490 as well as the results of the first A/B testing.
2491 (AnalysisTaskPage.prototype._didFetchAnalysisResults): Added.
2492 (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Added. Once both the analysis task,
2493 A/B test groups as well as their results are fetched, update build requests in each test group
2495 (AnalysisTaskPage.prototype.render): Show the list of test groups and highlight the currently
2497 (AnalysisTaskPage.prototype._showTestGroup): Added. A callback used by AnalysisResultsViewer
2498 and TestGroupResultsTable to notify this class when the user selects a new test group.
2499 (AnalysisTaskPage.htmlTemplate): Updated the template.
2500 (AnalysisTaskPage.cssTemplate): Ditto.
2502 * public/v3/pages/charts-page.js:
2503 (ChartsPage.createStateForAnalysisTask): Added. Creates a URL state object for opening a chart
2504 associated with an analysis task.
2506 2015-12-22 Ryosuke Niwa <rniwa@webkit.org>
2508 Analysis task page is slow to load
2509 https://bugs.webkit.org/show_bug.cgi?id=152517
2511 Reviewed by Andreas Kling.
2513 The slowness comes from r194130 which made the JSON API at /api/analysis-tasks to report the start
2514 and the end of each analysis task. This query was adding ~2s to the total JSON generation time.
2516 Cache these values on analysis_task table since they never change once an analysis task is created.
2518 * init-database.sql: Added columns task_start_run_time and task_end_run_time to analysis_task table.
2519 Also added the missing drop statements at the top.
2521 * public/api/analysis-tasks.php:
2522 (fetch_and_push_bugs_to_tasks): Don't fetch the latest commit time of the start and the end.
2523 (format_task): Report task_start_run_time and task_end_run_time as startRunTime and endRunTime.
2525 * public/privileged-api/create-analysis-task.php:
2526 (main): Set start_run_time and end_run_time when creating an analysis task.
2527 (time_for_run): Added.
2529 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2531 v3 UI shouldn't open/close pane selector by mouseenter/leave
2532 https://bugs.webkit.org/show_bug.cgi?id=152399
2534 Reviewed by Andreas Kling.
2536 Removed the code to open and close the pane selector by mouseenter and mouseleave
2537 since multiple people have complained about the behavior.
2539 * public/v3/pages/charts-toolbar.js:
2540 (ChartsToolbar): Removed the event listeners.
2541 (ChartsToolbar.prototype._addPane): Don't close the pane selector when adding a new pane
2542 to better support the use case of adding multiple panes.
2543 (ChartsToolbar.cssTemplate): Tweaked CSS.
2545 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2547 Popover for analysis tasks shows up at the left edge of annotation bars in the v3 UI
2548 https://bugs.webkit.org/show_bug.cgi?id=152389
2550 Reviewed by Darin Adler.
2552 Compute the x coordinate of the popover from the center of each annotation bar.
2554 Also adjust the x coordinate to keep the popover within the charts.
2556 * public/v3/components/interactive-time-series-chart.js:
2557 (InteractiveTimeSeriesChart.prototype._renderChartContent):
2559 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2561 Dashboard charts should have uniform widths on v3 UI
2562 https://bugs.webkit.org/show_bug.cgi?id=152395
2564 Reviewed by Chris Dumez.
2566 Fix the bug by applying table-layout: fixed on the dashboard table.
2568 * public/v3/pages/dashboard-page.js:
2569 (DashboardPage.prototype.render): Added header-column as a class name to explicitly set the header column with.
2570 (DashboardPage.cssTemplate): Adjusted CSS accordingly.
2572 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2574 Closing a pane on v3 UI always closes the last pane
2575 https://bugs.webkit.org/show_bug.cgi?id=152388
2577 Reviewed by Chris Dumez.
2579 The bug was caused by closePane being called without arguments. (The first argument to bind is "this" value.)
2580 Fixed it by passing in "this" pane object to the first argument.
2582 * public/v3/pages/chart-pane.js:
2585 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2587 Perf Dashboard v3 UI doesn't show recent data points on v2 UI
2588 https://bugs.webkit.org/show_bug.cgi?id=152368
2590 Reviewed by Chris Dumez.
2592 The bug was caused by the last modified date in measurement set JSON being a string instead of a POSIX timestamp,
2593 which prevented the v3 UI from invalidating the cache. Specifically, the following boolean logic always evaluated
2594 to false because +data['lastModified'] was NaN in MeasurementSet.prototype._fetch (/v3/models/measurement-set.js):
2596 !clusterEndTime && useCache && +data['lastModified'] < self._lastModified
2598 Fixed the bug by calling Database::to_js_time on the last modified date fetched from the database.
2600 * public/api/measurement-set.php:
2601 (MeasurementSetFetcher::fetch_config_list): Convert the string returned by the database to a POSIX timestamp.
2602 * tests/api-measurement-set.js: Added a test to ensure the last modified date in JSON is numeric. Since the value
2603 of the last modified date depends on when tests run, we can't assert it to be a certain value.
2605 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2607 v3 UI should show and link the build number on charts page
2608 https://bugs.webkit.org/show_bug.cgi?id=152359
2610 Reviewed by Chris Dumez.
2612 Show the hyperlinked build number in the v3 UI.
2614 * public/v3/models/builder.js:
2615 (Builder): Renamed _buildURL to _buildUrlTemplate.
2616 (Builder.prototype.urlForBuild): Added.
2617 * public/v3/pages/chart-pane-status-view.js:
2618 (ChartPaneStatusView):
2619 (ChartPaneStatusView.prototype.render): Added the code to render hyperlinked build number when one is available.
2620 (ChartPaneStatusView.prototype.computeChartStatusLabels): Store currentPoint's measurement object as _buildInfo
2621 if the current point is set by an indicator (not by a selection).
2623 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2625 v3 dashboard doesn't stretch charts to fill the screen
2626 https://bugs.webkit.org/show_bug.cgi?id=152354
2628 Reviewed by Chris Dumez.
2630 The bug was caused by a workaround to avoid canvas stretching table cell too much.
2632 Fix the problem instead by making the canvas absolutely positioned inside the "time-series-chart" element
2633 so that it does not contribute to the intrinsic/natural width of the cell.
2635 * public/v3/components/time-series-chart.js:
2636 (TimeSeriesChart.prototype._ensureCanvas): Make the canvas absolutely positioned inside the shadow root.
2637 (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Use the container element's size now that
2638 the canvas does not resize with it.
2639 * public/v3/pages/dashboard-page.js:
2640 (DashboardPage.cssTemplate): Updated the CSS so that the chart stretches all the way.
2642 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2644 The chart status on v3 UI sometimes show wrong revision ranges
2645 https://bugs.webkit.org/show_bug.cgi?id=152331
2647 Reviewed by Chris Dumez.
2649 The bug was caused by the status view not taking the data sampling that happens in TimeSeriesChart into account
2650 when finding the previous point. Take this into account by using InteractiveTimeSeries.currentPoint(-1) which
2651 finds the sampled data point immediately preceding the current point (at which the indicator is shown).
2653 * public/v3/components/chart-status-view.js:
2654 (ChartStatusView.prototype.updateStatusIfNeeded):
2656 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2658 Perf dashboard's cycler page should use v3 UI
2659 https://bugs.webkit.org/show_bug.cgi?id=152324
2661 Reviewed by Chris Dumez.
2663 Use the v3 UI in cycler.html after r194130.
2665 * public/cycler.html:
2666 * public/v3/index.html: Removed the reference to a non-existent platform-selector.js.
2668 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2670 Add v3 UI to perf dashboard
2671 https://bugs.webkit.org/show_bug.cgi?id=152311
2673 Reviewed by Chris Dumez.
2675 Add the third iteration of the perf dashboard UI. UI for viewing and modifying analysis tasks is coming soon.
2676 The v3 UI is focused on speed, and removes all third-party script dependencies including jQuery, d3, and Ember.
2677 Both the DOM-based UI and graphing are implemented manually.
2680 The entire app is structured using new component library implemented in components/base.js. Each component is
2681 an instance of a subclass of ComponentBase which owns a single DOM element. Each subclass may supply static
2682 methods named htmlTemplate and cssTemplate as the template for a component instance. ComponentBase automatically
2683 clones the templates inside the associated element (or its shadow root on the supported browsers). Each subclass
2684 must supply a method called "render()" which constructs and updates the DOM as needed.
2686 There is a special component called Page, which represents an entire page. Each Page is opened by PageRouter's
2687 "route()" function. Each subclass of Page supplies "open()" for initialization and "updateFromSerializedState()"
2688 for a hash URL transition.
2691 The key feature of the v3 UI is the split of time series into chunks called clusters (see r194120). On an internal
2692 instance of the dashboard, the v2 UI downloads 27MB of data whereas the same page loads only 3MB of data in the v3.
2693 The key logic for fetching time series in chunks is implemented by MeasurementSet in /v3/models/measurement-set.js.
2694 We first fetch the cached primary cluster (the cluster that contains the newest data) at:
2695 /data/measurement-set-<platform-id>-<metric-id>.json
2697 If that's outdated according to lastModified in manifest.json, then we immediately re-fetch the primary cluster at:
2698 /api/measurement-set/?platform=<platform-id>&metric=<metric-id>
2700 Once the up-to-date primary cluster is fetched, we fetch all "secondary" clusters. For each cluster being fetched,
2701 including the primary, we invoke registered callbacks.
2704 In addition, the v3 UI reduces the initial page load time by loading a single bundled JS file generated by
2705 tools/bundle-v3-scripts.py. index.html has a fallback to load all 44 JS files individually during development.
2707 * public/api/analysis-tasks.php:
2708 (fetch_and_push_bugs_to_tasks): Added the code to fetch start and end run times. This is necessary in V3 UI
2709 because no longer fetch the entire time series. See r194120 for the new measurement set JSON API.
2710 (format_task): Compute the category of an analysis task based on "result" value. This will be re-vamped once
2711 I add the UI for the analysis task page in v3.
2713 * public/include/json-header.php:
2714 (require_format): CamelCase the name.
2715 (require_match_one_of_values): Ditto.
2716 (validate_arguments): Renamed from require_existence_of and used in measurement-set.php landed in r194120.
2719 * public/v3/components: Added.
2721 * public/v3/components/base.js: Added.
2722 (ComponentBase): The base component class.
2723 (ComponentBase.prototype.element): Returns the DOM element associated with the DOM element.
2724 (ComponentBase.prototype.content): Returns the shadow root if one exists and the associated element otherwise.
2725 (ComponentBase.prototype.render): To be implemented by a subclass.
2726 (ComponentBase.prototype.renderReplace): A helper function to "render" DOM contents.
2727 (ComponentBase.prototype._constructShadowTree): Called inside the constructor to instantiate the templates.
2728 (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Instantiates components referred by
2729 its element name inside the instantiated content.
2730 (ComponentBase.isElementInViewport): A helper function. Returns true if the element is in the viewport and it has
2731 non-zero width and height.
2732 (ComponentBase.defineElement): Defines a custom element that can be automatically instantiated from htmlTemplate.
2733 (ComponentBase.createElement): A helper function to create DOM tree to be used in "render()" method.
2734 (ComponentBase._addContentToElement): A helper for "createElement".
2735 (ComponentBase.createLink): A helper function to create a hyperlink or another clickable element (via callback).
2736 (ComponentBase.createActionHandler): A helper function to create an event listener that prevents the default action
2737 and stops the event propagation.
2739 * public/v3/components/button-base.js: Added.
2741 * public/v3/components/chart-status-view.js: Added.
2742 (ChartStatusView): A component that reports the current status of time-series-chart. It's subclasses by
2743 ChartPaneStatusView to provide additional information in the charts page's panes.
2745 * public/v3/components/close-button.js: Added.
2747 * public/v3/components/commit-log-viewer.js: Added.
2748 (CommitLogViewer): A component that lists commit revisions along with commit messages for a range of data points.
2750 * public/v3/components/interactive-time-series-chart.js: Added.
2751 (InteractiveTimeSeriesChart): A subclass of InteractiveTimeSeriesChart with interactivity (selection & indicator).
2752 Selection and indicator are mutually exclusive.
2754 * public/v3/components/pane-selector.js: Added.
2755 (PaneSelector): A component for selecting (platform, metric) pair to add in the charts page.
2757 * public/v3/components/spinner-icon.js: Added.
2759 * public/v3/components/time-series-chart.js: Added.
2760 (TimeSeriesChart): A canvas-based chart component without interactivity. It takes a source list and options as
2761 the constructor arguments. A source list is a list of measurement sets (measurement-set.js) with drawing options.
2762 This component fetches data via MeasurementSet.fetchBetween inside TimeSeriesChart.prototype.setDomain and
2763 progressively updates the charts as more data arrives. The canvas is updated on animation frame via rAF and all
2764 layout and rendering metrics are lazily computed in _layout. In addition, this component samples data before
2765 rendering the chart when there are more data points per pixel in _ensureSampledTimeSeries.
2767 * public/v3/index.html: Added. Loads bundled-scripts.js if it exists, or individual script files otherwise.
2769 * public/v3/instrumentation.js: Added. This class is used to gather runtime statistics of v3 UI. (It measures
2770 the performance of the perf dashboard UI).
2772 * public/v3/main.js: Added. Bootstraps the app.
2776 * public/v3/models: Added.
2777 * public/v3/models/analysis-task.js: Added.
2778 * public/v3/models/bug-tracker.js: Added.
2779 * public/v3/models/bug.js: Added.
2780 * public/v3/models/builder.js: Added.
2781 * public/v3/models/commit-log.js: Added.
2782 * public/v3/models/data-model.js: Added.
2783 (DataModelObject): The base class for various data objects that correspond to database tables. It supplies static
2784 hash map to find entries by id as well as other keys.
2785 (LabeledObject): A subclass of DataModelObject with the capability to find an object via its name.
2787 * public/v3/models/measurement-cluster.js: Added.
2788 (MeasurementCluster): Represents a single cluster or a chunk of data in a measurement set.
2790 * public/v3/models/measurement-set.js: Added.
2791 (MeasurementSet): Represents a measurement set.
2792 (MeasurementSet.findSet): Returns the singleton set given (metric, platform). We use singleton to avoid issuing
2793 multiple HTTP requests for the same JSON when there are multiple TimeSeriesChart that show the same graph (e.g. on
2794 charts page with overview and main charts).
2795 (MeasurementSet.prototype.findClusters): Finds the list of clusters to fetch in a given time range.
2796 (MeasurementSet.prototype.fetchBetween): Fetch clusters for a given time range and calls callback whenever new data
2797 arrives. The number of callbacks depends on the how many clusters need to be newly fetched.
2798 (MeasurementSet.prototype._fetchSecondaryClusters): Fetches non-primary (non-latest) clusters.
2799 (MeasurementSet.prototype._fetch): Issues a HTTP request to fetch a cluster.
2800 (MeasurementSet.prototype._didFetchJSON): Called when a cluster is fetched.
2801 (MeasurementSet.prototype._failedToFetchJSON): Called when the fetching of a cluster has failed.
2802 (MeasurementSet.prototype._invokeCallbacks): Invokes callbacks upon an approval of a new cluster.
2803 (MeasurementSet.prototype._addFetchedCluster): Adds the newly fetched cluster in the order.
2804 (MeasurementSet.prototype.fetchedTimeSeries): Returns a time series that contains data from all clusters that have
2806 (TimeSeries.prototype.findById): Additions to TimeSeries defined in /v2/data.js.
2807 (TimeSeries.prototype.dataBetweenPoints): Ditto.
2808 (TimeSeries.prototype.firstPoint): Ditto.
2810 * public/v3/models/metric.js: Added.
2811 * public/v3/models/platform.js: Added.
2812 * public/v3/models/repository.js: Added.
2813 * public/v3/models/test.js: Added.
2815 * public/v3/pages: Added.
2816 * public/v3/pages/analysis-category-page.js: Added. The "Analysis" page that lists the analysis tasks.
2817 * public/v3/pages/analysis-category-toolbar.js: Added. The toolbar to filter analysis tasks based on its category
2818 (unconfirmed, bisecting, identified, closed) and a keyword.
2820 * public/v3/pages/analysis-task-page.js: Added. Not implemented yet. It just has the hyperlink to the v2 UI.
2822 * public/v3/pages/chart-pane-status-view.js: Added.
2823 (ChartPaneStatusView): A subclass of ChartStatusView used in the charts page. In addition to the current value,
2824 comparison to baseline/target, it shows the list of repository revisions (e.g. WebKit revision, OS version).
2826 * public/v3/pages/chart-pane.js: Added.
2827 (ChartPane): A component a pane in the charts page. Each pane has the overview chart and the main chart. The zooming
2828 is synced across all panes in the charts page.
2830 * public/v3/pages/charts-page.js: Added. Charts page.
2831 * public/v3/pages/charts-toolbar.js: Added. The toolbar to set the number of days to show. This affects the overview
2832 chart's domain in each pane.
2834 * public/v3/pages/create-analysis-task-page.js: Added.
2835 (CreateAnalysisTaskPage): A page that gets shown momentarily while creating a new analysis task.
2837 * public/v3/pages/dashboard-page.js: Added. A dashboard page.
2838 * public/v3/pages/dashboard-toolbar.js: Added. Its toolbar with buttons to select the number of days to show.
2839 * public/v3/pages/domain-control-toolbar.js: Added. An abstract superclass of charts and dashboard toolbars.
2841 * public/v3/pages/heading.js: Added. A component for displaying the header and toolbar, if exists, on each page.
2842 * public/v3/pages/page-router.js: Added. This class is responsible for updating the URL hashes as well as opening
2843 and updating each page when the hash changes (via back/forward navigation).
2844 * public/v3/pages/page-with-charts.js: Added. An abstract subclass of page used by dashboards and charts page.
2845 Supplies helper functions for creating TimeSeriesChart options.
2846 * public/v3/pages/page-with-heading.js: Added. An abstract subclass of page that uses the heading component.
2847 * public/v3/pages/page.js: Added. The Page component.
2848 * public/v3/pages/toolbar.js: Added. An abstract toolbar component.
2850 * public/v3/remote.js: Added.
2851 (getJSON): Fetches JSON from the remote server.
2852 (getJSONWithStatus): Ditto. Rejects the response if the status is not "OK".
2853 (PrivilegedAPI.sendRequest): Posts a HTTP request to a privileged API in /privileged-api/.
2854 (PrivilegedAPI.requestCSRFToken): Creates a new CSRF token to request a privileged API post.
2856 * tools/bundle-v3-scripts.py: Added.
2857 (main): Bundles js files together and minifies them by jsmin.py for the v3 UI. Without this script, we're forced to
2858 download 44 JS files or making each JS file contain multiple classes.
2860 * tools/jsmin.py: Copied from WebInspector / JavaScriptCore code.
2862 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2864 Fix v2 UI after r194093.
2866 * public/v2/data.js:
2868 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2870 Add /api/measurement-set for v3 UI
2871 https://bugs.webkit.org/show_bug.cgi?id=152312
2873 Rubber-stamped by Chris Dumez.
2875 The new API JSON allows the front end to fetch measured data in chunks called a "cluster" as specified
2876 in config.json for each measurement set specified by the pair of a platform and a metric.
2878 When the front end needs measured data in a given time range (t_0, t_1) for a measurement set, it first
2879 fetches the primary cluster by /api/measurement-set/?platform=<platform-id>&metric=<metric-id>.
2880 The primary cluster is the last cluster in the set (returning the first cluster here is not useful
2881 since we don't typically show very old data), and provides the information needed to fetch other clusters.
2883 Fetching the primary cluster also creates JSON files at:
2884 /data/measurement-set-<platform-id>-<metric-id>-<cluster-end-time>.json
2885 to allow latency free access for secondary clusters. The front end code can also fetch the cache of
2886 the primary cluster at: /data/measurement-set-<platform-id>-<metric-id>.json.
2888 Because the front end code has to behave as if all data is fetched, each cluster contains one data point
2889 immediately before the first data point and one immediately after the last data point. This avoids having
2890 to fetch multiple empty clusters for manually specified baseline data. To support this behavior, we generate
2891 all clusters for a given measurement set at once when the primary cluster is requested.
2893 Furthermore, all measurement sets are divided at the same time into clusters so that the boundary of clusters
2894 won't shift as more data are reported to the server.
2896 * config.json: Added clusterStart and clusterSize as options.
2897 * public/api/measurement-set.php: Added.
2899 (MeasurementSetFetcher::__construct):
2900 (MeasurementSetFetcher::fetch_config_list): Finds configurations that belongs to this (platform, metric) pair.
2901 (MeasurementSetFetcher::at_end): Returns true if we've reached the end of all clusters for this set.
2902 (MeasurementSetFetcher::fetch_next_cluster): Generates the JSON data for the next cluster. We generate clusters
2903 in increasing chronological order (the oldest first and the newest last).
2904 (MeasurementSetFetcher::execute_query): Executes the main query.
2905 (MeasurementSetFetcher::format_map): Returns the mapping of a measurement field to an array index. This removes
2906 the need to have key names for each measurement and reduces the JSON size by ~10%.
2907 (MeasurementSetFetcher::format_run): Creates an array that contains data for a single measurement. The order
2908 matches that of keys in format_map.
2909 (MeasurementSetFetcher::parse_revisions_array): Added. Copied from runs.php.
2910 * tests/api-measurement-set.js: Added. Added tests for /api/measurement-set.
2912 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2914 Using fake timestamp in OS version make some results invisible
2915 https://bugs.webkit.org/show_bug.cgi?id=152289
2917 Reviewed by Stephanie Lewis.
2919 Fix various bugs after r194088.
2921 * public/api/commits.php:
2922 (format_commit): Include the commit order.
2923 * public/v2/data.js:
2924 (CommitLogs._cacheConsecutiveCommits): Sort by commit order when commit time is missing.
2925 * tools/pull-os-versions.py:
2926 (OSBuildFetcher._assign_order): Use integer instead of fake time for commit order.
2927 (available_builds_from_command): Exit early when an exception is thrown.
2929 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2931 Fix a typo in the previous commit.
2933 * public/include/report-processor.php:
2935 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2937 Build fix after r192965. Suppress a warning about log being referred to as a closure variable.
2939 * public/include/report-processor.php:
2941 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2943 Using fake timestamp in OS version make some results invisible
2944 https://bugs.webkit.org/show_bug.cgi?id=152289
2946 Reviewed by Stephanie Lewis.
2948 Added commit_order column to explicitly order OS versions. This fixes the bug whereby which
2949 baseline results reported with only OS versions are shown with x coordinate set to 10 years ago.
2951 To migrate the existing database, run:
2952 ALTER TABLE commits ADD COLUMN commit_order integer;
2953 CREATE INDEX commit_order_index ON commits(commit_order);
2955 Then for each repository $1,
2956 UPDATE commits SET (commit_time, commit_order) = (NULL, CAST(EXTRACT(epoch from commit_time) as integer))
2957 WHERE commit_repository = $1;
2960 * init-database.sql: Added the column.
2961 * public/api/commits.php:
2962 (fetch_commits_between): Use commit_order to order commits when commit_time is missing.
2963 * public/api/report-commits.php:
2964 (main): Set commit_order.
2965 * tools/pull-os-versions.py:
2966 (OSBuildFetcher.fetch_and_report_new_builds):
2967 (OSBuildFetcher._assign_order): Renamed from _assign_fake_timestamps. Set the order instead of a fake timestmap.
2969 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2971 Perf dashboard can't merge when the destination platform is missing baseline/target
2972 https://bugs.webkit.org/show_bug.cgi?id=152286
2974 Reviewed by Stephanie Lewis.
2976 The bug was caused by the query to migrate test configurations to new platform checking
2977 configuration type and metric separately; that is, it assumes the configuration exists
2978 only if either the same type or the same metric exists in the destination.
2980 Fixed the bug by checking both conditions simultaneously for each configuration.
2982 * public/admin/platforms.php:
2983 * tests/admin-platforms.js: Added a test.
2985 2015-12-11 Ryosuke Niwa <rniwa@webkit.org>
2987 Perf dashboard's buildbot sync config JSON duplicates too much information
2988 https://bugs.webkit.org/show_bug.cgi?id=152196
2990 Reviewed by Stephanie Lewis.
2992 Added shared, per-builder, and per-test (called type) configurations.
2994 * tools/sync-with-buildbot.py:
2996 (load_config.merge):
2998 2015-12-02 Ryosuke Niwa <rniwa@webkit.org>
3000 Perf dashboard should avoid overflow during geometric mean computation
3001 https://bugs.webkit.org/show_bug.cgi?id=151773
3003 Reviewed by Chris Dumez.
3005 * public/include/report-processor.php:
3007 2015-11-30 Ryosuke Niwa <rniwa@webkit.org>
3009 Perf dashboard should extend baseline and target to the future
3010 https://bugs.webkit.org/show_bug.cgi?id=151511
3012 Reviewed by Darin Adler.
3014 * public/v2/data.js:
3015 (RunsData.prototype.timeSeriesByCommitTime): Added extendToFuture as an argument.
3016 (RunsData.prototype.timeSeriesByBuildTime): Ditto.
3017 (RunsData.prototype._timeSeriesByTimeInternal): Ditto.
3018 (TimeSeries): Add a new point to the end if extendToFuture is set and the series is not empty.
3019 * public/v2/manifest.js:
3020 (App.Manifest._formatFetchedData): Set extendToFuture to true for baselines and targets.
3022 2015-11-30 Ryosuke Niwa <rniwa@webkit.org>
3024 Perf dashboard should always show comparison to baseline and target even if one is missing
3025 https://bugs.webkit.org/show_bug.cgi?id=151510
3027 Reviewed by Darin Adler.
3029 Show the comparison status against the baseline when baseline is present but target is missing.
3031 To make the code more readable, this patch splits the logic into three cases:
3032 1. Both baseline and target are present
3033 2. Only baseline is present
3034 3. Only target is present
3036 Also extracted a helper function to construct the label.
3039 (.labelForDiff): Added.
3040 (App.Pane.computeStatus):
3042 2015-11-23 Commit Queue <commit-queue@webkit.org>
3044 Unreviewed, rolling out r192716 and r192717.
3045 https://bugs.webkit.org/show_bug.cgi?id=151582
3047 The patch was incorrect. We always need at least one data
3048 point in each configuration (Requested by rniwa on #webkit).
3050 Reverted changesets:
3052 "Perf dashboard's should not include results more than 366
3054 https://bugs.webkit.org/show_bug.cgi?id=151529
3055 http://trac.webkit.org/changeset/192716
3057 "Build fix for old version of PHP."
3058 http://trac.webkit.org/changeset/192717
3060 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3062 Build fix for old version of PHP.
3064 * public/api/runs.php:
3066 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3068 Perf dashboard's should not include results more than 366 days old in JSON
3069 https://bugs.webkit.org/show_bug.cgi?id=151529
3071 Reviewed by Timothy Hatcher.
3073 Don't return results more than 366 days old in /api/runs/ JSON API.
3074 This is a ~5% runtime improvement and reduces the JSON file size by 20-50% in the internal perf dashboard.
3076 * public/api/runs.php:
3077 (main): Added the support for "?noResults" to avoid echoing results. This is useful for debugging.
3078 Also instantiate RunsGenerator before issuing the query to find all configurations so that the runtime cost
3079 of doing so will be included in elapsedTime.
3080 (RunsGenerator::fetch_runs): Skip a row when its build and commit times are more than 366 days old.
3081 (RunsGenerator::format_run): Takes build_time and revisions as arguments since fetch_runs uses them now.
3082 (RunsGenerator::parse_revisions_array): Compute the max of commit times.
3084 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3086 Remove chartPointRadius from interactive chart component
3087 https://bugs.webkit.org/show_bug.cgi?id=151480
3089 Reviewed by Darin Adler.
3091 Replaced the parameter by CSS rules.
3093 * public/v2/chart-pane.css:
3095 (.chart .dot.foreground):
3096 (.chart .highlight):
3098 * public/v2/index.html:
3099 * public/v2/interactive-chart.js:
3100 (App.InteractiveChartComponent.Ember.Component.extend._constructGraphIfPossible):
3101 (App.InteractiveChartComponent.Ember.Component.extend._highlightedItemsChanged):
3103 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3105 Perf dashboard's runs API uses more than 128MB of memory
3106 https://bugs.webkit.org/show_bug.cgi?id=151478
3108 Reviewed by Andreas Kling.
3110 Don't fetch all query results at once to avoid using twice as much memory as needed.
3111 Use iterative API to format each result at a time.
3113 This change is also a 5% runtime performance gain.
3115 * public/api/runs.php:
3116 (RunsGenerator::__construct): Takes a Database instance instead of a list of configurations. The latter is
3117 no longer needed as we pass in each configuration type explicitly to fetch_runs.
3118 (RunsGenerator::fetch_runs): Renamed from add_runs since it now executes the database query via execute_query.
3119 Also moved the logic to compute the last modified time here.
3120 (RunsGenerator::execute_query): Moved from fetch_runs_for_config. Use Database::query instead of query_and_fetch_all.
3121 (RunsGeneratorForTestGroup):
3122 (RunsGeneratorForTestGroup::__construct):
3123 (RunsGeneratorForTestGroup::execute_query): Moved from fetch_runs_for_config_and_test_group.
3125 * public/include/db.php:
3126 (generate_data_file): Lock the file to avoid corruption.
3128 2015-11-19 Ryosuke Niwa <rniwa@webkit.org>
3130 Perf dashboard always fetches charts JSON twice
3131 https://bugs.webkit.org/show_bug.cgi?id=151483
3133 Reviewed by Andreas Kling.
3135 Only re-generate "runs" JSON via /api/runs/ when the cache doesn't exist in /data/ or the cached JSON is
3136 obsolete (shouldRefetch is set true) or corrupt (the second closure).
3141 2015-11-18 Ryosuke Niwa <rniwa@webkit.org>
3143 Internal perf dashboard takes forever to load
3144 https://bugs.webkit.org/show_bug.cgi?id=151430
3146 Rubber-stamped by Antti Koivisto.
3148 Fix a few performance problems with the perf dashboard v2 UI.
3151 (App.DashboardRow._createPane): Set "inDashboard" to true.
3152 (App.Pane._fetch): Immediately show the cached chart instead of waiting for the refetched data which invokes
3153 a PHP JSON API. Also don't fetch the analysis tasks when the chart is shown in the dashboard since we don't
3154 show annotate charts in the dashboard.
3156 2015-10-15 Ryosuke Niwa <rniwa@webkit.org>
3158 Unreviewed fix of a test after r190687.
3160 * tests/admin-regenerate-manifest.js:
3162 2015-10-12 Ryosuke Niwa <rniwa@webkit.org>
3164 Perf dashboard tools shouldn't require server credentials in multiple configuration files
3165 https://bugs.webkit.org/show_bug.cgi?id=149994
3167 Reviewed by Chris Dumez.
3169 Made detect-changes.js and pull-svn.py pull username and passwords from the server config JSON to reduce
3170 the number of JSON files that need to include credentials.
3172 Also made each script reload the server config after sleep to allow dynamic credential updates.
3174 In addition, change the server config JSON's format to include scheme, host, and port numbers separately
3175 instead of a url since detect-changes.js needs each value separately.
3177 This reduces the number of JSONs with credentials to two for our internal dashboard.
3179 * tools/detect-changes.js:
3180 (main): Added a property argument parsing. Now takes --server-config-json, --change-detection-config-json,
3181 and --seconds-to-sleep like other scripts.
3182 (parseArgument): Added.
3183 (fetchManifestAndAnalyzeData): Reload the server config JSON.
3184 (loadServerConfig): Added. Set settings.perfserver and settings.slave from the server config JSON. Also
3185 add settings.perfserver.host to match the old format.
3186 (configurationsForTesting): Fixed a bug that we throw an exception when a dashboard contains an empty cell.
3188 * tools/pull-os-versions.py:
3189 (main): Use load_server_config after each sleep.
3191 * tools/pull-svn.py:
3192 (main): Use load_server_config after each sleep.
3193 (fetch_commits_and_submit): Use the perf dashboard's auth as subversion credential when useServerAuth is set.
3195 * tools/sync-with-buildbot.py:
3196 (main): Use load_server_config after each sleep.
3199 (load_server_config): Extracted from python scripts. Computes server's url from scheme, host, and port number
3200 to match the old format python scripts except.
3202 2015-10-11 Ryosuke Niwa <rniwa@webkit.org>
3204 Build fix after r190817. Now that pull-os-versions store fake timestamps, we need to bypass timestamp
3205 checks for OS versions when bots try to report new results. Otherwise, we fail to process the reports
3206 with a MismatchingCommitTime error.
3208 * public/include/report-processor.php:
3209 (ReportProcessor::resolve_build_id):
3211 2015-10-08 Ryosuke Niwa <rniwa@webkit.org>
3213 Perf dashboard erroneously shows an old OS build in A/B testing range
3214 https://bugs.webkit.org/show_bug.cgi?id=149942
3216 Reviewed by Darin Adler.
3218 Ordering OS builds lexicologically turned out be a bad idea since 15A25 falls between 15A242 and 15A251.
3219 Use a fake/synthetic timestamp to force the commonly understood total order instead.
3221 Refactored pull-os-versions.py to share the server config JSON with other scripts. Also made the script
3222 support pulling multiple sources; e.g. both OS X and iOS.
3224 Also removed superfluous feature to submit results in chunks. The perf dashboard can handle thousands of
3225 revisions being submitted at once just fine.
3227 * public/api/commits.php:
3228 (main): A partial revert of r185574 since we no longer need to order builds lexicologically.
3230 * tools/pull-os-versions.py:
3231 (main): Takes --os-config-json, --server-config-json, and --seconds-to-sleep as arguments instead of
3232 a single --config argument to share the server config JSON with other scripts.
3233 (OSBuildFetcher): Extracted out of main. This class is instantiated for each OS kind (e.g. OS X).
3234 (OSBuildFetcher.__init__): Added.
3235 (OSBuildFetcher._fetch_available_builds): Extracted out of main. Fetches available builds from a website
3237 (OSBuildFetcher.fetch_and_report_new_builds): Extracted out of main. Submits the fetched builds after
3238 filtering out the ones we've already reported.
3239 (OSBuildFetcher._assign_fake_timestamps): Creates a fake timestamp to establish a total order amongst each
3240 OS X / iOS style build number such as 12A3456b.
3242 2015-10-08 Ryosuke Niwa <rniwa@webkit.org>
3244 pull-svn.py fails to sync revisions when SVN credentials is not setup
3245 https://bugs.webkit.org/show_bug.cgi?id=149941
3247 Reviewed by Chris Dumez.
3249 Added the support for specifying subversion credentials.
3251 Also added the support for pulling from multiple subversion servers. Subversion servers are specified
3252 in a JSON configuration file specified by --svn-config formatted as follows:
3257 "url": "http://svn.webkit.org/repository/webkit",
3258 "username": "webkitten",
3259 "password": "webkitten's password",
3260 "trustCertificate": true,
3261 "accountNameFinderScript":
3262 ["python", "/Volumes/Data/WebKit/Tools/Scripts/webkit-patch", "find-users"]
3267 In addition, refactored it to use the shared server config JSON for the dashboard access.
3269 * tools/pull-svn.py:
3270 (main): Now takes --svn-config-json, --server-config-json, --seconds-to-sleep and --max-fetch-count
3271 as required options instead of seven unnamed arguments.
3272 (fetch_commits_and_submit): Extracted from main. Fetches at most max_fetch_count new revisions from
3273 the subversion server, and submits them in accordance with server_config.
3274 (fetch_commit_and_resolve_author): Now takes a single repository dictionary instead of two separate
3275 arguments for name and URL to pass down the repository's authentication info to fetch_commit.
3276 (fetch_commit): Ditto. Add appropriate arguments when username and passwords are specified.
3277 (resolve_author_name_from_account): Use a list argument instead of a single string argument now that
3278 the argument comes from a JSON instead of sys.argv.
3280 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3282 Unreviewed race condition fix. Exit early when xScale or yScale is not defined.
3284 * public/v2/interactive-chart.js:
3285 (App.InteractiveChartComponent._updateRangeBarRects):
3287 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3289 Add a page that cycles through v2 dashboards
3290 https://bugs.webkit.org/show_bug.cgi?id=149907
3292 Reviewed by Chris Dumez.
3294 Add cycler.html that goes through each dashboard on v2 UI.
3296 This allows the dashboards to be cycled through on a TV screen.
3298 * public/cycler.html: Added.
3299 (loadURLAt): Appends a new iframe to load the next URL (i is the index of the dashboard to be shown)
3300 at the end of body. We don't immediately show the new iframe since it might take a while to load.
3301 (showNewFrameIfLoaded): Remove the current iframe and show the next iframe if the next dashboard has
3302 finished loading. We can't rely on DOMContentLoaded or load events because we use asynchronous XHR to
3303 load each chart's data. Instead, wait until some chart becomes available or fails to load and none of
3304 charts are still in progress to be shown.
3306 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3308 Allow custom revisions to be specified in A/B testing
3309 https://bugs.webkit.org/show_bug.cgi?id=149905
3311 Reviewed by Chris Dumez.
3313 Allow custom revision number on each "repository" when creating a test group.
3315 * public/v2/app.css:
3316 (form .analysis-group [name=customValue]): Added.
3319 (App.AnalysisTaskController._createConfiguration): Added "Custom" as a revision option.
3320 Also added point labels such as (point 3) on "None" for when some points are missing revision info.
3321 (App.AnalysisTaskController._labelForPoints): Extracted from _createConfiguration.
3322 (App.AnalysisTaskController.actions.createTestGroup): Respect the custom revision number when custom
3323 revision option is selected.
3325 * public/v2/index.html: Added a text field for specifying a custom revision number.
3327 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3329 Make the site name configurable in perf dashboard
3330 https://bugs.webkit.org/show_bug.cgi?id=149894
3332 Reviewed by Chris Dumez.
3334 Added "siteTitle" as a new configuration key to specify the site name.
3336 * public/include/db.php:
3337 (config): Now takes the default value as an argument.
3338 * public/include/manifest.php:
3339 (ManifestGenerator::generate): Include siteTitle in the manifest.
3340 * public/index.html: Update the title and the heading when the manifest is loaded.
3341 * public/v2/index.html: Use App.Manifest.siteTitle as the heading. document.title needs to be updated manually.
3342 * public/v2/manifest.js:
3343 (App.MetricSerializer.normalizePayload): Update document.title and App.Manifest.siteTitle.
3345 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3347 Perf dashboard doesn't show analysis tasks anchored at outliers
3348 https://bugs.webkit.org/show_bug.cgi?id=149870
3350 Reviewed by Chris Dumez.
3352 The bug was caused by the computation of start and end times of analysis tasks being dependent on
3353 time series provided to the interactive chart component even though they are already filtered.
3355 Since the interactive chart component shouldn't be messing with the underlying data models, moved
3356 the code to compute start and end times to App.Pane, to where it belongs, and made the moved code use
3357 the unfiltered time series newly exposed on ChartData.
3359 Also fixed a bug in fetch-from-remote.php which resulted in Ember endlessly fetching same JSON files.
3361 * public/admin/fetch-from-remote.php:
3362 (.): Use the full request URI for HTTP requests and caching. Otherwise, we're going to mix up caches
3363 and Ember can start hanging browsers (took me three hours to debug this).
3366 (App.Pane._showOutlierChanged): Added. Resets chartData when showOutlier flag has been changed.
3367 (App.Pane.fetchAnalyticRanges): The old code wasn't filtering analysis tasks by platforms and metrics
3368 at all since it relied on the server-side REST API to do the filtering, which I haven't implemented yet.
3369 Filter the results manually instead.
3370 (App.Pane.ranges): Moved the logic to compute startTime and endTime here from InteractiveChartComponent.
3371 (App.PaneController.toggleShowOutlier): Now that App.Pane responds to showOutlier changes, we don't
3372 need to call a private method on it.
3373 (App.AnalysisTaskController._chartDataChanged): When end points are not found, try showing outliers.
3374 This will cause chartData to be modified so just exit early and wait for getting called again.
3376 * public/v2/interactive-chart.js:
3377 (App.InteractiveChartComponent._rangesChanged): The code to compute start and end time has been moved
3380 * public/v2/manifest.js:
3381 (App.Manifest._formatFetchedData): Added unfiltered time series as new properties as they are now used
3382 to compute the end points of analysis tasks when their end points are outliers.
3384 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3386 Unreviewed. Fix a typo in r190645.
3388 * public/include/db.php:
3390 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3392 V2 UI shouldn't sort dashboards lexicologically
3393 https://bugs.webkit.org/show_bug.cgi?id=149856
3395 Reviewed by Chris Dumez.
3397 Don't sort the dashboards by name in App.Manifest.
3400 (App.IndexRoute.beforeModel): Don't transition to "undefined" (string) dashboard.
3401 * public/v2/manifest.js:
3402 (App.Manifest.._fetchedManifest):
3404 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3406 V2 UI fails to show the data for the very first point in charts
3407 https://bugs.webkit.org/show_bug.cgi?id=149857
3409 Reviewed by Chris Dumez.
3411 The bug was caused by seriesBetweenPoints returning null for when point.seriesIndex is 0.
3412 Explicitly check the type of this property instead.
3414 * public/v2/data.js:
3415 (TimeSeries.prototype.seriesBetweenPoints):
3417 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3419 Perf dashboard should have the capability to test local UI with production data
3420 https://bugs.webkit.org/show_bug.cgi?id=149834
3422 Reviewed by Chris Dumez.
3424 Added tools/run-with-remote-server.py which runs a local httpd server and pulls data from a remote server.
3426 * Install.md: Added the instruction on how to use the script. Also updated the remaining instructions
3428 * config.json: Added remote server configurations.
3429 * public/admin/fetch-from-remote.php: Added. This script fetches JSON from the remote server specified in
3430 config.json and caches the results in the location specified as "cacheDirectory" in config.json.
3433 * public/include/db.php:
3434 (config_path): Extracted from generate_data_file.
3435 (generate_data_file):
3436 * tools/remote-server-relay.conf: Added. Apache 2.4 configuration file for a local http server launched by
3437 run-with-remote-server.py.
3438 * tools/run-with-remote-server.py: Added. Launches Apache with the right set of directives.
3440 (abspath_from_root):
3442 2015-07-13 Ryosuke Niwa <rniwa@webkit.org>
3446 * public/js/helper-classes.js:
3448 2015-06-27 Ryosuke Niwa <rniwa@webkit.org>
3450 build-requests should use conform to JSON API format
3451 https://bugs.webkit.org/show_bug.cgi?id=146375
3453 Reviewed by Stephanie Lewis.
3455 Instead of returning single dictionary that maps root set id to a dictionary of repository names
3456 to revisions, timestamps, simply return root sets and roots "rows" or "objects" as defined in
3457 JSON API (http://jsonapi.org/). This API change makes it easier to resolve the bug 146374 and
3458 matches what we do in /api/test-groups.
3460 Also add the support for /api/build-requests/?id=<id> to fetch the build request with <id>.
3461 This is useful for debugging purposes.
3463 * public/api/build-requests.php:
3464 (main): Added the support for $_GET['id']. Also return "rootSets" and "roots".
3465 (update_builds): Extracted from main.
3467 * public/include/build-requests-fetcher.php:
3468 (BuildRequestFetcher::fetch_request): Added. Used for /api/build-requests/?id=<id>.
3469 (BuildRequestFetcher::results_internal): Always call fetch_roots_for_set_if_needed.
3470 (BuildRequestFetcher::fetch_roots_for_set_if_needed): Renamed from fetch_roots_for_set.
3471 Moved the logic to exit early when the root set had already been fetched here.
3473 * public/v2/analysis.js:
3474 (App.TestGroup._fetchTestResults): Fixed the bug that test groups without any successful results
3477 * tools/pull-os-versions.py:
3479 (setup_auth): Moved to util.py
3481 * tools/sync-with-buildbot.py:
3482 (main): Replaced a bunch of perf dashboard related options by --server-config-json.
3483 (update_and_fetch_build_requests): No longer takes build_request_auth since that's now taken care
3485 (organize_root_sets_by_id_and_repository_names): Added. Builds the old rootsSets directory based
3486 on "roots" and "rootSets" dictionaries returned by /api/build-requests.
3487 (config_for_request): Fixed a bug that the script blows up when the build request is missing
3488 the repository specified in the configuration. This tolerance is necessary when a new repository
3489 dependency is added but we want to run A/B tests for old builds without the dependency.
3490 (fetch_json): No longer takes auth.
3493 (setup_auth): Moved from pull-os-versions.py to be shared with sync-with-buildbot.py.
3495 2015-06-23 Ryosuke Niwa <rniwa@webkit.org>
3497 Build fix. A/B testing is broken when continuous builders report revisions out of order.
3500 (App.AnalysisTaskController.Ember.Controller.extend.):
3502 2015-06-22 Ryosuke Niwa <rniwa@webkit.org>
3504 A/B testing results should be shown even if they were submitted to different platforms
3505 https://bugs.webkit.org/show_bug.cgi?id=146219
3507 Reviewed by Andreas Kling.
3509 Fetch A/B testing results regardless of the platform to which results are submitted
3510 by providing the platform ID to which the results were submitted for each test group.
3512 * public/api/test-groups.php:
3513 (main): Include the platform id in the test groups.
3514 * public/v2/analysis.js:
3515 (App.TestGroup._fetchTestResults): Fetch results from the platform associated with the group.
3517 2015-06-19 Csaba Osztrogonác <ossy@webkit.org>
3519 Remove unnecessary svn:executable flags
3520 https://bugs.webkit.org/show_bug.cgi?id=146107
3522 Reviewed by Alexey Proskuryakov.
3524 * public/js/helper-classes.js: Removed property svn:executable.
3525 * public/js/jquery.flot.plugins.js: Removed property svn:executable.
3526 * public/v2/app.css: Removed property svn:executable.
3527 * public/v2/app.js: Removed property svn:executable.
3528 * public/v2/chart-pane.css: Removed property svn:executable.
3529 * public/v2/data.js: Removed property svn:executable.
3530 * public/v2/index.html: Removed property svn:executable.
3531 * public/v2/js/d3/LICENSE: Removed property svn:executable.
3532 * public/v2/js/d3/d3.js: Removed property svn:executable.
3533 * public/v2/js/d3/d3.min.js: Removed property svn:executable.
3534 * public/v2/js/ember-data.js: Removed property svn:executable.
3535 * public/v2/js/ember.js: Removed property svn:executable.
3536 * public/v2/js/handlebars.js: Removed property svn:executable.
3537 * public/v2/js/jquery.min.js: Removed property svn:executable.
3538 * public/v2/js/statistics.js: Removed property svn:executable.
3539 * public/v2/manifest.js: Removed property svn:executable.
3540 * public/v2/popup.js: Removed property svn:executable.
3542 2015-06-17 Ryosuke Niwa <rniwa@webkit.org>
3544 Reading the list of analysis tasks is extremely slow
3545 https://bugs.webkit.org/show_bug.cgi?id=146086
3547 Reviewed by Darin Adler.
3549 The bug was caused by Ember data requesting manifest.js hundreds of times.
3550 Fetch it ahead of time in each route instead.
3553 (App.AnalysisRoute.model):
3554 (App.AnalysisTaskRoute.model):
3556 2015-06-17 Ryosuke Niwa <rniwa@webkit.org>
3558 Update ReadMe.md and Install.md per database changes
3559 https://bugs.webkit.org/show_bug.cgi?id=146076
3561 Reviewed by Darin Adler.
3568 2015-06-17 Ryosuke Niwa <rniwa@webkit.org>
3570 Increase the popup dismissal time from 100ms to 500ms
3571 https://bugs.webkit.org/show_bug.cgi?id=146077
3573 Rubber-stamped by Andreas Kling.
3575 * public/v2/popup.js:
3576 (App.PopupView.scheduleHiding):
3578 2015-06-16 Ryosuke Niwa <rniwa@webkit.org>
3580 v2 UI should have buttons to breakdown a test
3581 https://bugs.webkit.org/show_bug.cgi?id=146010
3583 Reviewed by Chris Dumez.
3585 Added buttons beneath each chart pane to add "alternative panes". By default, it shows every platform
3586 as well as "Breakdown" to add all subtests' metrics.
3588 Also removed the metric submenu from tests that had exactly one metric. When a test only measures Time
3589 for example, we make the test itself clickable instead of showing a submenu that only contains one item.
3592 (App.ChartsController.addAlternativePanes): Added.
3593 (App.TestProxyForPopup.children): Calls _updateChildren and returns this._children.
3594 (App.TestProxyForPopup.actionName): Added.
3595 (App.TestProxyForPopup.actionArgument): Added.
3596 (App.TestProxyForPopup._updateChildren): Extracted from children. Now also sets _actionName and
3597 _actionArgument in the case there was exactly one metric so that showing submenu is unnecessary.
3598 (App.PaneController.alternativePanes): Added. Returns the list of alternative panes. The platform list
3599 excludes ones that don't have this metric (e.g. iOS doesn't have desktop PLT results) as well as ones
3600 that are already present in the list of panes.
3601 * public/v2/chart-pane.css: Added CSS rules for alternative pane buttons beneath the chart panes.
3602 * public/v2/index.html:
3603 * public/v2/manifest.js:
3604 (App.Metric.childMetrics): Added.
3606 2015-06-15 Ryosuke Niwa <rniwa@webkit.org>
3608 Build fix after r185574.
3611 (set get App.Pane.Ember.Object.extend.):
3613 2015-06-15 Ryosuke Niwa <rniwa@webkit.org>
3617 * tools/pull-os-versions.py:
3620 2015-06-15 Ryosuke Niwa <rniwa@webkit.org>
3622 Perf dashboard should be able to list iOS versions as well as OS X versions
3623 https://bugs.webkit.org/show_bug.cgi?id=146003
3625 Reviewed by Stephanie Lewis.
3627 Generalized pull-osx.py so that it can run an arbitrary shell command to fetch OS versions based on
3628 information specified in config.json.
3630 * tools/pull-os-versions.py: Renamed from pull-osx.py.
3631 (main): Use available_builds_from_command when 'customCommands' is specified.
3632 (available_builds_from_command): Added. Executes a shell command to fetch a list of available builds.
3633 (fetch_available_builds): Now takes the repository name.
3635 2015-06-15 Ryosuke Niwa <rniwa@webkit.org>
3637 Removed a superfluous console.log per Chris's comment.
3641 2015-06-15 Ryosuke Niwa <rniwa@webkit.org>
3643 Analysis task should show all possible revisions for A/B testing
3644 https://bugs.webkit.org/show_bug.cgi?id=145996
3646 Reviewed by Chris Dumez.
3648 * public/api/commits.php:
3649 (fetch_commits_between): When the time stamp is not available for commits, use revision numbers
3650 to find revisions between two ranges. This is necessary for OS X and iOS versions since they don't
3651 have a "commit time".
3654 (App.AnalysisTaskController.updateRootConfigurations): Fetch commits between two end points.
3655 (App.AnalysisTaskController._createConfiguration): Extracted from updateRootConfigurations. List
3656 the fetched list of commits if available.
3657 (App.AnalysisTaskController._serializeNumbersSkippingConsecutiveEntries): Added. Serializes an list
3658 of numbers intelligently. For example, [1, 2, 4, 5] turns into "1-2, 4-5". Without this, some lists
3659 of points shown in the A/B testing configurations become too long.
3661 * public/v2/commits-viewer.js:
3662 (App.CommitsViewerComponent.commitsChanged):
3664 * public/v2/data.js:
3665 (CommitLogs.fetchCommits): Renamed from fetchForTimeRange.
3667 2015-06-13 Ryosuke Niwa <rniwa@webkit.org>
3669 Add a script to post new OS X builds to perf dashboard
3670 https://bugs.webkit.org/show_bug.cgi?id=145955
3672 Reviewed by Darin Adler.
3674 Added a new script pull-osx.py and relaxed the restrictions on commits accepted by the dashboard API.
3676 * public/api/report-commits.php:
3677 (main): Allow more characters than [A-Za-z0-9] in revision. e.g. "10.10.3 14D136".
3678 Also allow commits without the author, commit time, and commit message as OS versions do not have those.
3680 * tools/pull-osx.py: Added.
3681 (main): Fetch the list of builds from a website and submit them per submissionSize with submissionInterval.
3682 Once all builds have been submitted, wait for a long time as specified by fetchInterval.
3683 (setup_auth): Sets up basic or digest auth to access the dashboard.
3684 (fetch_available_builds): Fetches and parses the XML document from an internal website.
3685 (textContent): A helper function to get the text content out of a XML node.
3686 (submit_commits): Submits commits to the perf dashboard.
3688 * tools/pull-svn.py:
3691 * tools/util.py: Extracted submit_commits and text_content from pull-svn.py to be reused in pull-osx.py.
3693 2015-06-13 Ryosuke Niwa <rniwa@webkit.org>
3695 Perf dashboard's v2 UI shouldn't hide auto-detected outliers
3696 https://bugs.webkit.org/show_bug.cgi?id=145940
3698 Reviewed by Darin Adler.
3700 Don't fallback to the default strategies for moving averages and envelope when one is not specified.
3701 Also deleted the code to mark points outside the envelop as outliers.
3705 2015-06-12 Ryosuke Niwa <rniwa@webkit.org>
3707 Unreviewed build fix for merging platforms.