1 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
3 Build fix. We need to escape the path or http.request would fail.
7 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
9 Fix various bugs in the new syncing script
10 https://bugs.webkit.org/show_bug.cgi?id=156393
12 Reviewed by Darin Adler.
14 * server-tests/resources/common-operations.js: Added. This file was supposed to be added in r199191.
15 (addBuilderForReport):
17 (connectToDatabaseInEveryTest):
19 * tools/js/buildbot-triggerable.js:
20 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
21 builder as this dramatically increases the amount of log we generate.
22 * tools/js/parse-arguments.js:
23 (parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
25 (RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
26 (RemoteAPI.prototype.configure): Added more validations with nice error messages.
27 (RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
28 the right port in configure instead based on the scheme.
29 * tools/sync-buildbot.js:
30 (syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
31 and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
32 properly in Manifest.fetch() because we do need to "forget" about some tests and platforms in some cases.
33 For now, delete all v3 model objects and start over in each syncing cycle.
34 * unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.
36 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
38 sync-buildbot.js doesn't mark disappeared builds as failed
39 https://bugs.webkit.org/show_bug.cgi?id=156386
41 Reviewed by Chris Dumez.
43 Fix a bug that new syncing script doesn't mark builds that it scheduled but doesn't appear when queried
44 by buildbot's JSON API. These are builds that got canceled by humans (e.g. buildbot was restarted, data
45 loss, pending build was canceled, etc...)
47 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case.
48 * tools/js/buildbot-triggerable.js:
49 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added a set of build requests we've matched
50 against BuildbotBuildEntry's. Mark build requests that didn't have any entry but supposed to be in either
51 'scheduled' or 'running' status as failed.
53 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
55 A/B testing bots should prioritize user created test groups
56 https://bugs.webkit.org/show_bug.cgi?id=156375
58 Reviewed by Chris Dumez.
60 Order build requests preferring user created ones over ones automatically created by detect-changes.js.
62 Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new
63 build request on a builder/slave even when we had previously scheduled another build request.
65 * public/include/build-requests-fetcher.php:
66 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on
67 author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js.
68 Since we're using ascending order, this would put user created test groups first.
69 * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case
70 for testing that build requests for an user created test group shows up first.
71 * server-tests/resources/mock-data.js:
72 (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name.
73 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests
74 for an user created test group shows up first.
75 * tools/js/buildbot-syncer.js:
76 (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already
77 scheduled new build requests. Don't schedule more requests on these slaves.
78 (BuildbotSyncer.prototype.scheduleRequest):
79 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null
80 when slaveList is not specified) to _slavesWithNewRequests.
81 (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request
82 we have previously scheduled should be included in one of the entires now.
83 * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug.
84 (sampleiOSConfig): Added a second slave for new test cases.
86 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
88 Migrate legacy perf dashboard tests to mocha.js based tests
89 https://bugs.webkit.org/show_bug.cgi?id=156335
91 Reviewed by Chris Dumez.
93 Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise
94 for most of asynchronous operations, refactored the tests to use Promises as well, and added more
95 assertions where appropriate.
97 Also consolidated common helper functions into server-tests/resources/common-operations.js.
98 Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were
99 taking an array of reports while others were taking a single report. New shared implementation in
100 common-operations.js now takes a single report.
102 Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout.
103 Most of tests are passing under 100ms on my computer so 1s should be plenty still.
105 * run-tests.js: Removed.
106 * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js.
107 (reportsForDifferentPlatforms):
108 * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js.
109 (.addBuilder): Moved to common-operations.js.
110 * server-tests/api-build-requests-tests.js:
111 * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps.
112 * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js.
113 (.queryPlatformAndMetric):
115 * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js.
116 * server-tests/api-report-tests.js: Moved from tests/api-report.js.
119 (.reportWithSameSubtestName):
120 * server-tests/resources/common-operations.js: Added.
121 (addBuilderForReport): Extracted from tests.
122 (addSlaveForReport): Ditto.
123 (connectToDatabaseInEveryTest): Added.
124 (submitReport): Extracted from admin-platforms-tests.js.
125 * server-tests/resources/test-server.js:
126 (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start
127 its own Apache instance (that would certainly will fail).
128 * server-tests/tools-buildbot-triggerable-tests.js:
130 * tools/js/database.js:
131 (Database.prototype.selectAll): Added.
132 (Database.prototype.selectFirstRow): Added.
133 (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments.
135 2016-04-05 Ryosuke Niwa <rniwa@webkit.org>
137 New buildbot syncing scripts that supports multiple builders and slaves
138 https://bugs.webkit.org/show_bug.cgi?id=156269
140 Reviewed by Chris Dumez.
142 Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves.
143 The old python script (sync-with-buildbot.py) could only support a single builder and slave
144 for each platform, test pair.
146 The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added
147 throughout the codebase and tests have been refactored.
149 BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible
150 for syncing everything on each builder (on a buildbot).
152 Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored
153 test helpers and mocks as needed.
155 * public/v3/models/build-request.js:
156 (BuildRequest.prototype.status): Added.
157 (BuildRequest.prototype.isScheduled): Added.
158 * public/v3/models/metric.js:
159 (Metric.prototype.fullName): Added.
160 * public/v3/models/platform.js:
161 (Platform): Added the map based on platform name.
162 (Platform.findByName): Added.
163 * public/v3/models/test.js:
164 (Test.topLevelTests):
165 (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would
166 find the test whose name is "B" which has a parent test named "A".
167 (Test.prototype.fullName): Added.
168 * server-tests/api-build-requests-tests.js:
169 (addMockData): Moved to resources/mock-data.js.
170 (addAnotherMockTestGroup): Ditto.
171 * server-tests/resources/mock-data.js: Added.
172 (MockData.resetV3Models): Added.
173 (MockData.addMockData): Moved from api-build-requests-tests.js.
174 (MockData.addAnotherMockTestGroup): Ditto.
175 (MockData.mockTestSyncConfigWithSingleBuilder): Added.
176 (MockData.mockTestSyncConfigWithTwoBuilders): Added.
177 (MockData.pendingBuild): Added.
178 (MockData.runningBuild): Added.
179 (MockData.finishedBuild): Added.
180 * server-tests/resources/test-server.js:
182 (TestServer.prototype.remoteAPI):
183 (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit.
184 (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever.
185 (TestServer.prototype._waitForPid): Increase the timeout.
186 (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards.
187 * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce.
189 (MockLogger.prototype.log): Added.
190 (MockLogger.prototype.error): Added.
191 * tools/detect-changes.js:
192 (parseArgument): Moved to js/parse-arguments.js.
193 * tools/js/buildbot-syncer.js:
194 (BuildbotBuildEntry):
195 (BuildbotBuildEntry.prototype.syncer): Added.
196 (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status
197 for a build request (of the matching build request ID) if it needs to be updated in the server.
198 (BuildbotSyncer): This class
199 (BuildbotSyncer.prototype.addTestConfiguration): Added.
200 (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations.
201 (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on
203 (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request.
204 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for
205 the specified build request on the first slave that's available.
206 (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object.
207 Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it.
208 (BuildbotSyncer.prototype._pullRecentBuilds):
209 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now
210 only returns the path instead of the full URL since RemoteAPI takes a path, not full URL.
211 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON.
212 (BuildbotSyncer.prototype.pathForForceBuild): Added.
213 (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL.
214 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
215 (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test
216 configurations associated with it, find the one matching for this request.
217 (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it.
218 (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of
219 slave names present on this builder.
220 * tools/js/buildbot-triggerable.js: Added.
221 (BuildbotTriggerable): Added.
222 (BuildbotTriggerable.prototype.name): Added.
223 (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls
224 existing build requests from the perf dashboard, pulls buildbot for pending and running/completed
225 builds on each builder (represented by each syncer), schedules build requests on buildbot if there
226 is any builder/slave available, and updates the status of build requests in the database.
227 (BuildbotTriggerable.prototype._validateRequests): Added.
228 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added.
229 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added.
230 (BuildbotTriggerable._testGroupMapForBuildRequests): Added.
231 * tools/js/database.js:
232 * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js.
234 * tools/js/remote.js:
235 (RemoteAPI): Now optionally takes the server configuration.
236 (RemoteAPI.prototype.url): Added.
237 (RemoteAPI.prototype.getJSON): Removed the code for specifying request content.
238 (RemoteAPI.prototype.getJSONWithStatus): Ditto.
239 (RemoteAPI.prototype.postJSON): Added.
240 (RemoteAPI.prototype.postFormUrlencodedData): Added.
241 (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth.
242 * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host.
243 * tools/sync-buildbot.js: Added.
244 (main): Added. Parse the arguments and start the loop.
246 * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as
247 scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed.
249 (smallConfiguration): Added.
250 (smallPendingBuild): Added.
251 (smallInProgressBuild): Added.
252 (smallFinishedBuild): Added.
253 (createSampleBuildRequest): Create a unique build request for each platform.
254 (samplePendingBuild): Optionally specify build time and slave name.
255 (sampleInProgressBuild): Optionally specify slave name.
256 (sampleFinishedBuild): Ditto.
257 * unit-tests/resources/mock-remote-api.js:
258 (assert.notReached.assert.notReached):
259 (MockRemoteAPI.url): Added.
260 (MockRemoteAPI.postFormUrlencodedData): Added.
261 (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus.
262 (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we
263 need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI.
264 (MockRemoteAPI.inject):
265 (MockRemoteAPI.reset): Added.
267 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
269 Simplify API of Test model by removing Test.setParentTest
270 https://bugs.webkit.org/show_bug.cgi?id=156055
272 Reviewed by Joseph Pecoraro.
274 Removed Test.setParentTest. Keep track of the child-parent relationship using the static map instead.
276 Now each test only stores parent's id and uses the ID static map in Test.parentTest().
278 * public/v3/models/manifest.js:
279 (Manifest._didFetchManifest.buildObjectsFromIdMap): Removed the code to create the map of child-parent
280 relationship and call setParentTest.
281 * public/v3/models/test.js:
282 (Test): Updated a static map by the name of "childTestMap" to store itself. We should probably sort
283 child tests using some fixed criteria in the future instead of relying on the creation order but
284 preserve the old code's ordering for now.
285 (Test.prototype.parentTest): Look up the static map by the parent test's id.
286 (Test.prototype.onlyContainsSingleMetric):
287 (Test.prototype.setParentTest): Deleted.
288 (Test.prototype.childTests): Look up the child test map.
290 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
292 BuildRequest should have associated platform and test
293 https://bugs.webkit.org/show_bug.cgi?id=156054
295 Reviewed by Joseph Pecoraro.
297 Added methods to retrieve the platform and the test associated with a build request with tests.
299 * public/v3/models/build-request.js:
301 (BuildRequest.prototype.platform): Added.
302 (BuildRequest.prototype.test): Added.
303 * server-tests/api-build-requests-tests.js:
304 * server-tests/api-manifest.js: Fixed a typo. This tests /api/manifest, not /api/build-requests.
305 * unit-tests/buildbot-syncer-tests.js:
306 (.createSampleBuildRequest): Now takes Platform and Test objects to avoid hitting assertions in
307 BuildRequest's constructor.
309 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
311 BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
312 https://bugs.webkit.org/show_bug.cgi?id=156008
314 Reviewed by Darin Adler.
316 Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.
318 Now, new syncing scripts must be able to figure out the build slave the first build requests in
319 a given test group had used in order to schedule subsequent build requests in the test group.
321 For this purpose, /api/build-requests has been modified to return all build requests whose test
322 group had not finished yet. A test group is finished if all build requests in the test group had
323 finished (completed, failed, or canceled).
325 * public/include/build-requests-fetcher.php:
326 (BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
327 groups that have not been finished.
328 * public/v3/models/build-request.js:
330 (BuildRequest.prototype.testGroupId): Added.
331 (BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
332 (BuildRequest.fetchForTriggerable): Added.
333 (BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
335 * public/v3/models/manifest.js:
336 (Manifest.fetch): Use the full path from root so that it works in server tests.
337 * public/v3/models/test-group.js:
338 (TestGroup.hasPending):
339 (TestGroup._createModelsFromFetchedTestGroups):
340 * server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
341 is present in the response returned by /api/build-requests iff any build request in the group had not
344 (.addAnotherMockTestGroup): Added.
345 * unit-tests/test-groups-tests.js:
347 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
349 Make dependency injection in unit tests more explicit
350 https://bugs.webkit.org/show_bug.cgi?id=156006
352 Reviewed by Joseph Pecoraro.
354 Make the dependency injection of model objects in unit tests explicit so that server tests that create
355 "real" model objects won't create these mock objects. Now each test that uses mock model objects would call
356 MockModels.inject() to inject before / beforeEach and access each object using a property on MockModels
357 instead of them being implicitly defined on the global object.
359 Similarly, MockRemoteAPI now only replaces global.RemoteAPI during each test so that server tests can use
360 real RemoteAPI to access the test Apache server.
362 * unit-tests/analysis-task-tests.js:
363 * unit-tests/buildbot-syncer-tests.js:
364 (createSampleBuildRequest):
365 * unit-tests/measurement-adaptor-tests.js:
366 * unit-tests/measurement-set-tests.js:
367 * unit-tests/resources/mock-remote-api.js:
368 (MockRemoteAPI.getJSONWithStatus):
369 (MockRemoteAPI.inject): Added. Override RemoteAPI on the global object during each test.
370 * unit-tests/resources/mock-v3-models.js:
371 (MockModels.inject): Added. Create mock model objects before each test, and clear all static maps of
372 various v3 model classes (to remove all singleton objects for those model classes).
373 * unit-tests/test-groups-tests.js:
375 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
377 BuildbotSyncer should be able to fetch JSON from buildbot
378 https://bugs.webkit.org/show_bug.cgi?id=155921
380 Reviewed by Joseph Pecoraro.
382 Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot
383 with lots of unit tests as this has historically been a source of subtle bugs in the old script.
385 New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that
386 the state of some builds may change between each HTTP request. In the old script, we fetched the list
387 of the pending builds, and requested -1, -2, etc... builds for N times. But between each request,
388 a pending build may start running or an in-progress build finish and shift the offset by one. The new
389 script avoids this problem by first requesting all pending builds, then all in-progress and finished
390 builds in a single HTTP request. The results are then merged so that entries for in-progress and
391 finished builds would override the entries for pending builds if they overlap.
393 Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes
394 the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js).
396 * server-tests/api-build-requests-tests.js:
397 * server-tests/api-manifest.js:
398 * tools/js/buildbot-syncer.js:
399 (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as
400 we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished
401 builds as 'currentStep' is always defined but null in those builds.
402 (BuildbotBuildEntry.prototype.buildNumber): Added.
403 (BuildbotBuildEntry.prototype.isPending): Added.
404 (BuildbotBuildEntry.prototype.hasFinished): Added.
405 (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds.
406 (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds.
407 (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added.
408 (BuildbotSyncer.prototype.urlForBuildJSON): Added.
409 (BuildbotSyncer.prototype.url): Added.
410 (BuildbotSyncer.prototype.urlForBuildNumber): Added.
411 * tools/js/remote.js:
412 (RemoteAPI.prototype.getJSON): Renamed from fetchJSON.
413 (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus.
414 * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node.
415 * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot
416 (samplePendingBuild):
417 (sampleInProgressBuild): Added.
418 (sampleFinishedBuild): Added.
419 * unit-tests/resources/mock-remote-api.js:
420 (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus.
422 2016-03-24 Ryosuke Niwa <rniwa@webkit.org>
424 Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
425 https://bugs.webkit.org/show_bug.cgi?id=155863
427 Reviewed by Joseph Pecoraro.
429 Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability
430 added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed
431 /admin/regenerate-manifest since it has been superseded by /api/manifest.
433 This patch also extracts manifest.js out of main.js so that it could be used and tested without the
436 * public/admin/regenerate-manifest.php: Deleted.
437 * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with
438 a trailing backslash.
439 * public/include/manifest.php:
440 (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories.
441 * public/v3/index.html:
444 * public/v3/models/bug-tracker.js:
445 (BugTracker.prototype.newBugUrl): Added.
446 (BugTracker.prototype.repositories): Added.
447 * public/v3/models/manifest.js: Added. Extracted from main.js.
448 (Manifest.fetch): Moved from main.js' fetchManifest.
449 (Manifest._didFetchManifest): Moved from main.js' didFetchManifest.
450 * public/v3/models/platform.js:
451 (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of
452 the same name. This is tested by the newly added test cases.
453 * server-tests/api-build-requests-tests.js:
454 * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js
455 with additional assertions for v3 UI model objects.
456 * server-tests/resources/test-server.js:
457 (TestServer.prototype.start):
458 (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API.
459 Also no longer takes dataDirectory as an argument since it's always the same.
460 (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data.
461 (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests.
462 (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an
463 unintended side effect of slowing down unit tests even through they don't need Postgres or Apache.
464 * tests/admin-regenerate-manifest.js: Removed.
465 * tools/js/database.js:
466 * tools/js/v3-models.js:
468 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
470 Add mocha server tests for /api/build-requests
471 https://bugs.webkit.org/show_bug.cgi?id=155831
473 Reviewed by Chris Dumez.
475 Added the new mocha.js based server-tests for /api/build-requests. The new harness automatically:
476 - starts a new Apache instance
477 - switches the database during testing via setting an environmental variable
478 - backups and restores public/data directory during testing
480 As a result, developer no longer has to manually setup Apache, edit config.json manually to use
481 a testing database, or run /api/manifest.php to re-generate the manifest file after testing.
483 This patch also makes ID resolution optional on /api/build-requests so that v3 model based syncing
484 scripts can re-use the same code as the v3 UI to process the JSON. tools/sync-with-buildbot.py has
485 been modified to use this option (useLegacyIdResolution).
487 * config.json: Added configurations for the test httpd server.
488 * init-database.sql: Don't error when tables and types don't exist (when database is empty).
489 * public/api/build-requests.php:
490 (main): Made the ID resolution optional with useLegacyIdResolution. Also removed "updates" from the
491 results JSON since it's never used.
492 * public/include/build-requests-fetcher.php:
493 (BuildRequestsFetcher::__construct):
494 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Fixed the bug that we would include the same
495 commit multiple times for each root set.
496 * public/include/db.php:
497 (config): If present, use ORG_WEBKIT_PERF_CONFIG_PATH instead of Websites/perf.webkit.org/config.json.
498 * server-tests: Added.
499 * server-tests/api-build-requests-tests.js: Added. Tests for /api/build-requests.
501 * server-tests/resources: Added.
502 * server-tests/resources/test-server.conf: Added. Apache configuration file for testing.
503 * server-tests/resources/test-server.js: Added.
505 (TestSever.prototype.start): Added.
506 (TestSever.prototype.stop): Added.
507 (TestSever.prototype.remoteAPI): Added. Configures RemoteAPI to be used with the test sever.
508 (TestSever.prototype.database): Added. Returns Database configured to use the test database.
509 (TestSever.prototype._constructTestConfig): Creates config.json for testing. The file is generated by
510 _start and db.php's config() reads it from the environmental variable: ORG_WEBKIT_PERF_CONFIG_PATH.
511 (TestSever.prototype._ensureDataDirectory): Renames public/data to public/original-data if exists,
512 and creates a new empty public/data.
513 (TestSever.prototype._restoreDataDirectory): Deletes public/data and renames public/original-data
515 (TestSever.prototype._ensureTestDatabase): Drops the test database if exists and creates a new one.
516 (TestSever.prototype.initDatabase): Run init-database.sql to start each test with a consistent state.
517 (TestSever.prototype._executePgsqlCommand): Executes a postgres command line tool such as psql.
518 (TestSever.prototype._determinePgsqlDirectory): Finds the directory that contains psql.
519 (TestSever.prototype._startApache): Starts an Apache instance for testing.
520 (TestSever.prototype._stopApache): Stops the Apache instance for testing.
521 (TestSever.prototype._waitForPid): Waits for the Apache pid file to appear or disappear.
522 (before): Start the test server at the beginning.
523 (beforeEach): Re-initialize all tables before each test.
524 (after): Stop the test server at the end.
525 * tools/js/config.js:
526 (Config.prototype.path):
527 (Config.prototype.serverRoot): Added. The path to Websites/perf.webkit.org/public/.
528 (Config.prototype.pathFromRoot): Added. Resolves a path from Websites/perf.webkit.org.
529 * tools/js/database.js:
530 (Database): Now optionally takes the database name to use a different database during testing.
531 (Database.prototype.connect):
532 (Database.prototype.query): Added.
533 (Database.prototype.insert): Added.
534 (tableToPrefixMap): Maps table name to its prefix. Used by Database.insert.
535 * tools/js/remote.js: Added.
536 (RemoteAPI): Added. This is node.js equivalent of RemoteAPI in public/v3/remote.js.
537 (RemoteAPI.prototype.configure): Added.
538 (RemoteAPI.prototype.fetchJSON): Added.
539 (RemoteAPI.prototype.fetchJSONWithStatus): Added.
540 (RemoteAPI.prototype.sendHttpRequest): Added.
541 * tools/sync-with-buildbot.py:
542 (main): Use useLegacyIdResolution as this script relies on the legacy behavior.
543 * unit-tests/checkconfig.js: pg was never directly used in this test.
545 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
547 Delete a file that was supposed to be removed in r198614 for real.
549 * unit-tests/resources/v3-models.js: Removed.
551 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
553 Add a model for parsing buildbot JSON with unit tests
554 https://bugs.webkit.org/show_bug.cgi?id=155814
556 Reviewed by Joseph Pecoraro.
558 Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests.
559 They will be used in the new syncing scripts to improve A/B testing.
561 * public/v3/models/build-request.js:
563 * tools/js/buildbot-syncer.js: Added.
564 (BuildbotBuildEntry): Added.
565 (BuildbotBuildEntry.prototype.slaveName): Added.
566 (BuildbotBuildEntry.prototype.buildRequestId): Added.
567 (BuildbotBuildEntry.prototype.isInProgress): Added.
568 (BuildbotSyncer): Added.
569 (BuildbotSyncer.prototype.testPath): Added.
570 (BuildbotSyncer.prototype.builderName): Added.
571 (BuildbotSyncer.prototype.platformName): Added.
572 (BuildbotSyncer.prototype.fetchPendingRequests): Added.
573 (BuildbotSyncer.prototype._propertiesForBuildRequest): Added.
574 (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added.
575 (BuildbotSyncer._loadConfig): Added.
576 (BuildbotSyncer._validateAndMergeConfig): Added.
577 (BuildbotSyncer._validateAndMergeProperties): Added.
578 * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js.
579 (beforeEach): Deleted since this only defined inside mocha.
580 * unit-tests/analysis-task-tests.js:
581 * unit-tests/buildbot-syncer-tests.js: Added.
583 (createSampleBuildRequest):
584 (.smallConfiguration):
585 * unit-tests/measurement-adaptor-tests.js:
586 * unit-tests/measurement-set-tests.js:
587 * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js.
589 * unit-tests/test-groups-tests.js:
592 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
594 Add unit tests for test-group.js
595 https://bugs.webkit.org/show_bug.cgi?id=155781
597 Reviewed by Joseph Pecoraro.
599 Added unit tests for test-group.js that would have caught regressions fixed in r198503.
601 * public/v3/components/chart-pane-base.js:
602 (ChartPaneBase.prototype._renderAnnotations): Added a forgotten break statement.
603 * public/v3/models/build-request.js:
604 (BuildRequest.prototype.setResult):
606 * public/v3/models/test-group.js:
607 * unit-tests/measurement-set-tests.js: Use ./resources/v3-models.js to reduce the code duplication.
608 * unit-tests/resources/v3-models.js: Import more stuff from v3 models.
610 * unit-tests/test-groups-tests.js: Added. Added some unit tests for TestGroup.
612 (.testGroupWithStatusList):
614 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
620 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
622 Commit log viewer repaints too frequently after r198499
623 https://bugs.webkit.org/show_bug.cgi?id=155732
625 Reviewed by Joseph Pecoraro.
627 The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
628 if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
629 and avoiding work in the commit log viewer when the requested repository and the revision range were
630 the same as those of the last request.
632 * public/v3/components/commit-log-viewer.js:
634 (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
635 identical to the one we already have to avoid repaints and issuing multiple network requests.
636 * public/v3/components/interactive-time-series-chart.js:
637 (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
638 indicator hadn't changed.
639 * public/v3/pages/chart-pane.js:
640 (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
641 the URL. We need to check whether the lock state had changed. The old condition was also redundant
642 since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
644 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
646 Fix A/B testing after r198503.
648 * public/include/build-requests-fetcher.php:
650 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
652 Analysis task page is broken after r198479
653 https://bugs.webkit.org/show_bug.cgi?id=155735
655 Rubber-stamped by Chris Dumez.
657 * public/api/measurement-set.php:
658 (AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
659 * public/include/build-requests-fetcher.php:
660 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
661 * public/v3/models/commit-log.js:
662 (CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
663 * public/v3/models/root-set.js:
664 (RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
665 we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
666 find the repository with "[object]" as the ID.
667 * public/v3/models/test-group.js:
668 (TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.
670 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
672 v3 UI sometimes don't update the list of revisions on the commit log viewer
673 https://bugs.webkit.org/show_bug.cgi?id=155729
675 Rubber-stamped by Chris Dumez.
677 Fixed multiple bugs that were affecting the list of blame range and commit logs for the range weren't
678 updated in some cases on v3 UI. Also, the commit log viewer state is now a part of the URL state so
679 opening and closing the commit log viewer will persist across page loads.
681 Also fixed a regression from r198479 that Test object can't be created for a top level test.
683 * public/v3/components/chart-pane-base.js:
684 (ChartPaneBase.prototype.configure):
685 (ChartPaneBase.prototype._mainSelectionDidChange): Fixed the bug that the list of blame range nor the
686 commit log viewer don't get updated when the selected range changes.
687 (ChartPaneBase.prototype._indicatorDidChange):
688 (ChartPaneBase.prototype._didFetchData):
689 (ChartPaneBase.prototype._updateStatus): Extracted from _indicatorDidChange and _didFetchData.
690 (ChartPaneBase.prototype._requestOpeningCommitViewer): Renamed from _openCommitViewer.
692 * public/v3/components/chart-status-view.js:
693 (ChartStatusView.prototype.updateStatusIfNeeded): Fixed the bug that the blame range doesn't get set
694 on the initial page load when the selection range is set but the chart data hadn't been fetched yet.
696 * public/v3/components/commit-log-viewer.js:
697 (CommitLogViewer.prototype.view): Fixed the bug that we don't clear out the old list of commits while
698 loading the next set of commits to show as it looked as if the list was never updated.
699 (CommitLogViewer.prototype.render): Fixed the bug that the view always show the last repository name
700 even if there were nothing being fetched or commits to show.
702 * public/v3/components/pane-selector.js:
703 (PaneSelector.prototype.focus): Removed superfluous call to console.log.
705 * public/v3/models/data-model.js:
706 (DataModelObject.listForStaticMap): Generalized the code for all to fix the bug in Test.
707 (DataModelObject.all):
709 * public/v3/models/test.js:
710 (Test): Fixed the bug that this code was relying on the static map to be an array.
711 (Test.topLevelTests): Use newly added listForStaticMap to convert the dictionary to an array.
713 * public/v3/pages/chart-pane-status-view.js:
714 (ChartPaneStatusView): Always initialize _usedRevisionRange as a triple to simplify code elsewhere.
715 (ChartPaneStatusView.prototype.render): Invoke _revisionCallback when user clicks on a repository
716 expansion mark (>>). Also fixed click handler from the row since this made selecting revision range
717 on the view cumbersome. Now user has to explicitly click on the expansion mark (>>).
718 (ChartPaneStatusView.prototype._setRevisionRange): Now takes shouldNotify, from, and to as arguments
719 as this function must not invoke_revisionCallback inside _updateRevisionListForNewCurrentRepository.
720 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Use newly added setCurrentRepository
721 instead of manually invoking setCurrentRepository and updateRevisionListWithNotification.
722 (ChartPaneStatusView.prototype.setCurrentRepository): Fixed the bug that we weren't updating the
724 (ChartPaneStatusView.prototype.updateRevisionList): Renamed from updateRevisionListWithNotification
725 since we no longer call _revisionCallback. In general, callbacks are only meant to communicate user
726 initiated actions, and not program induced updates like this API so this was a bad pattern anyway.
727 ChartPane now explicitly updates the commit log viewer instead of relying on this function calling
728 _requestOpeningCommitViewer implicitly.
729 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Extracted from
730 updateRevisionListWithNotification so that setCurrentRepository can also call this function.
732 * public/v3/pages/chart-pane.js:
733 (ChartPane.prototype._requestOpeningCommitViewer): Overrides ChartPaneBase's method. Open the same
734 repository in other panes via ChartsPage.setOpenRepository.
735 (ChartPane.prototype.setOpenRepository): This method is called when the user selected a repository in
736 another pane. Open the same repository in this pane if it wasn't already open.
738 * public/v3/pages/charts-page.js:
739 (ChartsPage): Added this._currentRepositoryId.
740 (ChartsPage.prototype.serializeState): Serialize _currentRepositoryId.
741 (ChartsPage.prototype.updateFromSerializedState): Set the commit log viewer's
742 (ChartsPage.prototype.setOpenRepository): Added.
744 * tests/api-measurement-set.js: Fixed a test after r198479.
746 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
748 V3 Perf Dashboard should automatically select initial range when creating a new task
749 https://bugs.webkit.org/show_bug.cgi?id=155677
751 Reviewed by Joseph Pecoraro.
753 Select the entire range of points for which the analysis task is created by default so that creating
754 a test group to confirm the regression / progression is easy.
756 * public/v3/pages/analysis-task-page.js:
757 (AnalysisTaskPage): Added a boolean flag which indicates the user had modified main chart's selection.
758 * public/v3/pages/analysis-task-page.js:
759 (AnalysisTaskPage.prototype.render): Set the main chart's selection to the entire range of points in
760 the analysis task if the user had never modified selection.
761 (AnalysisTaskPage.prototype._chartSelectionDidChange): This callback is invoked only when the user had
762 modified the selection so set _selectionWasModifiedByUser true here unconditionally.
764 2016-03-19 Ryosuke Niwa <rniwa@webkit.org>
766 Associated commits don't immediately show up on an analysis task page
767 https://bugs.webkit.org/show_bug.cgi?id=155692
769 Reviewed by Darin Adler.
771 The bug was caused by resolveCommits in AnalysisTask._constructAnalysisTasksFromRawData not being
772 able to find the matching commit log if the commit log had been created by the charts which don't
773 set the remote identifiers on each CommitLog objects.
775 Fixed the bug by modifying /api/measurement-set to include the commit ID, and making CommitLog
776 use the real database ID as its ID instead of a fake ID we create from repository and revision.
778 Also added a bunch of Mocha unit tests for AnalysisTask.fetchAll.
780 * public/api/measurement-set.php:
781 (MeasurementSetFetcher::execute_query): Fetch commit_id.
782 (MeasurementSetFetcher::format_run): Use pass-by-reference to avoid making a copy of the row.
783 (MeasurementSetFetcher::parse_revisions_array): Include commit_id as the first item in the result.
784 * public/v3/instrumentation.js:
785 * public/v3/models/analysis-task.js:
786 (AnalysisTask): Fixed a bug that _buildRequestCount and _finishedBuildRequestCount could be kept
787 as strings and hasPendingRequests() could return a wrong result because it would perform string
788 inequality instead of numerical inequality.
789 (AnalysisTask.prototype.updateSingleton): Ditto.
790 (AnalysisTask.prototype.dissociateCommit):
791 (AnalysisTask._constructAnalysisTasksFromRawData):
792 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Use findById now that CommitLog
793 objects all use the same id as the database id.
794 * public/v3/models/commit-log.js:
796 (CommitLog.prototype.remoteId): Deleted since we no longer create a fake id for commit logs for
798 (CommitLog.findByRemoteId): Deleted.
799 (CommitLog.ensureSingleton): Deleted.
800 (CommitLog.fetchBetweenRevisions):
802 * public/v3/models/data-model.js:
803 (DataModelObject.clearStaticMap): Added to aid unit testing.
804 (DataModelObject.ensureNamedStaticMap): Fixed a typo. Each map is a dictionary, not an array.
805 * public/v3/models/metric.js:
806 * public/v3/models/platform.js:
807 * public/v3/models/root-set.js:
808 (RootSet): Updated per the interface change in CommitLog.ensureSingleton.
809 (MeasurementRootSet): Updated per /api/measurement-set change. Use the first value as the id.
810 * public/v3/models/test.js:
811 * unit-tests/analysis-task-tests.js: Added.
812 (sampleAnalysisTask):
813 (measurementCluster):
814 * unit-tests/checkconfig.js: Added some assertion message to help aid diagnosing the failure.
815 * unit-tests/measurement-adaptor-tests.js: Updated the sample data per the API change in
816 /api/measurement-set and also added assertions for commit log ids.
817 * unit-tests/measurement-set-tests.js:
819 * unit-tests/resources: Added.
820 * unit-tests/resources/mock-remote-api.js: Added. Extracted from measurement-set-tests.js to be
821 used in analysis-task-tests.js.
822 (assert.notReached.assert.notReached):
823 (global.RemoteAPI.getJSON):
824 (global.RemoteAPI.getJSONWithStatus):
826 * unit-tests/resources/v3-models.js: Added. Extracted from measurement-set-tests.js to be used in
827 analysis-task-tests.js and added more imports as needed.
831 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
833 Build fix after r198464.
835 * public/v3/components/analysis-results-viewer.js:
836 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
838 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
840 Build fix after r198234.
842 * public/api/commits.php:
843 (main): Typo: fetch_latest_reported -> fetch_last_reported.
844 * public/include/commit-log-fetcher.php:
845 (CommitLogFetcher::format_single_commit): commits should be an array.
847 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
849 Perf Dashboard v3 confuses better and worse on A/B task page
850 https://bugs.webkit.org/show_bug.cgi?id=155675
851 <rdar://problem/25208723>
853 Reviewed by Joseph Pecoraro.
855 The analysis results viewer on v3 UI sometimes treats regressions as progressions and vice versa when
856 the first set (i.e. set A) of the revisions used in an A/B testing never appears in the original graph,
857 and its latest commit time matches that of the second set, which appears in the original graph.
859 Because the analysis results viewer compares results in the increasing row number, this results in
860 B to be compared to A instead of A to be compared to B. Fixed the bug by preventing the wrong ordering
861 to occur in _buildRowsForPointsAndTestGroups by always inserting a root set A before B when B appears
862 and A doesn't appear in the original graph.
864 * public/v3/components/analysis-results-viewer.js:
865 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Remember the succeeding root set B
866 when creating an entry for root set A.
867 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Fixed the bug. Also un-duplicated
868 the code to create a new row.
869 (AnalysisResultsViewer.RootSetInTestGroup): Now takes a succeeding root set. e.g. it's B for A and
870 undefined for B in A/B testing.
871 (AnalysisResultsViewer.RootSetInTestGroup.prototype.succeedingRootSet): Added.
872 * public/v3/components/time-series-chart.js:
873 (TimeSeriesChart.computeTimeGrid): Fixed the bug that we would end up showing 0 AM instead of dates
874 when both dates and months change.
876 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
878 Add unit tests for measurement-set.js and measurement-adapter.js
879 https://bugs.webkit.org/show_bug.cgi?id=155673
881 Reviewed by Daniel Bates.
883 Add tests which were supposed to be added in r198462.
885 * unit-tests/measurement-adaptor-tests.js: Added.
886 * unit-tests/measurement-set-tests.js: Added.
887 (assert.notReached): Added.
888 (global.RemoteAPI.getJSON): Added.
889 (global.RemoteAPI.getJSONWithStatus): Added. A mock.
891 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
893 Add unit tests for measurement-set.js and measurement-adapter.js
894 https://bugs.webkit.org/show_bug.cgi?id=155673
896 Reviewed by Darin Adler.
898 Added mocha unit tests for MeasurementSet and MeasurementAdapter classes along with the necessary
899 refactoring to run these tests in node.
901 getJSON and getJSONStatus are now under RemoteAPI so that unit tests can mock them.
903 Removed the dependency on v2 UI's TimeSeries and Measurement class by adding a new implementation
904 of TimeSeries in v3 and removing the dependency on Measurement in chart-pane-status-view.js with
905 new helper methods on Build and CommitLog.
907 Many js files now use 'use strict' (node doesn't support class syntax in non-strict mode) and
908 module.exports to export symbols in node's require function.
910 * public/v3/index.html:
912 * public/v3/models/analysis-results.js:
913 (AnalysisResults.fetch):
914 * public/v3/models/analysis-task.js:
915 (AnalysisTask.fetchAll):
916 * public/v3/models/builder.js:
918 (Build.prototype.builder): Added. Used by ChartPaneStatusView.
919 (Build.prototype.buildNumber): Ditto.
920 (Build.prototype.buildTime): Ditto.
921 * public/v3/models/commit-log.js:
922 (CommitLog.prototype.diff): Ditto.
923 (CommitLog.fetchBetweenRevisions):
924 * public/v3/models/data-model.js:
925 (DataModelObject.cachedFetch):
926 * public/v3/models/measurement-adaptor.js:
927 (MeasurementAdaptor.prototype.applyToAnalysisResults): Renamed from adoptToAnalysisResults.
928 (MeasurementAdaptor.prototype.applyTo): Renamed from adoptToSeries. Now shares a lot more
929 code with applyToAnalysisResults. The code to set 'series' and 'seriesIndex' has been moved
930 to TimeSeries.append. 'measurement' is no longer needed as this patch removes its only use
931 in ChartPaneStatusView.
932 * public/v3/models/measurement-cluster.js:
933 (MeasurementCluster.prototype.addToSeries): Use TimeSeries.append instead of directly mutating
935 * public/v3/models/measurement-set.js:
936 (Array.prototype.includes): Added a polyfill for node.
937 (MeasurementSet.prototype._fetchSecondaryClusters): Removed a bogus assertion. When fetchBetween
938 is called with a mixture of clusters that have been fetched and not fetched, this assertion fails.
939 (MeasurementSet.prototype._fetch):
940 (TimeSeries.prototype.findById): Moved to time-series.js.
941 (TimeSeries.prototype.dataBetweenPoints): Ditto.
942 (TimeSeries.prototype.firstPoint): Ditto.
943 (TimeSeries.prototype.fetchedTimeSeries): Moved the code to extend the last point to TimeSeries'
945 * public/v3/models/repository.js:
946 * public/v3/models/root-set.js:
947 (MeasurementRootSet): Ignore repositories that had not been defined (e.g. it could be added after
948 manifest.json had been downloaded but before a given root set is created for an A/B testing).
949 * public/v3/models/time-series.js:
951 (TimeSeries.prototype.append): Added.
952 (TimeSeries.prototype.extendToFuture): Added.
953 (TimeSeries.prototype.firstPoint): Moved from measurement-set.js.
954 (TimeSeries.prototype.lastPoint): Added.
955 (TimeSeries.prototype.previousPoint): Added.
956 (TimeSeries.prototype.nextPoint): Added.
957 (TimeSeries.prototype.findPointByIndex): Added.
958 (TimeSeries.prototype.findById): Moved from measurement-set.js.
959 (TimeSeries.prototype.findPointAfterTime): Added.
960 (TimeSeries.prototype.dataBetweenPoints): Moved from measurement-set.js.
961 * public/v3/pages/chart-pane-status-view.js:
962 (ChartPaneStatusView.prototype.render): Use newly added helper functions on Build.
963 (ChartPaneStatusView.prototype._formatTime): Added.
964 (ChartPaneStatusView.prototype.setCurrentRepository):
965 (ChartPaneStatusView.prototype.computeChartStatusLabels): Rewrote the code using RootSet object on
966 currentPoint and previousPoint instead of Measurement class from v2 UI. Also sort the results using
967 sortByNamePreferringOnesWithURL.
968 * public/v3/remote.js:
969 (RemoteAPI.getJSON): Moved under RemoteAPI.
970 (RemoteAPI.getJSONWithStatus): Ditto.
972 (PrivilegedAPI.requestCSRFToken):
974 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
976 Add unit tests for config.json and statistics.js
977 https://bugs.webkit.org/show_bug.cgi?id=155626
979 Reviewed by Darin Adler.
981 Added mocha unit tests for statistics.js and validating config.json. For segmentations, I've extracted
982 real data from our internal perf dashboard.
984 Also fixed some bugs covered by these new tests.
986 * public/shared/statistics.js:
987 (Statistics.movingAverage): Fixed a bug that forwardWindowSize was never used.
988 (Statistics.exponentialMovingAverage): Fixed the bug that the moving average starts at 0. It should
989 start at the first value instead.
990 (.splitIntoSegmentsUntilGoodEnough): Fixed the bug that we may try to segment a time series into
991 more parts than there are data points. Clearly, that doesn't make any sense.
992 (.findOptimalSegmentation): Renamed local variables so that they're more descriptive, and rewrote
993 the debugging code was the old code was emitting some useless data. Also fixed the bug that the length
994 of "segmentation" was off by one (we need segmentCount + 1 elements in the array sine we always
995 include the start of the first segment = 0 and the end of the last segment = values.length).
996 (.SampleVarianceUpperTriangularMatrix):
997 (Statistics): Modernized the export code.
999 * tools/js/config.js: Added.
1001 (Config.prototype.configFilePath): Added.
1002 (Config.prototype.value): Added.
1003 (Config.prototype.path): Added.
1004 * tools/js/database.js: Added.
1006 (Database.prototype.connect): Added.
1007 (Database.prototype.disconnect): Added.
1008 * unit-tests: Added.
1009 * unit-tests/checkconfig.js: Added. Validates config.json. This is useful while setting up
1010 a local instance of the perf dashboard.
1011 * unit-tests/statistics-tests.js: Added.
1012 (assert.almostEqual): Added. Asserts that two floating values are within a given significant digits.
1017 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1019 Fix a typo which was supposed to be fixed in r198351.
1021 * public/v3/pages/analysis-task-page.js:
1022 (AnalysisTaskPage.prototype.render):
1024 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1026 An analysis task should be closed if a progression cause is identified
1027 https://bugs.webkit.org/show_bug.cgi?id=155549
1029 Reviewed by Chris Dumez.
1031 Since a progression is desirable, we should close an analysis task once its cause is identified.
1033 Also fix some typos.
1035 * init-database.sql: Fixed a typo.
1036 * public/api/analysis-tasks.php:
1037 * public/v3/models/analysis-task.js:
1038 (AnalysisTask.prototype.dissociateBug): Renamed from dissociateBug.
1039 * public/v3/pages/analysis-task-page.js:
1040 (AnalysisTaskPage.prototype.render):
1041 (AnalysisTaskPage.prototype._dissociateBug): Renamed from _dissociateBug.
1042 (AnalysisTaskPage.prototype._dissociateCommit): Fixed the typo in the alert.
1044 2016-03-16 Ryosuke Niwa <rniwa@webkit.org>
1046 Analysis task page should allow specifying commits that caused or fixed a regression or a progression
1047 https://bugs.webkit.org/show_bug.cgi?id=155529
1049 Reviewed by Chris Dumez.
1051 Added the capability to associate revisions that caused or fixed a progression or a regression for which
1052 an analysis task was created. Added task_commits that stores this relationship and added the backend
1053 support to retrieve this table in /api/analysis-tasks and an privileged API to update this table at
1054 /privileged-api/associate-commit.
1056 Also extracted a new component, MutableListView, out of AnalysisTaskPage to render and manipulate a list
1057 of mutable items, and used it to render the list of associated bugs and commits. The view takes a list of
1058 kinds (e.g. repositories or bug trackers), and accepts a pair of a kind and arbitrary text as a new item
1061 * init-database.sql: Added task_commits table.
1063 * public/api/analysis-tasks.php:
1065 (fetch_associated_data_for_tasks): Renamed from fetch_and_push_bugs_to_tasks now that it also fetches
1066 the list of commits associated with each analysis task by calling CommitLogFetcher::fetch_for_tasks.
1067 Also fixe the bug that we were not taking
1068 (format_task): No longer sets 'category' since the computation of category now depends on the list of
1069 commits associated with this analysis task which aren't available until fetch_associated_data_for_tasks.
1070 (determine_category): Added. Categorize any analysis tasks with "fixes" commits as "closed" and "causes"
1071 commits as "identified".
1073 * public/include/commit-log-fetcher.php:
1074 (CommitLogFetcher::__construct): Remove the unused instance variable.
1075 (CommitLogFetcher::fetch_for_tasks): Added. Fetches all commits associated with a list of analysis tasks.
1076 Assumes the caller (fetch_associated_data_for_tasks) had setup "fixes" and "causes" fields on each task.
1078 * public/privileged-api/associate-commit.php: Added. Updates task_commits table to associate or disassociate
1079 a commit with an analysis task. When the specified analysis task and the specified commit are already
1080 associated, we simply update the table instead of adding a duplicating entry or error. For dissociation,
1081 the front-end specifies the commit ID.
1084 * public/v3/index.html:
1085 * public/v3/components/mutable-list-view.js: Added. Used by the list associated bugs and commits.
1086 (MutableListView): Added.
1087 (MutableListView.prototype.setList): Added.
1088 (MutableListView.prototype.setKindList): Added.
1089 (MutableListView.prototype.setAddCallback): Added. This callback is invoked when the user tries to add
1090 a new item to the list.
1091 (MutableListView.prototype.render): Added.
1092 (MutableListView.prototype._submitted): Added.
1093 (MutableListView.cssTemplate):
1094 (MutableListView.htmlTemplate):
1095 (MutableListItem): Added. RemovalLink could be a hyperlink or a callback and gets involved when the user
1096 tries to delete this item.
1097 (MutableListItem.prototype.content):
1099 * public/v3/models/analysis-task.js:
1100 (AnalysisTask): Added the support of the list of commits that fixed and caused changes.
1101 (AnalysisTask.prototype.updateSingleton): Ditto.
1102 (AnalysisTask.prototype.causes): Added.
1103 (AnalysisTask.prototype.fixes): Added.
1104 (AnalysisTask.prototype.associateCommit): Added. Use the API added at /privileged-api/associate-commit
1105 to associate a new commit with this analysis task. Each commit has either caused or fixed the change.
1106 (AnalysisTask.prototype.dissociateCommit): Added. Use the same API to disassociate each commit.
1107 (AnalysisTask._constructAnalysisTasksFromRawData): Find all commits associated with each analysis task.
1108 Because commit log objects use a fake ID fdue to /api/measurement-set not providing commit IDs, we must
1109 use CommitLog.findByRemoteId to find each commit instead of usual CommitLog.findById.
1110 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Added.
1112 * public/v3/models/build-request.js:
1113 (BuildRequest.prototype.hasFinished): Renamed from hasCompleted since it was confusing for this._status
1114 being "completed" wasn't a necessary condition for this function to return true.
1116 * public/v3/models/commit-log.js:
1117 (CommitLog): Added the static map for actual commit ID instead of a fake ID created in ensureSingleton.
1118 (CommitLog.prototype.remoteId): Added. Returns the real commit ID.
1119 (CommitLog.findByRemoteId): Added. Finds an CommitLog object using the real ID.
1121 * public/v3/models/test-group.js:
1122 (TestGroup.prototype.hasFinished): Renamed from hasCompleted to match the rename in BuildRequest.
1124 * public/v3/pages/analysis-task-page.js:
1125 (AnalysisTaskPage): Added lists for the commits that fixed and caused the change using MutableListView.
1126 Also adopted MutableListView for the list of associated bugs.
1127 (AnalysisTaskPage.prototype.render): Added the code to populate the newly added lists.
1128 (AnalysisTaskPage.prototype._makeCommitListItem): Added.
1129 (AnalysisTaskPage.prototype._associateBug): Now this is a callback from MutableListView.
1130 (AnalysisTaskPage.prototype._associateCommit): Added.
1131 (AnalysisTaskPage.prototype._dissociateCommit): Added.
1132 (AnalysisTaskPage.htmlTemplate):
1133 (AnalysisTaskPage.cssTemplate):
1135 * public/v3/remote.js:
1136 (getJSON): Spit out the entire responseText when JSON failed to parse to make debugging easier.
1138 2016-03-15 Ryosuke Niwa <rniwa@webkit.org>
1140 Extract the code to format commit logs into its own PHP file
1141 https://bugs.webkit.org/show_bug.cgi?id=155514
1143 Rubber-stamped by Chris Dumez.
1145 Extracted CommitLogFetcher out of /api/commits so that it could be used in analysis-tasks.php
1146 in the future to support associating cause/fix for each analysis task.
1148 * public/api/commits.php:
1149 * public/include/commit-log-fetcher.php: Added.
1151 (CommitLogFetcher::__construct): Added.
1152 (CommitLogFetcher::repository_id_from_name): Added.
1153 (CommitLogFetcher::fetch_between): Added.
1154 (CommitLogFetcher::fetch_oldest): Added.
1155 (CommitLogFetcher::fetch_latest): Added.
1156 (CommitLogFetcher::fetch_last_reported): Added.
1157 (CommitLogFetcher::fetch_revision): Added.
1158 (CommitLogFetcher::commit_for_revision): Added.
1159 (CommitLogFetcher::format_single_commit): Added.
1160 (CommitLogFetcher::format_commit): Added.
1162 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1164 Build fix after r196870.
1166 * public/include/report-processor.php:
1168 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1170 Add Size metric to perf dashboard
1171 https://bugs.webkit.org/show_bug.cgi?id=155266
1173 Reviewed by Chris Dumez.
1175 Added the "Size" metric and use bytes as its unit.
1177 * public/js/helper-classes.js:
1179 * public/v2/data.js:
1180 (RunsData.unitFromMetricName):
1182 2016-02-20 Ryosuke Niwa <rniwa@webkit.org>
1184 Add the support for universal slave password
1185 https://bugs.webkit.org/show_bug.cgi?id=154476
1187 Reviewed by David Kilzer.
1189 Added the support for universalSlavePassword.
1192 * public/include/report-processor.php:
1193 (ReportProcessor::process):
1194 (ReportProcessor::authenticate_and_construct_build_data): Extracted from process().
1196 2016-02-19 Ryosuke Niwa <rniwa@webkit.org>
1198 Analysis tasks page complains about missing repository but with a wrong name
1199 https://bugs.webkit.org/show_bug.cgi?id=154468
1201 Reviewed by Chris Dumez.
1203 Fixed the bug by using the right variable in the template literal.
1205 * public/v3/components/customizable-test-group-form.js:
1206 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use querySelector here since Chrome doesn't have
1207 getElementsByClassName on ShadowRoot.
1208 * public/v3/pages/analysis-task-page.js:
1209 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Use name which is the name of
1212 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1214 Revert an unintended change made in the previous commit.
1216 * init-database.sql:
1218 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1220 Perf dashboard should let user cancel pending A/B testing and hide failed ones
1221 https://bugs.webkit.org/show_bug.cgi?id=154433
1223 Reviewed by Chris Dumez.
1225 Added a button to hide a test group in the details view (the bottom table) in the analysis task page, and
1226 "Show hidden tests" link to show the hidden test groups on demand. When a test group is hidden, all pending
1227 requests in the group will also be canceled since a common scenario of using this feature is that the user
1228 had triggered an useless A/B testing; e.g. all builds will fail, wrong, etc... We can revisit and add the
1229 capability to just cancel the pending requests and leaving the group visible later if necessary.
1231 Run `ALTER TYPE build_request_status_type ADD VALUE 'canceled';` to add the new type.
1233 * init-database.sql: Added testgroup_hidden column to analysis_test_groups table and added 'canceled'
1234 as a value to build_request_status_type table.
1235 * public/api/test-groups.php:
1236 (format_test_group): Added 'hidden' field in the JSON result.
1237 * public/privileged-api/update-test-group.php:
1238 (main): Added the support for updating testgroup_hidden column. When this column is set to true, also
1239 cancel all pending build requests (by setting its request_status to 'canceled' which will be ignore by
1240 the syncing script).
1241 * public/v3/components/test-group-results-table.js:
1242 (TestGroupResultsTable.prototype.setTestGroup): Reset _renderedTestGroup here so that the next call to
1243 render() will update the table; e.g. when build requests' status change from 'Pending' to 'Canceled'.
1244 * public/v3/models/build-request.js:
1245 (BuildRequest.prototype.hasCompleted): A build request is considered complete/finished if it's canceled.
1246 (BuildRequest.prototype.hasPending): Added.
1247 (BuildRequest.prototype.statusLabel): Handle 'canceled' status.
1248 * public/v3/models/test-group.js:
1250 (TestGroup.prototype.updateSingleton): Added to update 'hidden' field.
1251 (TestGroup.prototype.isHidden): Added.
1252 (TestGroup.prototype.hasPending): Added.
1253 (TestGroup.prototype.hasPending): Added.
1254 (TestGroup.prototype.updateHiddenFlag): Added. Uses the privileged API to update testgroup_hidden column.
1255 The JSON API also updates the status of the 'pending' build requests in the group to 'canceled'.
1256 * public/v3/pages/analysis-task-page.js:
1257 (AnalysisTaskPage): Added _showHiddenTestGroups and _filteredTestGroups as instance variables.
1258 (AnalysisTaskPage.prototype._didFetchTestGroups):
1259 (AnalysisTaskPage.prototype._showAllTestGroups): Added.
1260 (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState): Extracted from _didFetchTestGroups.
1261 (AnalysisTaskPage.prototype._renderTestGroupList): Use the filtered list of test groups to show the list
1262 of test groups. When all test groups are shown, we would first show the hidden ones after the regular ones.
1263 (AnalysisTaskPage.prototype._createTestGroupListItem): Extracted from _renderTestGroupList.
1264 (AnalysisTaskPage.prototype._renderTestGroupDetails): Update the text inside the button to hide the test
1265 group. Also show a warning text that the pending requests will be canceled if there are any.
1266 (AnalysisTaskPage.prototype._hideCurrentTestGroup): Added.
1267 (AnalysisTaskPage.cssTemplate): Updated the style.
1269 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1271 The rows in the analysis results table should be expandable
1272 https://bugs.webkit.org/show_bug.cgi?id=154427
1274 Reviewed by Chris Dumez.
1276 Added "(Expand)" link between rows that have hidden points. Upon click it inserts the hidden rows.
1278 We insert around five rows at a time when there are hundreds of hidden points but we also avoid leaving
1279 behind expandable rows of less than two rows.
1281 Also fixed a bug in CustomizableTestGroupForm that getElementsById would throw in the shipping Safari
1282 because getElementsById doesn't exist on Element.prototype by using class name instead.
1284 * public/v3/components/analysis-results-viewer.js:
1285 (AnalysisResultsViewer):
1286 (AnalysisResultsViewer.prototype.setCurrentTestGroup): Removed superfluous call to render().
1287 (AnalysisResultsViewer.prototype.setPoints): Always show the start and the end points.
1288 (AnalysisResultsViewer.prototype.buildRowGroups):
1289 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Add an instance of ExpandableRow which
1290 shows a "(Expand)" link to show hidden rows here.
1291 (AnalysisResultsViewer.prototype._expandBetween): Added. Expands rows between two points.
1292 (AnalysisResultsViewer.cssTemplate): Added rules for "(Expand)" links.
1293 (AnalysisResultsViewer.ExpandableRow): Added.
1294 (AnalysisResultsViewer.ExpandableRow.prototype.resultContent): Added. Overrides what's in the results column.
1295 (AnalysisResultsViewer.ExpandableRow.prototype.heading): Added. Generates "(Expand)" link.
1297 * public/v3/components/customizable-test-group-form.js:
1298 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use getElementsByClassName instead of
1300 (CustomizableTestGroupForm.prototype._classForLabelAndRepository): Renamed from _idForLabelAndRepository.
1301 (CustomizableTestGroupForm._constructRevisionRadioButtons): Set class name instead of id.
1303 * public/v3/components/results-table.js:
1304 (ResultsTable.prototype.render): Don't generate radio buttons to select a row when root set is missing;
1305 e.g. for rows that show "(Expand)" links.
1307 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1309 Statistically significant A/B testing results should be color coded in details view
1310 https://bugs.webkit.org/show_bug.cgi?id=154414
1312 Reviewed by Chris Dumez.
1314 Color code the statistically significant comparisions in TestGroupResultsTable as done in the analysis
1317 * public/v3/components/customizable-test-group-form.js:
1318 (CustomizableTestGroupForm.cssTemplate): Build fix after r196768.
1319 * public/v3/components/test-group-results-table.js:
1320 (TestGroupResultsTable.prototype.buildRowGroups): Add the status as a class name.
1321 (TestGroupResultsTable.cssTemplate): Added styles to color-code statistically significant results.
1323 2016-02-17 Ryosuke Niwa <rniwa@webkit.org>
1325 v3 UI should allow custom revisions for A/B testing
1326 https://bugs.webkit.org/show_bug.cgi?id=154379
1328 Reviewed by Chris Dumez.
1330 Added the capability to customize revisions selected in the overview chart and the results viewer.
1332 Newly added CustomizableTestGroupForm is responsible for allowing users to modify the set of revisions in
1333 a new A/B testing group. Unlike TestGroupForm which doesn't know anything about which revisions are selected
1334 for each project/repository, CustomizableTestGroupForm is aware of the list of revisions used in each set.
1336 The list of revisions used in each set is represented by RootSet if users had not customized them, and
1337 CustomRootSet otherwise; the latter was added since regular RootSet object requires CommitLog and other
1338 DataModelObjects which are hard to create without corresponding database entries.
1340 * public/v3/components/customizable-test-group-form.js: Added.
1341 (CustomizableTestGroupForm): Added.
1342 (CustomizableTestGroupForm.prototype.setRootSetMap): Added.
1343 (CustomizableTestGroupForm.prototype._submitted): Overrides the superclass' method.
1344 (CustomizableTestGroupForm.prototype._customize): Ditto. Unlike TestGroupForm's callback, this class'
1345 callback passes in a root set map as the third argument.
1346 (CustomizableTestGroupForm.prototype._computeRootSetMap): Added. Returns this._rootSetMap, which is set by
1347 AnalysisTaskPage if user had not customized the root sets. Otherwise return a new map with CustomRootSet's.
1348 (CustomizableTestGroupForm.prototype.render): Added. Creates a table to allow customization of root sets.
1349 (CustomizableTestGroupForm._constructRevisionRadioButtons): Added.
1350 (CustomizableTestGroupForm._createRadioButton): Added.
1351 (CustomizableTestGroupForm.cssTemplate): Added.
1352 (CustomizableTestGroupForm.formContent): Added. This method is called by TestGroupForm.htmlTemplate.
1353 * public/v3/components/test-group-form.js:
1354 (TestGroupForm): Updated the various methods to not directly mutate DOM. Store the state in instance
1355 variables and update DOM in render() as done elsewhere.
1356 (TestGroupForm.prototype.setNeedsName): Deleted. We no longer need this flag since TestGroupForm which is
1357 used for retries never needs a name and CustomizableTestGroupForm which is used to create a new test group
1358 always requires a name.
1359 (TestGroupForm.prototype.setDisabled):
1360 (TestGroupForm.prototype.setLabel):
1361 (TestGroupForm.prototype.setRepetitionCount):
1362 (TestGroupForm.prototype.render): Added.
1363 (TestGroupForm.prototype._submitted): Moved the code to prevent the default action has been moved to the
1364 constructor since this method is overridden by CustomizableTestGroupForm.
1365 (TestGroupForm.cssTemplate): Added.
1366 (TestGroupForm.htmlTemplate):
1367 (TestGroupForm.formContent): Extracted from htmlTemplate.
1368 * public/v3/index.html:
1369 * public/v3/models/repository.js:
1370 (Repository.sortByNamePreferringOnesWithURL): Added.
1371 * public/v3/models/root-set.js:
1372 (RootSet.prototype.revisionForRepository): Added so that _createTestGroupAfterVerifyingRootSetList can retrieve
1373 the revision information from CustomRootSet without going through CommitLog objects since CustomRootSet doesn't
1374 have associated CommitLog objects.
1375 (CustomRootSet): Added. Used by CustomizableTestGroupForm to create a custom root map since regular RootSet
1376 requires CommitLog and other related objects which are hard to create without database entries.
1377 (CustomRootSet.prototype.setRevisionForRepository): Added.
1378 (CustomRootSet.prototype.repositories): Added.
1379 (CustomRootSet.prototype.revisionForRepository): Added.
1380 * public/v3/pages/analysis-task-page.js:
1382 (AnalysisTaskPage.prototype.render): Removed the reference to v2 UI since v3 UI is now strictly more powerful
1383 than v2 UI. Also update the root set maps in each form here.
1384 (AnalysisTaskPage.prototype._retryCurrentTestGroup): No longer takes unused name argument as it got removed
1386 (AnalysisTaskPage.prototype._chartSelectionDidChange): No longer updates the disabled-ness here since it's now
1387 done in render() via setRootSetMap().
1388 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Now takes rootSetMap as an argument.
1389 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): No longer updates the disabled-ness here
1390 since it's now done in render() via setRootSetMap().
1391 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Now takes rootSetMap as an argument.
1392 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Take a dictionary of root set labels
1393 such as A and B, which maps to a RootSet or a newly-added CustomRootSet.
1394 (AnalysisTaskPage.htmlTemplate): Use customizable-test-group-form for creating a new A/B testing group. Retry
1395 form will continue to use TestGroupForm since customizing revisions is non-sensical in retries.
1396 (AnalysisTaskPage.cssTemplate): Updated the style.
1398 2016-02-16 Ryosuke Niwa <rniwa@webkit.org>
1400 v3 UI has the capability to schedule an A/B testing in a specific range
1401 https://bugs.webkit.org/show_bug.cgi?id=154329
1403 Reviewed by Chris Dumez.
1405 Extended AnalysisTaskChartPane and ResultsTable so that users can select a range of points in either
1406 the overview chart pane and the results viewer table. Extracted TestGroupForm out of the analysis task
1407 page and used right below those two components in the analysis task page.
1409 * public/v3/components/results-table.js:
1411 (ResultsTable.prototype.setRangeSelectorLabels): Added.
1412 (ResultsTable.prototype.setRangeSelectorCallback): Added.
1413 (ResultsTable.prototype.selectedRange): Added.
1414 (ResultsTable.prototype._rangeSelectorClicked): Added.
1415 (ResultsTable.prototype.render): Generate radio boxes to select a range.
1417 * public/v3/components/test-group-form.js:
1419 (TestGroupForm.prototype.setStartCallback): Added.
1420 (TestGroupForm.prototype.setNeedsName): Added.
1421 (TestGroupForm.prototype.setDisabled): Added.
1422 (TestGroupForm.prototype.setLabel): Added.
1423 (TestGroupForm.prototype.setRepetitionCount): Added.
1424 (TestGroupForm.prototype._submitted): Added.
1425 (TestGroupForm.htmlTemplate): Extracted from AnalysisTaskPage.htmlTemplate.
1427 * public/v3/index.html:
1429 * public/v3/pages/analysis-task-page.js:
1430 (AnalysisTaskChartPane.prototype._mainSelectionDidChange): Added. Delegates the work to AnalysisTaskPage.
1431 (AnalysisTaskChartPane.prototype.selectedPoints): Added.
1433 (AnalysisTaskPage.prototype.title):
1434 (AnalysisTaskPage.prototype.render):
1435 (AnalysisTaskPage.prototype._renderTestGroupDetails): Use TestGroupForm's methods instead of mutating DOM.
1436 (AnalysisTaskPage.prototype._retryCurrentTestGroup):
1437 (AnalysisTaskPage.prototype._chartSelectionDidChange): Added.
1438 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Added.
1439 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Added.
1440 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Added.
1441 (AnalysisTaskPage.prototype._createRetryNameForTestGroup):
1442 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Extracted from _retryCurrentTestGroup
1443 so that we can call it in _createNewTestGroupFromChart and _createNewTestGroupFromViewer.
1444 (AnalysisTaskPage.htmlTemplate):
1446 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1448 Extract the code specific to v2 UI out of shared statistics.js
1449 https://bugs.webkit.org/show_bug.cgi?id=154277
1451 Reviewed by Chris Dumez.
1453 Extracted statistics-strategies.js out of statistics.js for v2 UI and detect-changes.js. The intent is to
1454 deprecate this file once we implement refined statistics tools in v3 UI and adopt it in detect-changes.js.
1456 * public/shared/statistics.js:
1457 (Statistics.movingAverage): Extracted from the "Simple Moving Average" strategy.
1458 (Statistics.cumultaiveMovingAverage): Extracted from the "Cumulative Moving Average" strategy.
1459 (Statistics.exponentialMovingAverage): Extracted from the "Exponential Moving Average" strategy.
1460 Use a temporary "movingAverage" to keep the last moving average instead of relying on the previous
1461 entry in "averages" array to avoid special casing an array of length 1 and starting the loop at i = 1.
1462 (Statistics.segmentTimeSeriesGreedyWithStudentsTTest): Extracted from "Segmentation: Recursive t-test"
1463 strategy. Don't create the list of averages to match segmentTimeSeriesByMaximizingSchwarzCriterion here.
1464 It's done in newly added averagesFromSegments.
1465 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Extracted from
1466 "Segmentation: Schwarz criterion" strategy.
1467 (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Just store the start index to match
1469 (App.Pane.updateStatisticsTools):
1470 (App.Pane._computeMovingAverageAndOutliers):
1471 * public/v2/data.js:
1472 * public/v2/index.html:
1473 * public/v2/statistics-strategies.js: Added.
1474 (StatisticsStrategies.MovingAverageStrategies): Added.
1475 (averagesFromSegments): Extracted from "Segmentation: Schwarz criterion" strategy. Now used by both
1476 "Segmentation: Recursive t-test" and "Segmentation: Schwarz criterion" strategies.
1477 (StatisticsStrategies.EnvelopingStrategies): Moved from Statistics.EnvelopingStrategies.
1478 (StatisticsStrategies.TestRangeSelectionStrategies): Moved from Statistics.TestRangeSelectionStrategies.
1479 (createWesternElectricRule): Moved from statistics.js.
1480 (countValuesOnSameSide): Ditto.
1481 (StatisticsStrategies.executeStrategy): Moved from Statistics.executeStrategy.
1482 * tools/detect-changes.js:
1483 (computeRangesForTesting):
1485 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1487 v1 UI and v2 UI should share statistics.js
1488 https://bugs.webkit.org/show_bug.cgi?id=154262
1490 Reviewed by Chris Dumez.
1492 Share statistics.js between v1 and v2 UI.
1494 * public/index.html:
1495 * public/js/shared.js: Deleted.
1496 * public/js/statistics.js: Removed.
1497 * public/shared: Added.
1498 * public/shared/statistics.js: Moved from Websites/perf.webkit.org/public/v2/js/statistics.js.
1499 * public/v2/index.html:
1500 * public/v2/js/statistics.js: Removed.
1501 * public/v3/index.html:
1502 * tools/detect-changes.js:
1504 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1506 v3 UI sometimes shows same dates twice on the x-axis of time series charts
1507 https://bugs.webkit.org/show_bug.cgi?id=154210
1509 Reviewed by Chris Dumez.
1511 The bug was caused by the label generation code in TimeSeriesChart.computeTimeGrid never emitting hours.
1513 Use hours instead of dates as labels when the current time's date is same as the previous label's date.
1514 Always include dates before entering this mode to avoid just having hours as labels on the entire x-axis.
1516 * public/v3/components/time-series-chart.js:
1517 (TimeSeriesChart.prototype._renderXAxis): Slightly increase the "average" width of x-axis label.
1518 (TimeSeriesChart.computeTimeGrid): See above. Also assert that the number of labels we generate never
1519 exceeds maxLabels as a sanity check.
1520 (TimeSeriesChart._timeIterators): Added an iterator that increments by two hours for zoomed graphs.
1522 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1524 v3 UI should show status and associated bugs on analysis task pages
1525 https://bugs.webkit.org/show_bug.cgi?id=154212
1527 Reviewed by Chris Dumez.
1529 Added the capability to see and modify the status and the list of associated of bugs on analysis task pages.
1531 Also added the list of related tasks, which are analysis tasks associated with the same bug or have
1532 overlapping time ranges with the same test metric but on a potentially different platform.
1534 In addition, categorize analysis tasks with the status of "no change" or "inconclusive" as "closed" as no
1535 further action can be taken (users can bring them back to non-closed state without any restrictions).
1537 * public/api/analysis-tasks.php:
1538 (format_task): Categorize 'unchanged' and 'inconclusive' analysis tasks as closed.
1540 * public/privileged-api/associate-bug.php:
1541 (main): Added shouldDelete as a new mechanism to disassociate a bug since v3 UI shares a single Bug object
1542 between multiple analysis tasks (as it should have been in the first place).
1544 * public/v3/components/chart-pane-base.js:
1546 (ChartPaneBase.prototype._fetchAnalysisTasks): Since each analysis task's change type (status/result) could
1547 change, we need to create annotation objects during each render() call.
1548 (ChartPaneBase.prototype.render):
1549 (ChartPaneBase.prototype._renderAnnotations): Extracted from ChartPaneBase.prototype._fetchAnalysisTasks to
1550 do that. I was afraid of the perf impact of this but it doesn't seem to be an issue in my testing.
1551 (ChartPaneBase.cssTemplate): Removed superfluous margins (moved to ChartPane.cssTemplate) around the charts
1552 since they are only useful in the charts page.
1554 * public/v3/models/analysis-task.js:
1556 (AnalysisTask.prototype.updateSingleton): Added a comment as to why object.result cannot be renamed to
1557 object.changeType in the JSON API.
1558 (AnalysisTask.prototype.updateName): Added.
1559 (AnalysisTask.prototype.updateChangeType): Added.
1560 (AnalysisTask.prototype._updateRemoteState): Added.
1561 (AnalysisTask.prototype.associateBug): Added.
1562 (AnalysisTask.prototype.disassociateBug): Added.
1563 (AnalysisTask.fetchRelatedTasks): Added. See above for the criteria of related-ness.
1565 * public/v3/pages/analysis-task-page.js:
1567 (AnalysisTaskPage.prototype.updateFromSerializedState):
1568 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): Extracted from updateFromSerializedState.
1569 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks): Added.
1570 (AnalysisTaskPage.prototype.render): Render the list of associated bugs, the list of bug trackers (so that
1571 users can use it to associate with a new bug), and the list of related analysis tasks.
1572 (AnalysisTaskPage.prototype._renderTestGroupList): Extracted from render since it was getting too long.
1573 (AnalysisTaskPage.prototype._renderTestGroupDetails): Ditto.
1574 (AnalysisTaskPage.prototype._updateChangeType): Added.
1575 (AnalysisTaskPage.prototype._associateBug): Added.
1576 (AnalysisTaskPage.prototype._disassociateBug): Added.
1577 (AnalysisTaskPage.htmlTemplate): Added various elements to show and modify the status, associate bugs,
1578 and a list of related analysis tasks.
1579 (AnalysisTaskPage.cssTemplate): Added various styles for those form controls.
1581 * public/v3/pages/chart-pane.js:
1582 (ChartPane.cssTemplate): Moved the margins from ChartPaneBase.cssTemplate.
1584 2016-02-12 Ryosuke Niwa <rniwa@webkit.org>
1586 Perf dashboard should allow renaming analysis tasks and test groups
1587 https://bugs.webkit.org/show_bug.cgi?id=154200
1589 Reviewed by Chris Dumez.
1591 Allow editing names of analysis tasks and A/B testing groups in the v3 UI.
1593 Added the support for updating the name to the privileged API at /privileged-api/update-analysis-task
1594 and added a new prevailed API to update A/B testing groups at /privileged-api/update-test-group.
1596 * public/privileged-api/update-analysis-task.php: Added the support for renaming the analysis task.
1599 * public/privileged-api/update-test-group.php: Added. Supports updating the test group's name.
1602 * public/v3/components/editable-text.js: Added.
1603 (EditableText): Added. A new editable text label control. It looks like a text node with "(Edit)" link
1604 at the end which allow users to go into the "editing mode", which reveals an input element.
1605 The user can exit the editing mode by either moving the focus away from the control or clicking on
1606 "(Save)" at the end. It calls _updateCallback in the latter case.
1607 (EditableText.prototype.editedText): Returns the current value of the input element user.
1608 (EditableText.prototype.setText): Sets the label. This does not live-update the input element until
1609 the user exists the current editing mode and re-enters it.
1610 (EditableText.prototype.setStartedEditingCallback): Sets a callback which gets called when the user
1611 requested to enter the editing mode. Since EditableText relies on AnalysisTaskPage to render, this
1612 callback only exits to call EditableText.render() in AnalysisTask._didStartEditingTaskName.
1613 (EditableText.prototype.setUpdateCallback): Sets a callback which gets called when the user exits
1614 the editing mode by activating the "(Save)" link. This callback MUST return a promise upon resolution
1615 of which the control gets out of the editing mode. While the promise is in flight, the input element
1617 (EditableText.prototype.render): Updates various states of the elements. When _updatingPromise is not
1618 falsy, we make the input element readonly and show '(...)' on the link. Don't show the action link
1619 if the label is empty (e.g. analysis task or test group is still being fetched).
1620 (EditableText.prototype._didClick): Called when the user clicked on the action link. Enter the editing
1621 mode or save the edited label via _updateCallback.
1622 (EditableText.prototype._didBlur): Exit the editing mode without saving if the input element is not
1623 focused, there is no inflight promise returned by _updateCallback, and the action link "(Save)" does
1625 (EditableText.prototype._didUpdate): Called when exiting the editing mode.
1626 (EditableText.htmlTemplate):
1627 (EditableText.cssTemplate):
1629 * public/v3/index.html: Include newly added editable-text.js.
1631 * public/v3/models/analysis-task.js:
1632 (AnalysisTask.prototype.updateSingleton): Added.
1633 (AnalysisTask.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1634 the analysis task from the sever.
1635 (AnalysisTask._constructAnalysisTasksFromRawData): Use ensureSingleton instead of manually calling
1636 findById since we need to update the name of the singleton object we found (via updateSingleton).
1638 * public/v3/models/bug.js:
1639 (Bug.ensureSingleton): Moved the code to compute the synthetic id from AnalysisTask's
1640 _constructAnalysisTasksFromRawData.
1641 (Bug.prototype.updateSingleton): Added. Just assert that nothing changes.
1643 * public/v3/models/build-request.js:
1644 (BuildRequest.prototype.updateSingleton): Added. Assert that the intrinsic values of a build request
1645 doesn't change and update status text, status url, and build id as they could change.
1647 * public/v3/models/commit-log.js:
1648 (CommitLog): Made the constructor argument conform to the convention of id, object pair so that we can
1649 use DataModelObject.ensureSingleton.
1650 (CommitLog.ensureSingleton):
1651 (CommitLog.prototype.updateSingleton): Extracted from CommitLog.ensureSingleton.
1653 * public/v3/models/data-model.js:
1654 (DataModelObject.ensureSingleton): Call newly added updateSingleton.
1655 (DataModelObject.prototype.updateSingleton):
1656 (LabeledObject): Removed the name map since it's never used (findByName is never called anywhere).
1657 (LabeledObject.prototype.updateSingleton): Added. Updates _name.
1658 (LabeledObject.findByName): Deleted.
1660 * public/v3/models/test-group.js:
1661 (TestGroup.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1662 the test group from the sever.
1663 (TestGroup._createModelsFromFetchedTestGroups): Removed bogus code. A root set doesn't have a test
1664 group associated with it since multiple test groups can share a single root set (this property doesn't
1667 * public/v3/pages/analysis-task-page.js:
1668 (AnalysisTaskPage): Removed useless _taskId and added this._testGroupLabelMap and this._taskNameLabel.
1669 (AnalysisTaskPage.prototype.updateFromSerializedState): Cleanup.
1670 (AnalysisTaskPage.prototype._didFetchTask): Assert that this function is called exactly once.
1671 (AnalysisTaskPage.prototype.render): Use this._task.id() to show the v2 link. Use EditableText to show
1672 the names of the analysis task and the associated test groups. Hide the overview chart and the list of
1673 test groups (along with the retry/confirm button) when the analysis task failed to fetch. We always
1674 update the names of the analysis task and the associated test groups since they could be updated by
1676 (AnalysisTaskPage.prototype._didStartEditingTaskName): Added.
1677 (AnalysisTaskPage.prototype._updateTaskName): Added.
1678 (AnalysisTaskPage.prototype._updateTestGroupName): Added.
1679 (AnalysisTaskPage.htmlTemplate): Updated the style.
1681 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1683 Land the change that was supposed to be the part of r196463.
1685 * public/v3/pages/analysis-task-page.js:
1686 (AnalysisTaskPage.prototype._didFetchTestGroups): Select the latest test group by default.
1688 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1690 Refine v3 UI's analysis task page
1691 https://bugs.webkit.org/show_bug.cgi?id=154152
1693 Reviewed by Chris Dumez.
1695 This patch makes the following refinements to the analysis task page:
1696 - Always show the relative different of in-progress A/B testing.
1697 - Make the annotations (colored bars) in the chart open other analysis tasks.
1698 - Order the A/B testing groups in the reverse chronological order.
1699 - Select the time range corresponding to the current test group.
1701 * public/v3/components/analysis-results-viewer.js:
1702 (AnalysisResultsViewer.cssTemplate): Fixed the bug that pending and running testing groups are no longer
1703 colored after r196440. Use a slightly more opaque color for currently running groups compared to pending ones.
1705 * public/v3/components/chart-pane-base.js:
1706 (ChartPaneBase.prototype.setMainSelection): Added.
1707 (ChartPaneBase.prototype._openAnalysisTask): Moved the code from ChartPane._openAnalysisTask so that it can be
1708 reused in both AnalysisTaskChartPane and ChartPane (in charts page).
1709 (ChartPaneBase.prototype.router): Added. Overridden by each subclass.
1711 * public/v3/components/test-group-results-table.js:
1712 (TestGroupResultsTable.prototype.buildRowGroups): Always show the summary (relative difference of A to B) as
1713 long as there are some results in each set.
1715 * public/v3/models/test-group.js:
1716 (TestGroup.prototype.compareTestResults): Always set .label and .fullLabel with the relative change as long as
1717 there are some values. Keep using "pending" and "running" in .status since that would determine the color of
1718 stacking blocks representing those A/B testing groups.
1720 * public/v3/pages/analysis-task-page.js:
1721 (AnalysisTaskChartPane):
1722 (AnalysisTaskChartPane.prototype.setPage): Added.
1723 (AnalysisTaskChartPane.prototype.router): Added.
1725 (AnalysisTaskPage.prototype.render): Show the list of A/B testing groups in the reverse chronological order.
1726 Also set the main chart's selection to the time range of the current test group.
1728 * public/v3/pages/chart-pane.js:
1729 (ChartPane.prototype.router): Added.
1730 (ChartPane.prototype._openAnalysisTask): Moved to ChartPaneBase.prototype._openAnalysisTask.
1732 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1734 Add a script to process backlogs created while perf dashboard was in the maintenance mode
1735 https://bugs.webkit.org/show_bug.cgi?id=154140
1737 Reviewed by Chris Dumez.
1739 Added a script to process the backlog JSONs created while the perf dashboard was put in the maintenance mode.
1740 It re-submits each JSON file to the perf dashboard using the same server config file used by syncing scripts.
1742 * public/include/report-processor.php:
1743 (TestRunsGenerator::test_value_list_to_values_by_iterations): Fixed a bug in the error message code. It was
1744 referencing an undeclared variable.
1745 * tools/process-maintenance-backlog.py: Added.
1747 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1749 AnalysisResultsViewer never uses this._smallerIsBetter
1750 https://bugs.webkit.org/show_bug.cgi?id=154134
1752 Reviewed by Chris Dumez.
1754 Removed the unused instance variable _smallerIsBetter from AnalysisResultsViewer and TestGroupStackingBlock.
1756 * public/v3/components/analysis-results-viewer.js:
1757 (AnalysisResultsViewer): Removed the unused _smallerIsBetter.
1758 (AnalysisResultsViewer.prototype.setSmallerIsBetter): Deleted.
1759 (AnalysisResultsViewer.prototype.buildRowGroups):
1760 (AnalysisResultsViewer.TestGroupStackingBlock): Removed the unused _smallerIsBetter.
1761 * public/v3/pages/analysis-task-page.js:
1762 (AnalysisTaskPage.prototype._didFetchTask):
1764 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1766 Build fix after r196440.
1768 * public/v3/models/test-group.js:
1769 (TestGroup.prototype.addBuildRequest): Clear the map instead of setting the property to null.
1771 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
1773 Perf dashboard should have UI to retry A/B testing
1774 https://bugs.webkit.org/show_bug.cgi?id=154090
1776 Reviewed by Chris Dumez.
1778 Added a button to re-try an existing A/B testing group with a custom repetition count. The same button functions
1779 as a way of confirming the progression/regression when there have been no A/B testing scheduled in the task.
1781 Also fixed the bug that A/B testing groups that have been waiting for other test groups will be shown as "running".
1783 * public/v3/components/results-table.js:
1784 (ResultsTable.cssTemplate): Don't pad the list of extra repositories when it's empty.
1786 * public/v3/components/test-group-results-table.js:
1787 (TestGroupResultsTable.prototype.buildRowGroups): Use TestGroup.labelForRootSet instead of manually
1788 computing the letter for each configuration set.
1790 * public/v3/models/build-request.js:
1791 (BuildRequest.prototype.hasStarted): Added.
1793 * public/v3/models/data-model.js:
1794 (DataModelObject.ensureSingleton): Added.
1795 (DataModelObject.cachedFetch): Added noCache option. This is used when re-fetching the test groups after
1798 * public/v3/models/measurement-cluster.js:
1799 (MeasurementCluster.prototype.startTime): Added.
1801 * public/v3/models/measurement-set.js:
1802 (MeasurementSet.prototype.hasFetchedRange): Added. Returns true only if there are no "holes" (cluster
1803 yet to be fetched) between the specified time range. This was added to fix a bug in AnalysisTaskPage's
1804 _didFetchMeasurement.
1806 * public/v3/models/test-group.js:
1807 (TestGroup): Added this._rootSetToLabel.
1808 (TestGroup.prototype.addBuildRequest): Reset this._rootSetToLabel along with this._requestedRootSets.
1809 (TestGroup.prototype.repetitionCount): Added. Returns the number of iterations executed per set. We assume that
1810 every root set in the test group shares a single repetition count.
1811 (TestGroup.prototype.requestedRootSets): Now populates this._rootSetToLabel for labelForRootSet.
1812 (TestGroup.prototype.labelForRootSet): Added.
1813 (TestGroup.prototype.hasStarted): Added.
1814 (TestGroup.prototype.compareTestResults): Use 'running' and 'pending' to differentiate test groups that are waiting
1815 for other groups to finish running from the ones that are actually running ('incomplete' before this patch).
1816 (TestGroup.fetchByTask):
1817 (TestGroup.createAndRefetchTestGroups): Added. Creates a new test group using the privileged-api/create-test-group
1818 and fetches the list of test groups for the specified analysis task.
1819 (TestGroup._createModelsFromFetchedTestGroups): Extracted from TestGroup.fetchByTask.
1821 * public/v3/pages/analysis-task-page.js:
1822 (AnalysisTaskPage): Initialize _renderedCurrentTestGroup to undefined so that we'd always can differentiate
1823 the initial call to AnalysisTaskPage.render and subsequent calls in which it's identical to _currentTestGroup.
1824 (AnalysisTaskPage.prototype._didFetchMeasurement): Fixed a bug that we don't exit early even when some
1825 clusters in between startPoint and endPoint are still being fetched via newly added hasFetchedRange.
1826 (AnalysisTaskPage.prototype.render): Update the default repetition count based on the current test group.
1827 Also update the label of the button to "Confirm the change" if there is no A/B testing in this task.
1828 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Added. Re-triggers an existing A/B testing group or creates
1829 the A/B testing for the entire range of the analysis task.
1830 (AnalysisTaskPage.prototype._hasDuplicateTestGroupName): Added.
1831 (AnalysisTaskPage.prototype._createRetryNameForTestGroup): Added.
1832 (AnalysisTaskPage.htmlTemplate): Added form controls to re-trigger A/B testing.
1833 (AnalysisTaskPage.cssTemplate): Updated the style.
1835 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
1837 Removed the duplicated definition of ChartPaneBase.
1839 * public/v3/components/chart-pane-base.js:
1841 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
1843 Analysis task page on v3 UI should show charts
1844 https://bugs.webkit.org/show_bug.cgi?id=154057
1846 Reviewed by Chris Dumez.
1848 Extracted ChartPaneBase out of ChartPane and added an instance of its new subclass, AnalysisTaskChartPane,
1849 to the analysis task page. The main difference is that ChartPaneBase doesn't depend on the presence of
1850 this._chartsPage unlike ChartPane. It also doesn't have the header with toolbar (to show breakdown, etc...).
1852 * public/v3/components/base.js:
1853 (ComponentBase.prototype._constructShadowTree): Call htmlTemplate() and cssTemplate() with the right "this".
1855 * public/v3/components/chart-pane-base.js: Added.
1856 (ChartPaneBase): Extracted from ChartPane.
1857 (ChartPaneBase.prototype.configure): Extracted from the constructor. Separating this function allows the
1858 component to be instantiated inside a HTML template.
1859 (ChartPaneBase.prototype._fetchAnalysisTasks): Moved from ChartPane._fetchAnalysisTasks.
1860 (ChartPaneBase.prototype.platformId): Ditto.
1861 (ChartPaneBase.prototype.metricId): Ditto.
1862 (ChartPaneBase.prototype.setOverviewDomain): Ditto.
1863 (ChartPaneBase.prototype.setMainDomain): Ditto.
1864 (ChartPaneBase.prototype._overviewSelectionDidChange): Extracted from the constructor. This is overridden in
1865 ChartPane and unused in AnalysisTaskChartPane.
1866 (ChartPaneBase.prototype._mainSelectionDidChange): Extracted from ChartPane._mainSelectionDidChange.
1867 (ChartPaneBase.prototype._mainSelectionDidZoom): Extracted from ChartPane._mainSelectionDidZoom.
1868 (ChartPaneBase.prototype._indicatorDidChange): Extracted from ChartPane._indicatorDidChange.
1869 (ChartPaneBase.prototype._didFetchData): Moved from ChartPane._fetchAnalysisTasks.
1870 (ChartPaneBase.prototype._openAnalysisTask): Ditto.
1871 (ChartPaneBase.prototype._openCommitViewer): Ditto. Also fixed a bug that we don't show the spinner while
1872 waiting for the data to be fetched by calling this.render() here.
1873 (ChartPaneBase.prototype._keyup): Moved from ChartPane._keyup. Also fixed the bug that the revisions list
1874 doesn't update by calling this.render() here.
1875 (ChartPaneBase.prototype.render): Extracted from ChartPane.render.
1876 (ChartPaneBase.htmlTemplate): Extracted from ChartPane.htmlTemplate.
1877 (ChartPaneBase.paneHeaderTemplate): Added. This is overridden in ChartPane and unused in AnalysisTaskChartPane.
1878 (ChartPaneBase.cssTemplate): Extracted from ChartPane.htmlTemplate.
1880 * public/v3/components/chart-styles.js: Renamed from public/v3/pages/page-with-charts.js.
1881 (PageWithCharts): Renamed from PageWithCharts since it no longer extends PageWithHeading.
1882 (ChartStyles.createChartSourceList):
1884 * public/v3/components/commit-log-viewer.js:
1885 (CommitLogViewer.prototype.view): Set this._repository right away instead of waiting for the fetched data
1886 so that spinner will be shown while the data is being fetched.
1888 * public/v3/index.html:
1890 * public/v3/pages/analysis-task-page.js:
1891 (AnalysisTaskChartPane): Added extends ChartPaneBase.
1892 (AnalysisTaskPage): Added. this._chartPane.
1893 (AnalysisTaskPage.prototype._didFetchTask): Initialize this._chartPane with a domain.
1894 (AnalysisTaskPage.prototype.render): Render this._chartPane.
1895 (AnalysisTaskPage.htmlTemplate):
1897 * public/v3/pages/chart-pane-status-view.js:
1898 (ChartPaneStatusView): Removed the unused router from the argument list.
1899 (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Renamed from analyzeData() since it was ambiguous.
1900 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Fixed the bug that we don't update the list
1901 of the revisions here.
1902 (ChartPaneStatusView.prototype.computeChartStatusLabels):
1904 * public/v3/pages/chart-pane.js:
1905 (ChartPane): Now extends ChartPaneBase.
1906 (ChartPane.prototype._overviewSelectionDidChange): Extracted from the constructor.
1907 (ChartPane.prototype._mainSelectionDidChange):
1908 (ChartPane.prototype._mainSelectionDidZoom):
1909 (ChartPane.prototype._indicatorDidChange):
1910 (ChartPane.prototype.render):
1911 (ChartPane.prototype._renderActionToolbar):
1912 (ChartPane.paneHeaderTemplate): Extracted from htmlTemplate.
1913 (ChartPane.cssTemplate):
1914 (ChartPane.overviewOptions.selection.onchange): Deleted.
1915 (ChartPane.prototype._fetchAnalysisTasks): Deleted.
1916 (ChartPane.prototype.platformId): Deleted.
1917 (ChartPane.prototype.metricId): Deleted.
1918 (ChartPane.prototype.setOverviewDomain): Deleted.
1919 (ChartPane.prototype.setMainDomain): Deleted.
1920 (ChartPane.prototype._openCommitViewer): Deleted.
1921 (ChartPane.prototype._didFetchData): Deleted.
1922 (ChartPane.prototype._keyup): Deleted.
1924 * public/v3/pages/charts-page.js:
1926 (ChartsPage.createDomainForAnalysisTask): Extracted by createDomainForAnalysisTask; used to set the domain
1927 of the charts in the analysis task page.
1928 (ChartsPage.createStateForAnalysisTask):
1930 * public/v3/pages/dashboard-page.js:
1932 (DashboardPage.prototype._createChartForCell):
1934 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
1936 Add the support for maintenance mode
1937 https://bugs.webkit.org/show_bug.cgi?id=154072
1939 Reviewed by Chris Dumez.
1941 Added the crude support for maintenance mode whereby which the reports are stored in the filesystem
1942 instead of the database.
1944 * config.json: Added maintenanceMode and maintenanceDirectory as well as forgotten siteTitle and
1945 remoteServer.httpdMutexDir.
1946 * public/api/report.php:
1947 (main): Don't connect to the database or modify database when maintenanceMode is set.
1948 * public/include/json-header.php:
1949 (ensure_privileged_api_data): Exit with InMaintenanceMode when maintenanceMode is set. This prevents
1950 privileged API such as creating analysis tasks and new A/B testing groups from modifying the database.
1952 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
1954 Analysis task page on v3 show progression as regressions
1955 https://bugs.webkit.org/show_bug.cgi?id=154045
1957 Reviewed by Chris Dumez.
1959 The bug was caused by TestGroup.compareTestResults referring to undefined _smallerIsBetter.
1960 Retrieve it from the associated metric object via the owner analysis task.
1962 * public/v3/models/test-group.js:
1964 2016-02-05 Ryosuke Niwa <rniwa@webkit.org>
1966 Testing with remote server cache is unusably slow
1967 https://bugs.webkit.org/show_bug.cgi?id=153928
1969 Reviewed by Chris Dumez.
1971 Don't use the single process mode of httpd as it's way too slow even for testing.
1972 Also we'll hit a null pointer crash (http://svn.apache.org/viewvc?view=revision&revision=1711479)
1974 Since httpd exits immediately when launched in multi-process mode, remote-cache-server.py (renamed from
1975 run-with-remote-server.py) now has "start" and "stop" commands to start/stop the Apache. Also added
1976 "reset" command to reset the cache for convenience.
1978 * Install.md: Updated the instruction.
1979 * config.json: Fixed a typo: httpdErro*r*Log.
1980 * tools/remote-cache-server.py: Copied from Websites/perf.webkit.org/tools/run-with-remote-server.py.
1981 Now takes one of the following commands: "start", "stop", and "reset".
1983 (start_httpd): Extracted from main.
1984 (stop_httpd): Added.
1985 * tools/remote-server-relay.conf: Removed redundant (duplicate) LoadModule's.
1986 * tools/run-with-remote-server.py: Removed.
1988 2016-02-04 Ryosuke Niwa <rniwa@webkit.org>
1990 Perf dashboard should have a script to setup database
1991 https://bugs.webkit.org/show_bug.cgi?id=153906
1993 Reviewed by Chris Dumez.
1995 Added tools/setup-database.py to setup the database. It retrieves the database name, username, password
1996 and initializes a database at the specified location.
1998 * Install.md: Updated instruction to setup postgres to use setup-database.py.
1999 * tools/setup-database.py: Added.
2001 (load_database_config):
2002 (determine_psql_dir):
2003 (start_or_stop_database):
2004 (execute_psql_command):
2006 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2008 buildbot syncing scripts sometimes schedule more than one requests per builder
2009 https://bugs.webkit.org/show_bug.cgi?id=153047
2011 Reviewed by Chris Dumez.
2013 The bug was caused by the check for singularity of scheduledRequests being conducted per configuration
2014 instead of per builder. So if there were multiple test configurations (e.g. Speedometer and Octane) that
2015 both used the same builder, then we may end up scheduling both at once.
2017 Fixed the bug by sharing a single set to keep track of the scheduled requests for all configurations per
2020 * tools/sync-with-buildbot.py:
2021 (load_config): Share a set amongst test configurations for each builder.
2022 (find_request_updates): Instead of creating a new set for each configuration, reuse the existing sets to
2023 share a single set agmonst test configurations for each builder.
2025 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2027 Analysis results viewer sometimes doesn't show the correct relative difference
2028 https://bugs.webkit.org/show_bug.cgi?id=152930
2030 Reviewed by Chris Dumez.
2032 The bug was caused by single A/B testing result associated with multiple rows when there are multiple data
2033 points with the same root set which matches that of an A/B testing.
2035 Fixed the bug by detecting such a case, and only associating each A/B testing result with the row created
2036 for the first matching point.
2038 * public/v3/components/analysis-results-viewer.js:
2039 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
2041 2016-01-08 Ryosuke Niwa <rniwa@webkit.org>
2043 Make v3 UI analysis task page is hard to understand
2044 https://bugs.webkit.org/show_bug.cgi?id=152917
2046 Reviewed by Antti Koivisto.
2048 Add a dark gray border around the selected block in the analysis results viewer instead of using darker
2049 shades since that looks as if they were bigger regression/progression.
2051 Explicitly show "Failed" as the label instead of omitting with "-" when all build requests in an A/B
2052 testing group fails.
2054 * public/v3/components/analysis-results-viewer.js:
2055 (AnalysisResultsViewer.cssTemplate): Tweaked the style to underline text in the hovered blocks and the
2056 selected blocks and show a dark gray border around the selected blocks.
2057 (AnalysisResultsViewer.TestGroupStackingBlock):
2058 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Use this._title for title.
2059 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
2060 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForRootSet): Deleted.
2062 * public/v3/components/results-table.js:
2063 (ResultsTable.prototype.render):
2064 (ResultsTable.prototype._createRevisionListCells): Extracted from ResultsTable.prototype.render.
2065 (ResultsTable.cssTemplate): Tweaked the style.
2067 (ResultsTableRow.prototype.constructor): Added _labelForWholeRow to store the label for the entire row.
2068 This is used to show the comparison result of two root sets (e.g. A vs B).
2069 (ResultsTableRow.prototype.setLabelForWholeRow): Added.
2070 (ResultsTableRow.prototype.labelForWholeRow): Added.
2071 (ResultsTableRow.prototype.resultContent): Extracted from buildHeading. Creates a hyperlinked bar graph
2072 used for each A/B testing result.
2073 (ResultsTableRow.prototype.buildHeading): Deleted since we need to set colspan on the second table cell
2074 when we're creating a row with _labelForWholeRow.
2076 * public/v3/components/test-group-results-table.js:
2077 (TestGroupResultsTable.prototype.buildRowGroups): Added rows to show relative differences and statistical
2078 significance between root sets (e.g. A vs B).
2080 * public/v3/models/build-request.js:
2081 (BuildRequest.prototype.hasCompleted): Added.
2083 * public/v3/models/test-group.js:
2084 (TestGroup.prototype.compareTestResults): Extracted from AnalysisResultsViewer.TestGroupStackingBlock's
2085 _computeTestGroupStatus and generalized to be reused in TestGroupResultsTable.
2086 (TestGroup.prototype._valuesForRootSet): Moved from AnalysisResultsViewer.TestGroupStackingBlock.
2088 * public/v3/pages/analysis-task-page.js:
2089 (AnalysisTaskPage.cssTemplate): Tweaked the style.
2091 2016-01-07 Ryosuke Niwa <rniwa@webkit.org>
2093 Perf dashboard should automatically add aggregators
2094 https://bugs.webkit.org/show_bug.cgi?id=152818
2096 Reviewed by Chris Dumez.
2098 When an aggregator entry is missing in aggregators table, automatically insert it in /api/report.
2100 In a very early version of the perf dashboard, we had the ability to define a custom aggregator
2101 in an admin page. In practice, nobody used or needed this feature so we got rid of it even before
2102 the dashboard was landed into WebKit repository. This patch cleans up that mess.
2105 (main): Added the filtering capability.
2106 (TestEnvironment): Expose the config JSON in the test environment.
2108 * public/include/report-processor.php:
2109 (ReportProcessor): Renamed name_to_aggregator now that it only contains ID.
2110 (ReportProcessor::__construct): No longer fetches the aggregator table. An equivalent work is done
2111 in newly added ensure_aggregators.
2112 (ReportProcessor::process): Calls ensure_aggregators which populates name_to_aggregator_id.
2113 (ReportProcessor::ensure_aggregators): Added. Add the builtin aggregators: Arithmetic, Geometric,
2114 Harmonic, and Total.
2115 (TestRunsGenerator): Renamed name_to_aggregator now that it only contains ID.
2116 (TestRunsGenerator::__construct):
2117 (TestRunsGenerator::add_aggregated_metric): Don't include aggregator_definition here since it's
2118 never used now that all the aggregations are done natively in PHP.
2119 (TestRunsGenerator::$aggregators): Added. We don't include SquareSum since it's only used for
2120 computing run_square_sum_cache in test_runs table and it's useless elsewhere.
2121 (TestRunsGenerator::aggregate_values): Add a comment about that.
2123 * tests/api-report.js: Updated a test case to reflect the change.
2125 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2127 Perf dashboard JSON API should fail gracefully when postgres is down
2128 https://bugs.webkit.org/show_bug.cgi?id=152812
2130 Reviewed by Chris Dumez.
2132 Even though all JSON APIs returned DatabaseConnectionFailure as the status when Database::connect
2133 returned a falsy value, PHP was spitting out warnings and producing HTTP responses that cannot be
2134 parsed as a JSON when pg_connect failed.
2136 Fixed the bug by suppressing warning messages in pg_connect.
2138 * public/include/db.php:
2139 (Database::connect): Use '@' prefix to suppress warning messages.
2141 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2143 Perf dashboard should auto-generate manifest file when one is missing
2144 https://bugs.webkit.org/show_bug.cgi?id=152813
2146 Reviewed by Chris Dumez.
2148 When /data/manifest.json is missing, fall back to newly added /api/manifest instead of
2149 silently failing to show the UI. This will make the initial setup easier.
2151 * public/api/manifest.php: Added.
2153 * public/include/manifest.php:
2154 (Manifest::manifest): Added.
2155 * public/v3/main.js:
2157 (didFetchManifest): Extracted from fetchManifest.
2159 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2161 Commit another forgotten change, this time, for r194653.
2163 * public/v3/models/measurement-set.js:
2165 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2167 The sampling of time series on v3 UI is too aggressive
2168 https://bugs.webkit.org/show_bug.cgi?id=152804
2170 Reviewed by Chris Dumez.
2172 Fixed a bug that we were always halving the number of data points in _sampleTimeSeries
2173 and increased the number of data points allowed to make the sampling less aggressive.
2175 * public/v3/components/time-series-chart.js:
2176 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Increase the number of maximum points
2177 to 2x the number of pixels divided by the radius of each point.
2178 (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Changed the semantics of endIndex
2179 to mean the index after the last point and renamed it to indexAfterEnd.
2180 (TimeSeriesChart.prototype._sampleTimeSeries): Fixed a bug that this code always coerced two
2181 data points into one sampled data point despite of the fact i and j are sufficiently apart
2182 since data[j].time - data[i].time > timePerSample by definition.
2184 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2186 Commit the forgotten change for r194651.
2188 * public/v3/pages/domain-control-toolbar.js:
2189 (DomainControlToolbar.prototype.setStartTime):
2191 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2193 The right hand side of main chart appears to be cut off as you zoom out on v3 UI
2194 https://bugs.webkit.org/show_bug.cgi?id=152778
2196 Reviewed by Antti Koivisto.
2198 Add a padding on x-axis after the end time to make the main chart more easily interactive.
2200 * public/v3/components/time-series-chart.js:
2201 (TimeSeriesChart.prototype._computeHorizontalRenderingMetrics):
2203 * public/v3/pages/page-with-charts.js:
2204 (PageWithCharts.mainChartOptions): Add a padding of 5px at the end of x-axis.
2206 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2208 v3 UI should use four sig-figs to label y-axis of the main charts
2209 https://bugs.webkit.org/show_bug.cgi?id=152779
2211 Reviewed by Antti Koivisto.
2213 Increase the number of significant figures used in the main charts to four as done in v2 UI.
2215 * public/v3/pages/chart-pane.js:
2216 (ChartPane.constructor): Create a formatter with four significant figures.
2217 * public/v3/pages/page-with-charts.js:
2218 (PageWithCharts.mainChartOptions): Increase the width of y-axis labels.
2220 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2222 v3 UI's time range slider is harder to use than that of v2 UI
2223 https://bugs.webkit.org/show_bug.cgi?id=152780
2225 Reviewed by Antti Koivisto.
2227 Improved the time range slider by using a cubic mapping to time range and providing a text field
2228 to directly edit the number of days to show.
2230 Now an user can enter the text mode to directly edit the number of days to show by clicking on
2231 the number of days (text field is always there with opacity=0).
2233 * public/v3/pages/charts-toolbar.js:
2234 (ChartsToolbar): Store the minimum and maximum number of days allowed. Also rename _inputElement
2235 to _slider and added a new type=number text field as _editor.
2236 (ChartsToolbar.prototype.render):
2237 (ChartsToolbar.prototype.setStartTime): Exit the text mode when the number of days is changed by
2238 an URL state transition (i.e. back/forward navigation).
2239 (ChartsToolbar.prototype._setInputElementValue): Added. Updates the values of _slider and _editor.
2240 (ChartsToolbar.prototype._enterTextMode): Added. Hide the elements used by the slider mode and
2241 show the text field.
2242 (ChartsToolbar.prototype._exitTextMode): Added. Does the opposite.
2243 (ChartsToolbar.prototype._sliderValueMayHaveChanged): Renamed from _inputValueMayHaveChanged.
2244 (ChartsToolbar.prototype._editorValueMayHaveChanged): Added. Similar to _sliderValueMayHaveChanged
2245 but also corrects the value of _editor if needed.
2246 (ChartsToolbar.prototype._callNumberOfDaysCallback): Extracted from _inputValueMayHaveChanged.
2247 Also fixed a bug that we didn't update the URL state when the change event was fired without
2248 modifying the effective number of days.
2249 (ChartsToolbar.cssTemplate): Tweaked the style to support the new mode. Also set a fixed width on
2250 the span showing the number of days in the slider mode.
2252 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2254 Zooming button is broken on v3 UI
2255 https://bugs.webkit.org/show_bug.cgi?id=152777
2257 Reviewed by Chris Dumez.
2259 Bring up the zoom button in z-index so that users can click it.
2261 * public/v3/components/interactive-time-series-chart.js:
2262 (InteractiveTimeSeriesChart.cssTemplate):
2264 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2266 v3 UI doesn't preserve the time range when charts page is opened from a dashboard
2267 https://bugs.webkit.org/show_bug.cgi?id=152776
2269 Reviewed by Chris Dumez.
2271 Fixed the bug by moving the construction of charts URL from DashboardPage.prototype.open to
2272 DashboardPage.prototype.render and re-rendering the entire page upon an URL state transition.
2274 * public/v3/pages/charts-page.js:
2275 (ChartsPage.createStateForDashboardItem): Takes the start time for the charts page.
2277 * public/v3/pages/dashboard-page.js:
2278 (DashboardPage.prototype.updateFromSerializedState): Merged _numberOfDaysDidChange and
2279 _updateChartsDomainFromToolbar into this function since they're not used elsewhere. Also re-render
2280 the entire page when transition between different number of days to show.
2281 (DashboardPage.prototype._numberOfDaysDidChange): Deleted.
2282 (DashboardPage.prototype._updateChartsDomainFromToolbar): Deleted.
2283 (DashboardPage.prototype.render): Construct URL for each charts here.
2284 (DashboardPage.prototype._createChartForCell): Don't construct URL here since this function is
2285 called once when the dashboard page is opened, and not when the time range is changed.
2287 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2289 Build fix for an old version of PHP after r194618.
2291 * public/api/measurement-set.php:
2293 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2295 A/B testing results should be visualized intuitively on v3 UI
2296 https://bugs.webkit.org/show_bug.cgi?id=152496
2298 Rubber-stamped by Chris Dumez.
2300 Add the "stacking block" view of A/B testing results to the analysis task page on v3 UI.
2302 The patch enhances JSON APIs at /api/analysis-task /api/measurement-set/ to reduce the number of
2303 HTTP requests, and adds two UI components: TestGroupResultsTable and AnalysisResultsViewer both
2304 of which inherits from an abstract superclass: ResultsTable.
2306 ResultsTable provides a tabular presentation of measured values in regular measurement sets and
2307 A/B testing results using groups of bar graphs created by BarGraphGroup. TestGroupResultsTable
2308 inherits from this class to display A/B testing configurations and the averaged results for each
2309 configuration, and AnalysisResultsViewer inherits from it to provide an intuitive visualization
2310 of the outcomes of all A/B testing results associated with a given analysis task.
2312 * public/api/analysis-tasks.php:
2313 (main): Add the capability to find the analysis task based on its build request.
2314 This allows /v3/#/analysis/task/?buildRequest=<id> to be hyperlinked on buildbot page.
2316 * public/api/measurement-set.php:
2317 (main): Removed the unused startTime and endTime, and added "analysisTask" to query parameters.
2318 (AnalysisResultsFetcher): Added. Used to fetch measured data associated with every build request
2319 on an analysis task.
2320 (AnalysisResultsFetcher::__construct):
2321 (AnalysisResultsFetcher::fetch): Unlike MeasurementSetFetcher, we fetch the list of commits and
2322 list of measurements separately since there will be a lot less builds and commits than measured
2323 data (since we're fetching measured values for all tests and their metrics).
2324 (AnalysisResultsFetcher::fetch_commits): Fetches commits.
2325 (AnalysisResultsFetcher::format_measurement): Like MeasurementSetFetcher::format_measurement but
2326 with config_type and config_metric since we're returning measured data for all metrics and test
2328 (AnalysisResultsFetcher::format_map): Similar to MeasurementSetFetcher::format_map.
2330 * public/v3/components/analysis-results-viewer.js: Added.
2331 (AnalysisResultsViewer): Added.
2332 (AnalysisResultsViewer.prototype.didUpdateResults): This callback is called by AnalysisTaskPage
2333 when A/B testing results become available.
2334 (AnalysisResultsViewer.prototype.render): Overrides ResultsTable's render to highlight the block
2335 representing the currently selected test group.
2337 (AnalysisResultsViewer.prototype.buildRowGroups): Creates a list of rows with "stacking blocks"
2338 that visualizes A/B testing results. The algorithm works as follows: 1. Create all table rows.
2339 2. Find which row is associated with each set in each test group. 3. Layout "blocks".
2341 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Collects root sets from all data
2342 in the measurement set as well as A/B testing **requests** (results may contain more repositories
2343 than requested but they aren't interesting for the purpose of visualizing results for the entire
2346 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Create table rows. First,
2347 create table rows for measurement set points that have a matching test group (i.e. either set A
2348 or set B of an A/B testing uses the same root set as a point). Second, insert a new row for each
2349 root set in each test group which didn't find a matching measurement set point. There is a little
2350 subtlety that some A/B testing may specify revisions for a subset of repositories and/or some A/B
2351 testing results may appear as if it goes back in time with respect to other A/B testing results.
2352 For example, consider creating two A/B test groups for WebKit changes and OS changes separately.
2353 There could be no coherent linearization of those two A/B testing in which both WebKit and OS
2354 versions move forward.
2356 (AnalysisResultsViewer.RootSetInTestGroup): Added. Represents a pair (test group, root set) since
2357 a root set could be shared by multiple test groups.
2358 (AnalysisResultsViewer.TestGroupStackingBlock): Added. A stacked block representing a test group.
2359 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex): Associates a row number with
2360 either set A or set B.
2361 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Creates a table cell
2363 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Returns true if this test group
2364 has failed and this block should look "thin" without any label.
2365 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus): Computes the
2366 status for this test group.
2368 (AnalysisResultsViewer.TestGroupStackingGrid): Added. AnalysisResultsViewer uses this class to
2369 layout blocks representing test groups.
2370 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.insertBlockToColumn): Inserts a new block
2371 to layout. We keep all test groups doing the same A/B test next to each other.
2372 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.layout): Layouts each block / test group
2373 in the order they are created.
2374 (AnalysisResultsViewer.TestGroupStackingGrid.prototype._layoutBlock): Places the block in the
2375 left-most column that can accommodate it while avoiding columns of a different thin-ness. A column
2376 is thin if its A/B testing has failed, and not thin otherwise.
2377 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.createCellsForRow): Creates table cells for
2378 a given row. For each column, generate a table cell if we're in the first row and the first block
2379 starts in a later row, a block starts in the current row, or the last block ended in the previous
2380 row and the next block or the last row appears later.
2382 * public/v3/components/bar-graph-group.js: Added. A component for showing a group of bar graphs.
2383 (BarGraphGroup): Added. Creates a group of bar graphs with the same value range. It's used by
2384 AnalysisResultsViewer and ResultsTable to show bar graphs to compare values.
2385 (SingleBarGraph): A component created and collectively controlled by BarGraphGroup.
2387 * public/v3/components/results-table.js: Added.
2388 (ResultsTable): An abstract superclass for TestGroupResultsTable and AnalysisResultsViewer.
2390 (ResultsTable.prototype.render): Renders the table. 1. Call "buildRowGroups()" implemented by
2391 a subclass to obtain the list of rows. 2. Compute the list of repositories to show. 3. For each
2392 cell in the table, compute the number of rows to show the same value (for rowspan). 4. Render the
2393 table with an extra list of repositories if exists.
2395 (ResultsTable.prototype._computeRepositoryList): Compute the list of repositories to list
2396 revisions in the table. Omit repositories not present in any row or for which all rows have the
2397 same revision. In the latter case, include it in the extra repositories listed below the table.
2398 This minimizes the amount of redundant information presented to the user.
2400 (ResultsTableRow): Added. Represents a single row in the table. ResultsTable constructs necessary
2401 table cells to tabulate the associated root sets, and shows the associated result using a grouped
2402 bar graph. Additional columns are used by AnalysisResultsViewer to show stacked blocks for A/B
2405 * public/v3/components/test-group-results-table.js: Added.
2406 (TestGroupResultsTable):
2407 (TestGroupResultsTable.prototype.didUpdateResults):
2408 (TestGroupResultsTable.prototype.setTestGroup):
2409 (TestGroupResultsTable.prototype.heading):
2410 (TestGroupResultsTable.prototype.render):
2411 (TestGroupResultsTable.prototype.buildRowGroups):
2413 * public/v3/index.html:
2414 * public/v3/models/analysis-results.js: Added.
2415 (AnalysisResults): Added. Like MeasurementSet, this class represents a set of measured values
2416 associated with a given analysis task.
2417 (AnalysisResults.prototype.find): Returns a measured valued for a given build and metric.
2418 (AnalysisResults.prototype.add): Adds a new measured value. Used by AnalysisResults.fetch.
2419 (AnalysisResults.fetch): Fetches data and creates AnalysisResults for a given analysis task.
2421 * public/v3/models/analysis-task.js:
2422 (AnalysisTask.prototype.startMeasurementId): Added.
2423 (AnalysisTask.prototype.endMeasurementId): Added.
2424 (AnalysisTask.fetchByBuildRequestId): Added.
2425 (AnalysisTask._fetchSubset): Uses DataModelObject.cachedFetch.
2427 * public/v3/models/build-request.js: Added.
2428 (BuildRequest): Added. Represents a single A/B testing request associated with a test group.
2430 * public/v3/models/builder.js:
2431 (Build): Added. Represents a build associated with a given A/B testing result.
2433 * public/v3/models/commit-log.js:
2434 (CommitLog): Made this class inherit from DataModelObject.
2435 (CommitLog.ensureSingleton): Added. Finds the singleton object created for a given revision
2436 in the specified repository. This helps RootSet and other classes compare commits fast.
2437 (CommitLog.prototype.repository): Added.
2438 (CommitLog.fetchBetweenRevisions): Uses CommitLog.ensureSingleton.
2440 * public/v3/models/data-model.js:
2442 (DataModelObject.namedStaticMap): Added.
2443 (DataModelObject.ensureNamedStaticMap): Renamed from namedStaticMap instead of implicitly
2444 assuming that the non-static version always creates the map.
2445 (DataModelObject.prototype.namedStaticMap): Added.
2446 (DataModelObject.cachedFetch): Extracted from AnalysisTask._fetchSubset so that TestGroup's
2447 fetchByTask could also use it.
2450 * public/v3/models/measurement-adaptor.js: Added.
2451 (MeasurementAdaptor): Extracted from MeasurementCluster. This class is responsible for
2452 re-formatting the data received via /api/measurement-set JSON API inside the v3 UI.
2453 (MeasurementAdaptor.prototype.extractId): Added.
2454 (MeasurementAdaptor.prototype.adoptToAnalysisResults): Added. Used by AnalysisResults.
2455 (MeasurementAdaptor.aggregateAnalysisResults): Added. Used by TestGroupResultsTable to
2456 aggregate results for each test configuration; e.g. computing the average for set A.
2457 (MeasurementAdaptor.prototype.adoptToSeries): Extracted from MeasurementCluster.addToSeries.
2458 Added rootSet() to each point. This allows AnalysisResultsViewer to compare them against root
2459 sets associated with A/B testing results.
2460 (MeasurementAdaptor.computeConfidenceInterval): Moved from MeasurementCluster.
2462 * public/v3/models/measurement-cluster.js:
2463 (MeasurementCluster):
2464 (MeasurementCluster.prototype.addToSeries):
2466 * public/v3/models/repository.js:
2467 (Repository.prototype.hasUrlForRevision): Added.
2469 * public/v3/models/root-set.js: Added.
2470 (RootSet): Added. Represents a set of commits in measured results.
2471 (MeasurementRootSet): Added. Ditto for results associated with A/B testing.
2473 * public/v3/models/test-group.js: Added.
2474 (TestGroup): Added. Represents a A/B testing on analysis task.
2475 (TestGroup.prototype.createdAt): Added.
2476 (TestGroup.prototype.buildRequests): Returns the list of build requests associated with this
2478 (TestGroup.prototype.addBuildRequest): Added. Used by BuildRequest's constructor to associate
2479 itself with this group.
2480 (TestGroup.prototype.didSetResult): Added. Called by BuildRequest.setResult when measured
2481 values are fetched and associated with a build request in this group.
2483 * public/v3/models/test.js:
2486 * public/v3/pages/analysis-task-page.js:
2488 (AnalysisTaskPage.prototype.updateFromSerializedState): Fetch the analysis task, test groups
2489 associated with it, and all A/B testing results based on the task id or the build request id
2490 specified in the URL.
2491 (AnalysisTaskPage.prototype._didFetchTask): Added. Start fetching the measured data. This is
2492 the data on charts page for which this analysis task was created, not results of A/B testing.
2493 (AnalysisTaskPage.prototype._didFetchMeasurement): Added. Display the fetched data in a table
2494 inside AnalysisResultsViewer.
2495 (AnalysisTaskPage.prototype._didFetchTestGroups): Added. Display the list of A/B test groups
2496 as well as the results of the first A/B testing.
2497 (AnalysisTaskPage.prototype._didFetchAnalysisResults): Added.
2498 (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Added. Once both the analysis task,
2499 A/B test groups as well as their results are fetched, update build requests in each test group
2501 (AnalysisTaskPage.prototype.render): Show the list of test groups and highlight the currently
2503 (AnalysisTaskPage.prototype._showTestGroup): Added. A callback used by AnalysisResultsViewer
2504 and TestGroupResultsTable to notify this class when the user selects a new test group.
2505 (AnalysisTaskPage.htmlTemplate): Updated the template.
2506 (AnalysisTaskPage.cssTemplate): Ditto.
2508 * public/v3/pages/charts-page.js:
2509 (ChartsPage.createStateForAnalysisTask): Added. Creates a URL state object for opening a chart
2510 associated with an analysis task.
2512 2015-12-22 Ryosuke Niwa <rniwa@webkit.org>
2514 Analysis task page is slow to load
2515 https://bugs.webkit.org/show_bug.cgi?id=152517
2517 Reviewed by Andreas Kling.
2519 The slowness comes from r194130 which made the JSON API at /api/analysis-tasks to report the start
2520 and the end of each analysis task. This query was adding ~2s to the total JSON generation time.
2522 Cache these values on analysis_task table since they never change once an analysis task is created.
2524 * init-database.sql: Added columns task_start_run_time and task_end_run_time to analysis_task table.
2525 Also added the missing drop statements at the top.
2527 * public/api/analysis-tasks.php:
2528 (fetch_and_push_bugs_to_tasks): Don't fetch the latest commit time of the start and the end.
2529 (format_task): Report task_start_run_time and task_end_run_time as startRunTime and endRunTime.
2531 * public/privileged-api/create-analysis-task.php:
2532 (main): Set start_run_time and end_run_time when creating an analysis task.
2533 (time_for_run): Added.
2535 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2537 v3 UI shouldn't open/close pane selector by mouseenter/leave
2538 https://bugs.webkit.org/show_bug.cgi?id=152399
2540 Reviewed by Andreas Kling.
2542 Removed the code to open and close the pane selector by mouseenter and mouseleave
2543 since multiple people have complained about the behavior.
2545 * public/v3/pages/charts-toolbar.js:
2546 (ChartsToolbar): Removed the event listeners.
2547 (ChartsToolbar.prototype._addPane): Don't close the pane selector when adding a new pane
2548 to better support the use case of adding multiple panes.
2549 (ChartsToolbar.cssTemplate): Tweaked CSS.
2551 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2553 Popover for analysis tasks shows up at the left edge of annotation bars in the v3 UI
2554 https://bugs.webkit.org/show_bug.cgi?id=152389
2556 Reviewed by Darin Adler.
2558 Compute the x coordinate of the popover from the center of each annotation bar.
2560 Also adjust the x coordinate to keep the popover within the charts.
2562 * public/v3/components/interactive-time-series-chart.js:
2563 (InteractiveTimeSeriesChart.prototype._renderChartContent):
2565 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2567 Dashboard charts should have uniform widths on v3 UI
2568 https://bugs.webkit.org/show_bug.cgi?id=152395
2570 Reviewed by Chris Dumez.
2572 Fix the bug by applying table-layout: fixed on the dashboard table.
2574 * public/v3/pages/dashboard-page.js:
2575 (DashboardPage.prototype.render): Added header-column as a class name to explicitly set the header column with.
2576 (DashboardPage.cssTemplate): Adjusted CSS accordingly.
2578 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2580 Closing a pane on v3 UI always closes the last pane
2581 https://bugs.webkit.org/show_bug.cgi?id=152388
2583 Reviewed by Chris Dumez.
2585 The bug was caused by closePane being called without arguments. (The first argument to bind is "this" value.)
2586 Fixed it by passing in "this" pane object to the first argument.
2588 * public/v3/pages/chart-pane.js:
2591 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2593 Perf Dashboard v3 UI doesn't show recent data points on v2 UI
2594 https://bugs.webkit.org/show_bug.cgi?id=152368
2596 Reviewed by Chris Dumez.
2598 The bug was caused by the last modified date in measurement set JSON being a string instead of a POSIX timestamp,
2599 which prevented the v3 UI from invalidating the cache. Specifically, the following boolean logic always evaluated
2600 to false because +data['lastModified'] was NaN in MeasurementSet.prototype._fetch (/v3/models/measurement-set.js):
2602 !clusterEndTime && useCache && +data['lastModified'] < self._lastModified
2604 Fixed the bug by calling Database::to_js_time on the last modified date fetched from the database.
2606 * public/api/measurement-set.php:
2607 (MeasurementSetFetcher::fetch_config_list): Convert the string returned by the database to a POSIX timestamp.
2608 * tests/api-measurement-set.js: Added a test to ensure the last modified date in JSON is numeric. Since the value
2609 of the last modified date depends on when tests run, we can't assert it to be a certain value.
2611 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2613 v3 UI should show and link the build number on charts page
2614 https://bugs.webkit.org/show_bug.cgi?id=152359
2616 Reviewed by Chris Dumez.
2618 Show the hyperlinked build number in the v3 UI.
2620 * public/v3/models/builder.js:
2621 (Builder): Renamed _buildURL to _buildUrlTemplate.
2622 (Builder.prototype.urlForBuild): Added.
2623 * public/v3/pages/chart-pane-status-view.js:
2624 (ChartPaneStatusView):
2625 (ChartPaneStatusView.prototype.render): Added the code to render hyperlinked build number when one is available.
2626 (ChartPaneStatusView.prototype.computeChartStatusLabels): Store currentPoint's measurement object as _buildInfo
2627 if the current point is set by an indicator (not by a selection).
2629 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2631 v3 dashboard doesn't stretch charts to fill the screen
2632 https://bugs.webkit.org/show_bug.cgi?id=152354
2634 Reviewed by Chris Dumez.
2636 The bug was caused by a workaround to avoid canvas stretching table cell too much.
2638 Fix the problem instead by making the canvas absolutely positioned inside the "time-series-chart" element
2639 so that it does not contribute to the intrinsic/natural width of the cell.
2641 * public/v3/components/time-series-chart.js:
2642 (TimeSeriesChart.prototype._ensureCanvas): Make the canvas absolutely positioned inside the shadow root.
2643 (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Use the container element's size now that
2644 the canvas does not resize with it.
2645 * public/v3/pages/dashboard-page.js:
2646 (DashboardPage.cssTemplate): Updated the CSS so that the chart stretches all the way.
2648 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2650 The chart status on v3 UI sometimes show wrong revision ranges
2651 https://bugs.webkit.org/show_bug.cgi?id=152331
2653 Reviewed by Chris Dumez.
2655 The bug was caused by the status view not taking the data sampling that happens in TimeSeriesChart into account
2656 when finding the previous point. Take this into account by using InteractiveTimeSeries.currentPoint(-1) which
2657 finds the sampled data point immediately preceding the current point (at which the indicator is shown).
2659 * public/v3/components/chart-status-view.js:
2660 (ChartStatusView.prototype.updateStatusIfNeeded):
2662 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2664 Perf dashboard's cycler page should use v3 UI
2665 https://bugs.webkit.org/show_bug.cgi?id=152324
2667 Reviewed by Chris Dumez.
2669 Use the v3 UI in cycler.html after r194130.
2671 * public/cycler.html:
2672 * public/v3/index.html: Removed the reference to a non-existent platform-selector.js.
2674 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2676 Add v3 UI to perf dashboard
2677 https://bugs.webkit.org/show_bug.cgi?id=152311
2679 Reviewed by Chris Dumez.
2681 Add the third iteration of the perf dashboard UI. UI for viewing and modifying analysis tasks is coming soon.
2682 The v3 UI is focused on speed, and removes all third-party script dependencies including jQuery, d3, and Ember.
2683 Both the DOM-based UI and graphing are implemented manually.
2686 The entire app is structured using new component library implemented in components/base.js. Each component is
2687 an instance of a subclass of ComponentBase which owns a single DOM element. Each subclass may supply static
2688 methods named htmlTemplate and cssTemplate as the template for a component instance. ComponentBase automatically
2689 clones the templates inside the associated element (or its shadow root on the supported browsers). Each subclass
2690 must supply a method called "render()" which constructs and updates the DOM as needed.
2692 There is a special component called Page, which represents an entire page. Each Page is opened by PageRouter's
2693 "route()" function. Each subclass of Page supplies "open()" for initialization and "updateFromSerializedState()"
2694 for a hash URL transition.
2697 The key feature of the v3 UI is the split of time series into chunks called clusters (see r194120). On an internal
2698 instance of the dashboard, the v2 UI downloads 27MB of data whereas the same page loads only 3MB of data in the v3.
2699 The key logic for fetching time series in chunks is implemented by MeasurementSet in /v3/models/measurement-set.js.
2700 We first fetch the cached primary cluster (the cluster that contains the newest data) at:
2701 /data/measurement-set-<platform-id>-<metric-id>.json
2703 If that's outdated according to lastModified in manifest.json, then we immediately re-fetch the primary cluster at:
2704 /api/measurement-set/?platform=<platform-id>&metric=<metric-id>
2706 Once the up-to-date primary cluster is fetched, we fetch all "secondary" clusters. For each cluster being fetched,
2707 including the primary, we invoke registered callbacks.
2710 In addition, the v3 UI reduces the initial page load time by loading a single bundled JS file generated by
2711 tools/bundle-v3-scripts.py. index.html has a fallback to load all 44 JS files individually during development.
2713 * public/api/analysis-tasks.php:
2714 (fetch_and_push_bugs_to_tasks): Added the code to fetch start and end run times. This is necessary in V3 UI
2715 because no longer fetch the entire time series. See r194120 for the new measurement set JSON API.
2716 (format_task): Compute the category of an analysis task based on "result" value. This will be re-vamped once
2717 I add the UI for the analysis task page in v3.
2719 * public/include/json-header.php:
2720 (require_format): CamelCase the name.
2721 (require_match_one_of_values): Ditto.
2722 (validate_arguments): Renamed from require_existence_of and used in measurement-set.php landed in r194120.
2725 * public/v3/components: Added.
2727 * public/v3/components/base.js: Added.
2728 (ComponentBase): The base component class.
2729 (ComponentBase.prototype.element): Returns the DOM element associated with the DOM element.
2730 (ComponentBase.prototype.content): Returns the shadow root if one exists and the associated element otherwise.
2731 (ComponentBase.prototype.render): To be implemented by a subclass.
2732 (ComponentBase.prototype.renderReplace): A helper function to "render" DOM contents.
2733 (ComponentBase.prototype._constructShadowTree): Called inside the constructor to instantiate the templates.
2734 (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Instantiates components referred by
2735 its element name inside the instantiated content.
2736 (ComponentBase.isElementInViewport): A helper function. Returns true if the element is in the viewport and it has
2737 non-zero width and height.
2738 (ComponentBase.defineElement): Defines a custom element that can be automatically instantiated from htmlTemplate.
2739 (ComponentBase.createElement): A helper function to create DOM tree to be used in "render()" method.
2740 (ComponentBase._addContentToElement): A helper for "createElement".
2741 (ComponentBase.createLink): A helper function to create a hyperlink or another clickable element (via callback).
2742 (ComponentBase.createActionHandler): A helper function to create an event listener that prevents the default action
2743 and stops the event propagation.
2745 * public/v3/components/button-base.js: Added.
2747 * public/v3/components/chart-status-view.js: Added.
2748 (ChartStatusView): A component that reports the current status of time-series-chart. It's subclasses by
2749 ChartPaneStatusView to provide additional information in the charts page's panes.
2751 * public/v3/components/close-button.js: Added.
2753 * public/v3/components/commit-log-viewer.js: Added.
2754 (CommitLogViewer): A component that lists commit revisions along with commit messages for a range of data points.
2756 * public/v3/components/interactive-time-series-chart.js: Added.
2757 (InteractiveTimeSeriesChart): A subclass of InteractiveTimeSeriesChart with interactivity (selection & indicator).
2758 Selection and indicator are mutually exclusive.
2760 * public/v3/components/pane-selector.js: Added.
2761 (PaneSelector): A component for selecting (platform, metric) pair to add in the charts page.
2763 * public/v3/components/spinner-icon.js: Added.
2765 * public/v3/components/time-series-chart.js: Added.
2766 (TimeSeriesChart): A canvas-based chart component without interactivity. It takes a source list and options as
2767 the constructor arguments. A source list is a list of measurement sets (measurement-set.js) with drawing options.
2768 This component fetches data via MeasurementSet.fetchBetween inside TimeSeriesChart.prototype.setDomain and
2769 progressively updates the charts as more data arrives. The canvas is updated on animation frame via rAF and all
2770 layout and rendering metrics are lazily computed in _layout. In addition, this component samples data before
2771 rendering the chart when there are more data points per pixel in _ensureSampledTimeSeries.
2773 * public/v3/index.html: Added. Loads bundled-scripts.js if it exists, or individual script files otherwise.
2775 * public/v3/instrumentation.js: Added. This class is used to gather runtime statistics of v3 UI. (It measures
2776 the performance of the perf dashboard UI).
2778 * public/v3/main.js: Added. Bootstraps the app.
2782 * public/v3/models: Added.
2783 * public/v3/models/analysis-task.js: Added.
2784 * public/v3/models/bug-tracker.js: Added.
2785 * public/v3/models/bug.js: Added.
2786 * public/v3/models/builder.js: Added.
2787 * public/v3/models/commit-log.js: Added.
2788 * public/v3/models/data-model.js: Added.
2789 (DataModelObject): The base class for various data objects that correspond to database tables. It supplies static
2790 hash map to find entries by id as well as other keys.
2791 (LabeledObject): A subclass of DataModelObject with the capability to find an object via its name.
2793 * public/v3/models/measurement-cluster.js: Added.
2794 (MeasurementCluster): Represents a single cluster or a chunk of data in a measurement set.
2796 * public/v3/models/measurement-set.js: Added.
2797 (MeasurementSet): Represents a measurement set.
2798 (MeasurementSet.findSet): Returns the singleton set given (metric, platform). We use singleton to avoid issuing
2799 multiple HTTP requests for the same JSON when there are multiple TimeSeriesChart that show the same graph (e.g. on
2800 charts page with overview and main charts).
2801 (MeasurementSet.prototype.findClusters): Finds the list of clusters to fetch in a given time range.
2802 (MeasurementSet.prototype.fetchBetween): Fetch clusters for a given time range and calls callback whenever new data
2803 arrives. The number of callbacks depends on the how many clusters need to be newly fetched.
2804 (MeasurementSet.prototype._fetchSecondaryClusters): Fetches non-primary (non-latest) clusters.
2805 (MeasurementSet.prototype._fetch): Issues a HTTP request to fetch a cluster.
2806 (MeasurementSet.prototype._didFetchJSON): Called when a cluster is fetched.
2807 (MeasurementSet.prototype._failedToFetchJSON): Called when the fetching of a cluster has failed.
2808 (MeasurementSet.prototype._invokeCallbacks): Invokes callbacks upon an approval of a new cluster.
2809 (MeasurementSet.prototype._addFetchedCluster): Adds the newly fetched cluster in the order.
2810 (MeasurementSet.prototype.fetchedTimeSeries): Returns a time series that contains data from all clusters that have
2812 (TimeSeries.prototype.findById): Additions to TimeSeries defined in /v2/data.js.
2813 (TimeSeries.prototype.dataBetweenPoints): Ditto.
2814 (TimeSeries.prototype.firstPoint): Ditto.
2816 * public/v3/models/metric.js: Added.
2817 * public/v3/models/platform.js: Added.
2818 * public/v3/models/repository.js: Added.
2819 * public/v3/models/test.js: Added.
2821 * public/v3/pages: Added.
2822 * public/v3/pages/analysis-category-page.js: Added. The "Analysis" page that lists the analysis tasks.
2823 * public/v3/pages/analysis-category-toolbar.js: Added. The toolbar to filter analysis tasks based on its category
2824 (unconfirmed, bisecting, identified, closed) and a keyword.
2826 * public/v3/pages/analysis-task-page.js: Added. Not implemented yet. It just has the hyperlink to the v2 UI.
2828 * public/v3/pages/chart-pane-status-view.js: Added.
2829 (ChartPaneStatusView): A subclass of ChartStatusView used in the charts page. In addition to the current value,
2830 comparison to baseline/target, it shows the list of repository revisions (e.g. WebKit revision, OS version).
2832 * public/v3/pages/chart-pane.js: Added.
2833 (ChartPane): A component a pane in the charts page. Each pane has the overview chart and the main chart. The zooming
2834 is synced across all panes in the charts page.
2836 * public/v3/pages/charts-page.js: Added. Charts page.
2837 * public/v3/pages/charts-toolbar.js: Added. The toolbar to set the number of days to show. This affects the overview
2838 chart's domain in each pane.
2840 * public/v3/pages/create-analysis-task-page.js: Added.
2841 (CreateAnalysisTaskPage): A page that gets shown momentarily while creating a new analysis task.
2843 * public/v3/pages/dashboard-page.js: Added. A dashboard page.
2844 * public/v3/pages/dashboard-toolbar.js: Added. Its toolbar with buttons to select the number of days to show.
2845 * public/v3/pages/domain-control-toolbar.js: Added. An abstract superclass of charts and dashboard toolbars.
2847 * public/v3/pages/heading.js: Added. A component for displaying the header and toolbar, if exists, on each page.
2848 * public/v3/pages/page-router.js: Added. This class is responsible for updating the URL hashes as well as opening
2849 and updating each page when the hash changes (via back/forward navigation).
2850 * public/v3/pages/page-with-charts.js: Added. An abstract subclass of page used by dashboards and charts page.
2851 Supplies helper functions for creating TimeSeriesChart options.
2852 * public/v3/pages/page-with-heading.js: Added. An abstract subclass of page that uses the heading component.
2853 * public/v3/pages/page.js: Added. The Page component.
2854 * public/v3/pages/toolbar.js: Added. An abstract toolbar component.
2856 * public/v3/remote.js: Added.
2857 (getJSON): Fetches JSON from the remote server.
2858 (getJSONWithStatus): Ditto. Rejects the response if the status is not "OK".
2859 (PrivilegedAPI.sendRequest): Posts a HTTP request to a privileged API in /privileged-api/.
2860 (PrivilegedAPI.requestCSRFToken): Creates a new CSRF token to request a privileged API post.
2862 * tools/bundle-v3-scripts.py: Added.
2863 (main): Bundles js files together and minifies them by jsmin.py for the v3 UI. Without this script, we're forced to
2864 download 44 JS files or making each JS file contain multiple classes.
2866 * tools/jsmin.py: Copied from WebInspector / JavaScriptCore code.
2868 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2870 Fix v2 UI after r194093.
2872 * public/v2/data.js:
2874 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2876 Add /api/measurement-set for v3 UI
2877 https://bugs.webkit.org/show_bug.cgi?id=152312
2879 Rubber-stamped by Chris Dumez.
2881 The new API JSON allows the front end to fetch measured data in chunks called a "cluster" as specified
2882 in config.json for each measurement set specified by the pair of a platform and a metric.
2884 When the front end needs measured data in a given time range (t_0, t_1) for a measurement set, it first
2885 fetches the primary cluster by /api/measurement-set/?platform=<platform-id>&metric=<metric-id>.
2886 The primary cluster is the last cluster in the set (returning the first cluster here is not useful
2887 since we don't typically show very old data), and provides the information needed to fetch other clusters.
2889 Fetching the primary cluster also creates JSON files at:
2890 /data/measurement-set-<platform-id>-<metric-id>-<cluster-end-time>.json
2891 to allow latency free access for secondary clusters. The front end code can also fetch the cache of
2892 the primary cluster at: /data/measurement-set-<platform-id>-<metric-id>.json.
2894 Because the front end code has to behave as if all data is fetched, each cluster contains one data point
2895 immediately before the first data point and one immediately after the last data point. This avoids having
2896 to fetch multiple empty clusters for manually specified baseline data. To support this behavior, we generate
2897 all clusters for a given measurement set at once when the primary cluster is requested.
2899 Furthermore, all measurement sets are divided at the same time into clusters so that the boundary of clusters
2900 won't shift as more data are reported to the server.
2902 * config.json: Added clusterStart and clusterSize as options.
2903 * public/api/measurement-set.php: Added.
2905 (MeasurementSetFetcher::__construct):
2906 (MeasurementSetFetcher::fetch_config_list): Finds configurations that belongs to this (platform, metric) pair.
2907 (MeasurementSetFetcher::at_end): Returns true if we've reached the end of all clusters for this set.
2908 (MeasurementSetFetcher::fetch_next_cluster): Generates the JSON data for the next cluster. We generate clusters
2909 in increasing chronological order (the oldest first and the newest last).
2910 (MeasurementSetFetcher::execute_query): Executes the main query.
2911 (MeasurementSetFetcher::format_map): Returns the mapping of a measurement field to an array index. This removes
2912 the need to have key names for each measurement and reduces the JSON size by ~10%.
2913 (MeasurementSetFetcher::format_run): Creates an array that contains data for a single measurement. The order
2914 matches that of keys in format_map.
2915 (MeasurementSetFetcher::parse_revisions_array): Added. Copied from runs.php.
2916 * tests/api-measurement-set.js: Added. Added tests for /api/measurement-set.
2918 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2920 Using fake timestamp in OS version make some results invisible
2921 https://bugs.webkit.org/show_bug.cgi?id=152289
2923 Reviewed by Stephanie Lewis.
2925 Fix various bugs after r194088.
2927 * public/api/commits.php:
2928 (format_commit): Include the commit order.
2929 * public/v2/data.js:
2930 (CommitLogs._cacheConsecutiveCommits): Sort by commit order when commit time is missing.
2931 * tools/pull-os-versions.py:
2932 (OSBuildFetcher._assign_order): Use integer instead of fake time for commit order.
2933 (available_builds_from_command): Exit early when an exception is thrown.
2935 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2937 Fix a typo in the previous commit.
2939 * public/include/report-processor.php:
2941 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2943 Build fix after r192965. Suppress a warning about log being referred to as a closure variable.
2945 * public/include/report-processor.php:
2947 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2949 Using fake timestamp in OS version make some results invisible
2950 https://bugs.webkit.org/show_bug.cgi?id=152289
2952 Reviewed by Stephanie Lewis.
2954 Added commit_order column to explicitly order OS versions. This fixes the bug whereby which
2955 baseline results reported with only OS versions are shown with x coordinate set to 10 years ago.
2957 To migrate the existing database, run:
2958 ALTER TABLE commits ADD COLUMN commit_order integer;
2959 CREATE INDEX commit_order_index ON commits(commit_order);
2961 Then for each repository $1,
2962 UPDATE commits SET (commit_time, commit_order) = (NULL, CAST(EXTRACT(epoch from commit_time) as integer))
2963 WHERE commit_repository = $1;
2966 * init-database.sql: Added the column.
2967 * public/api/commits.php:
2968 (fetch_commits_between): Use commit_order to order commits when commit_time is missing.
2969 * public/api/report-commits.php:
2970 (main): Set commit_order.
2971 * tools/pull-os-versions.py:
2972 (OSBuildFetcher.fetch_and_report_new_builds):
2973 (OSBuildFetcher._assign_order): Renamed from _assign_fake_timestamps. Set the order instead of a fake timestmap.
2975 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2977 Perf dashboard can't merge when the destination platform is missing baseline/target
2978 https://bugs.webkit.org/show_bug.cgi?id=152286
2980 Reviewed by Stephanie Lewis.
2982 The bug was caused by the query to migrate test configurations to new platform checking
2983 configuration type and metric separately; that is, it assumes the configuration exists
2984 only if either the same type or the same metric exists in the destination.
2986 Fixed the bug by checking both conditions simultaneously for each configuration.
2988 * public/admin/platforms.php:
2989 * tests/admin-platforms.js: Added a test.
2991 2015-12-11 Ryosuke Niwa <rniwa@webkit.org>
2993 Perf dashboard's buildbot sync config JSON duplicates too much information
2994 https://bugs.webkit.org/show_bug.cgi?id=152196
2996 Reviewed by Stephanie Lewis.
2998 Added shared, per-builder, and per-test (called type) configurations.
3000 * tools/sync-with-buildbot.py:
3002 (load_config.merge):
3004 2015-12-02 Ryosuke Niwa <rniwa@webkit.org>
3006 Perf dashboard should avoid overflow during geometric mean computation
3007 https://bugs.webkit.org/show_bug.cgi?id=151773
3009 Reviewed by Chris Dumez.
3011 * public/include/report-processor.php:
3013 2015-11-30 Ryosuke Niwa <rniwa@webkit.org>
3015 Perf dashboard should extend baseline and target to the future
3016 https://bugs.webkit.org/show_bug.cgi?id=151511
3018 Reviewed by Darin Adler.
3020 * public/v2/data.js:
3021 (RunsData.prototype.timeSeriesByCommitTime): Added extendToFuture as an argument.
3022 (RunsData.prototype.timeSeriesByBuildTime): Ditto.
3023 (RunsData.prototype._timeSeriesByTimeInternal): Ditto.
3024 (TimeSeries): Add a new point to the end if extendToFuture is set and the series is not empty.
3025 * public/v2/manifest.js:
3026 (App.Manifest._formatFetchedData): Set extendToFuture to true for baselines and targets.
3028 2015-11-30 Ryosuke Niwa <rniwa@webkit.org>
3030 Perf dashboard should always show comparison to baseline and target even if one is missing
3031 https://bugs.webkit.org/show_bug.cgi?id=151510
3033 Reviewed by Darin Adler.
3035 Show the comparison status against the baseline when baseline is present but target is missing.
3037 To make the code more readable, this patch splits the logic into three cases:
3038 1. Both baseline and target are present
3039 2. Only baseline is present
3040 3. Only target is present
3042 Also extracted a helper function to construct the label.
3045 (.labelForDiff): Added.
3046 (App.Pane.computeStatus):
3048 2015-11-23 Commit Queue <commit-queue@webkit.org>
3050 Unreviewed, rolling out r192716 and r192717.
3051 https://bugs.webkit.org/show_bug.cgi?id=151582
3053 The patch was incorrect. We always need at least one data
3054 point in each configuration (Requested by rniwa on #webkit).
3056 Reverted changesets:
3058 "Perf dashboard's should not include results more than 366
3060 https://bugs.webkit.org/show_bug.cgi?id=151529
3061 http://trac.webkit.org/changeset/192716
3063 "Build fix for old version of PHP."
3064 http://trac.webkit.org/changeset/192717
3066 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3068 Build fix for old version of PHP.
3070 * public/api/runs.php:
3072 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3074 Perf dashboard's should not include results more than 366 days old in JSON
3075 https://bugs.webkit.org/show_bug.cgi?id=151529
3077 Reviewed by Timothy Hatcher.
3079 Don't return results more than 366 days old in /api/runs/ JSON API.
3080 This is a ~5% runtime improvement and reduces the JSON file size by 20-50% in the internal perf dashboard.
3082 * public/api/runs.php:
3083 (main): Added the support for "?noResults" to avoid echoing results. This is useful for debugging.
3084 Also instantiate RunsGenerator before issuing the query to find all configurations so that the runtime cost
3085 of doing so will be included in elapsedTime.
3086 (RunsGenerator::fetch_runs): Skip a row when its build and commit times are more than 366 days old.
3087 (RunsGenerator::format_run): Takes build_time and revisions as arguments since fetch_runs uses them now.
3088 (RunsGenerator::parse_revisions_array): Compute the max of commit times.
3090 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3092 Remove chartPointRadius from interactive chart component
3093 https://bugs.webkit.org/show_bug.cgi?id=151480
3095 Reviewed by Darin Adler.
3097 Replaced the parameter by CSS rules.
3099 * public/v2/chart-pane.css:
3101 (.chart .dot.foreground):
3102 (.chart .highlight):
3104 * public/v2/index.html:
3105 * public/v2/interactive-chart.js:
3106 (App.InteractiveChartComponent.Ember.Component.extend._constructGraphIfPossible):
3107 (App.InteractiveChartComponent.Ember.Component.extend._highlightedItemsChanged):
3109 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3111 Perf dashboard's runs API uses more than 128MB of memory
3112 https://bugs.webkit.org/show_bug.cgi?id=151478
3114 Reviewed by Andreas Kling.
3116 Don't fetch all query results at once to avoid using twice as much memory as needed.
3117 Use iterative API to format each result at a time.
3119 This change is also a 5% runtime performance gain.
3121 * public/api/runs.php:
3122 (RunsGenerator::__construct): Takes a Database instance instead of a list of configurations. The latter is
3123 no longer needed as we pass in each configuration type explicitly to fetch_runs.
3124 (RunsGenerator::fetch_runs): Renamed from add_runs since it now executes the database query via execute_query.
3125 Also moved the logic to compute the last modified time here.
3126 (RunsGenerator::execute_query): Moved from fetch_runs_for_config. Use Database::query instead of query_and_fetch_all.
3127 (RunsGeneratorForTestGroup):
3128 (RunsGeneratorForTestGroup::__construct):
3129 (RunsGeneratorForTestGroup::execute_query): Moved from fetch_runs_for_config_and_test_group.
3131 * public/include/db.php:
3132 (generate_data_file): Lock the file to avoid corruption.
3134 2015-11-19 Ryosuke Niwa <rniwa@webkit.org>
3136 Perf dashboard always fetches charts JSON twice
3137 https://bugs.webkit.org/show_bug.cgi?id=151483
3139 Reviewed by Andreas Kling.
3141 Only re-generate "runs" JSON via /api/runs/ when the cache doesn't exist in /data/ or the cached JSON is
3142 obsolete (shouldRefetch is set true) or corrupt (the second closure).
3147 2015-11-18 Ryosuke Niwa <rniwa@webkit.org>
3149 Internal perf dashboard takes forever to load
3150 https://bugs.webkit.org/show_bug.cgi?id=151430
3152 Rubber-stamped by Antti Koivisto.
3154 Fix a few performance problems with the perf dashboard v2 UI.
3157 (App.DashboardRow._createPane): Set "inDashboard" to true.
3158 (App.Pane._fetch): Immediately show the cached chart instead of waiting for the refetched data which invokes
3159 a PHP JSON API. Also don't fetch the analysis tasks when the chart is shown in the dashboard since we don't
3160 show annotate charts in the dashboard.
3162 2015-10-15 Ryosuke Niwa <rniwa@webkit.org>
3164 Unreviewed fix of a test after r190687.
3166 * tests/admin-regenerate-manifest.js:
3168 2015-10-12 Ryosuke Niwa <rniwa@webkit.org>
3170 Perf dashboard tools shouldn't require server credentials in multiple configuration files
3171 https://bugs.webkit.org/show_bug.cgi?id=149994
3173 Reviewed by Chris Dumez.
3175 Made detect-changes.js and pull-svn.py pull username and passwords from the server config JSON to reduce
3176 the number of JSON files that need to include credentials.
3178 Also made each script reload the server config after sleep to allow dynamic credential updates.
3180 In addition, change the server config JSON's format to include scheme, host, and port numbers separately
3181 instead of a url since detect-changes.js needs each value separately.
3183 This reduces the number of JSONs with credentials to two for our internal dashboard.
3185 * tools/detect-changes.js:
3186 (main): Added a property argument parsing. Now takes --server-config-json, --change-detection-config-json,
3187 and --seconds-to-sleep like other scripts.