1 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
3 BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
4 https://bugs.webkit.org/show_bug.cgi?id=156008
6 Reviewed by Darin Adler.
8 Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.
10 Now, new syncing scripts must be able to figure out the build slave the first build requests in
11 a given test group had used in order to schedule subsequent build requests in the test group.
13 For this purpose, /api/build-requests has been modified to return all build requests whose test
14 group had not finished yet. A test group is finished if all build requests in the test group had
15 finished (completed, failed, or canceled).
17 * public/include/build-requests-fetcher.php:
18 (BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
19 groups that have not been finished.
20 * public/v3/models/build-request.js:
22 (BuildRequest.prototype.testGroupId): Added.
23 (BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
24 (BuildRequest.fetchForTriggerable): Added.
25 (BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
27 * public/v3/models/manifest.js:
28 (Manifest.fetch): Use the full path from root so that it works in server tests.
29 * public/v3/models/test-group.js:
30 (TestGroup.hasPending):
31 (TestGroup._createModelsFromFetchedTestGroups):
32 * server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
33 is present in the response returned by /api/build-requests iff any build request in the group had not
36 (.addAnotherMockTestGroup): Added.
37 * unit-tests/test-groups-tests.js:
39 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
41 Make dependency injection in unit tests more explicit
42 https://bugs.webkit.org/show_bug.cgi?id=156006
44 Reviewed by Joseph Pecoraro.
46 Make the dependency injection of model objects in unit tests explicit so that server tests that create
47 "real" model objects won't create these mock objects. Now each test that uses mock model objects would call
48 MockModels.inject() to inject before / beforeEach and access each object using a property on MockModels
49 instead of them being implicitly defined on the global object.
51 Similarly, MockRemoteAPI now only replaces global.RemoteAPI during each test so that server tests can use
52 real RemoteAPI to access the test Apache server.
54 * unit-tests/analysis-task-tests.js:
55 * unit-tests/buildbot-syncer-tests.js:
56 (createSampleBuildRequest):
57 * unit-tests/measurement-adaptor-tests.js:
58 * unit-tests/measurement-set-tests.js:
59 * unit-tests/resources/mock-remote-api.js:
60 (MockRemoteAPI.getJSONWithStatus):
61 (MockRemoteAPI.inject): Added. Override RemoteAPI on the global object during each test.
62 * unit-tests/resources/mock-v3-models.js:
63 (MockModels.inject): Added. Create mock model objects before each test, and clear all static maps of
64 various v3 model classes (to remove all singleton objects for those model classes).
65 * unit-tests/test-groups-tests.js:
67 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
69 BuildbotSyncer should be able to fetch JSON from buildbot
70 https://bugs.webkit.org/show_bug.cgi?id=155921
72 Reviewed by Joseph Pecoraro.
74 Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot
75 with lots of unit tests as this has historically been a source of subtle bugs in the old script.
77 New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that
78 the state of some builds may change between each HTTP request. In the old script, we fetched the list
79 of the pending builds, and requested -1, -2, etc... builds for N times. But between each request,
80 a pending build may start running or an in-progress build finish and shift the offset by one. The new
81 script avoids this problem by first requesting all pending builds, then all in-progress and finished
82 builds in a single HTTP request. The results are then merged so that entries for in-progress and
83 finished builds would override the entries for pending builds if they overlap.
85 Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes
86 the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js).
88 * server-tests/api-build-requests-tests.js:
89 * server-tests/api-manifest.js:
90 * tools/js/buildbot-syncer.js:
91 (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as
92 we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished
93 builds as 'currentStep' is always defined but null in those builds.
94 (BuildbotBuildEntry.prototype.buildNumber): Added.
95 (BuildbotBuildEntry.prototype.isPending): Added.
96 (BuildbotBuildEntry.prototype.hasFinished): Added.
97 (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds.
98 (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds.
99 (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added.
100 (BuildbotSyncer.prototype.urlForBuildJSON): Added.
101 (BuildbotSyncer.prototype.url): Added.
102 (BuildbotSyncer.prototype.urlForBuildNumber): Added.
103 * tools/js/remote.js:
104 (RemoteAPI.prototype.getJSON): Renamed from fetchJSON.
105 (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus.
106 * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node.
107 * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot
108 (samplePendingBuild):
109 (sampleInProgressBuild): Added.
110 (sampleFinishedBuild): Added.
111 * unit-tests/resources/mock-remote-api.js:
112 (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus.
114 2016-03-24 Ryosuke Niwa <rniwa@webkit.org>
116 Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
117 https://bugs.webkit.org/show_bug.cgi?id=155863
119 Reviewed by Joseph Pecoraro.
121 Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability
122 added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed
123 /admin/regenerate-manifest since it has been superseded by /api/manifest.
125 This patch also extracts manifest.js out of main.js so that it could be used and tested without the
128 * public/admin/regenerate-manifest.php: Deleted.
129 * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with
130 a trailing backslash.
131 * public/include/manifest.php:
132 (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories.
133 * public/v3/index.html:
136 * public/v3/models/bug-tracker.js:
137 (BugTracker.prototype.newBugUrl): Added.
138 (BugTracker.prototype.repositories): Added.
139 * public/v3/models/manifest.js: Added. Extracted from main.js.
140 (Manifest.fetch): Moved from main.js' fetchManifest.
141 (Manifest._didFetchManifest): Moved from main.js' didFetchManifest.
142 * public/v3/models/platform.js:
143 (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of
144 the same name. This is tested by the newly added test cases.
145 * server-tests/api-build-requests-tests.js:
146 * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js
147 with additional assertions for v3 UI model objects.
148 * server-tests/resources/test-server.js:
149 (TestServer.prototype.start):
150 (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API.
151 Also no longer takes dataDirectory as an argument since it's always the same.
152 (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data.
153 (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests.
154 (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an
155 unintended side effect of slowing down unit tests even through they don't need Postgres or Apache.
156 * tests/admin-regenerate-manifest.js: Removed.
157 * tools/js/database.js:
158 * tools/js/v3-models.js:
160 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
162 Add mocha server tests for /api/build-requests
163 https://bugs.webkit.org/show_bug.cgi?id=155831
165 Reviewed by Chris Dumez.
167 Added the new mocha.js based server-tests for /api/build-requests. The new harness automatically:
168 - starts a new Apache instance
169 - switches the database during testing via setting an environmental variable
170 - backups and restores public/data directory during testing
172 As a result, developer no longer has to manually setup Apache, edit config.json manually to use
173 a testing database, or run /api/manifest.php to re-generate the manifest file after testing.
175 This patch also makes ID resolution optional on /api/build-requests so that v3 model based syncing
176 scripts can re-use the same code as the v3 UI to process the JSON. tools/sync-with-buildbot.py has
177 been modified to use this option (useLegacyIdResolution).
179 * config.json: Added configurations for the test httpd server.
180 * init-database.sql: Don't error when tables and types don't exist (when database is empty).
181 * public/api/build-requests.php:
182 (main): Made the ID resolution optional with useLegacyIdResolution. Also removed "updates" from the
183 results JSON since it's never used.
184 * public/include/build-requests-fetcher.php:
185 (BuildRequestsFetcher::__construct):
186 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Fixed the bug that we would include the same
187 commit multiple times for each root set.
188 * public/include/db.php:
189 (config): If present, use ORG_WEBKIT_PERF_CONFIG_PATH instead of Websites/perf.webkit.org/config.json.
190 * server-tests: Added.
191 * server-tests/api-build-requests-tests.js: Added. Tests for /api/build-requests.
193 * server-tests/resources: Added.
194 * server-tests/resources/test-server.conf: Added. Apache configuration file for testing.
195 * server-tests/resources/test-server.js: Added.
197 (TestSever.prototype.start): Added.
198 (TestSever.prototype.stop): Added.
199 (TestSever.prototype.remoteAPI): Added. Configures RemoteAPI to be used with the test sever.
200 (TestSever.prototype.database): Added. Returns Database configured to use the test database.
201 (TestSever.prototype._constructTestConfig): Creates config.json for testing. The file is generated by
202 _start and db.php's config() reads it from the environmental variable: ORG_WEBKIT_PERF_CONFIG_PATH.
203 (TestSever.prototype._ensureDataDirectory): Renames public/data to public/original-data if exists,
204 and creates a new empty public/data.
205 (TestSever.prototype._restoreDataDirectory): Deletes public/data and renames public/original-data
207 (TestSever.prototype._ensureTestDatabase): Drops the test database if exists and creates a new one.
208 (TestSever.prototype.initDatabase): Run init-database.sql to start each test with a consistent state.
209 (TestSever.prototype._executePgsqlCommand): Executes a postgres command line tool such as psql.
210 (TestSever.prototype._determinePgsqlDirectory): Finds the directory that contains psql.
211 (TestSever.prototype._startApache): Starts an Apache instance for testing.
212 (TestSever.prototype._stopApache): Stops the Apache instance for testing.
213 (TestSever.prototype._waitForPid): Waits for the Apache pid file to appear or disappear.
214 (before): Start the test server at the beginning.
215 (beforeEach): Re-initialize all tables before each test.
216 (after): Stop the test server at the end.
217 * tools/js/config.js:
218 (Config.prototype.path):
219 (Config.prototype.serverRoot): Added. The path to Websites/perf.webkit.org/public/.
220 (Config.prototype.pathFromRoot): Added. Resolves a path from Websites/perf.webkit.org.
221 * tools/js/database.js:
222 (Database): Now optionally takes the database name to use a different database during testing.
223 (Database.prototype.connect):
224 (Database.prototype.query): Added.
225 (Database.prototype.insert): Added.
226 (tableToPrefixMap): Maps table name to its prefix. Used by Database.insert.
227 * tools/js/remote.js: Added.
228 (RemoteAPI): Added. This is node.js equivalent of RemoteAPI in public/v3/remote.js.
229 (RemoteAPI.prototype.configure): Added.
230 (RemoteAPI.prototype.fetchJSON): Added.
231 (RemoteAPI.prototype.fetchJSONWithStatus): Added.
232 (RemoteAPI.prototype.sendHttpRequest): Added.
233 * tools/sync-with-buildbot.py:
234 (main): Use useLegacyIdResolution as this script relies on the legacy behavior.
235 * unit-tests/checkconfig.js: pg was never directly used in this test.
237 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
239 Delete a file that was supposed to be removed in r198614 for real.
241 * unit-tests/resources/v3-models.js: Removed.
243 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
245 Add a model for parsing buildbot JSON with unit tests
246 https://bugs.webkit.org/show_bug.cgi?id=155814
248 Reviewed by Joseph Pecoraro.
250 Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests.
251 They will be used in the new syncing scripts to improve A/B testing.
253 * public/v3/models/build-request.js:
255 * tools/js/buildbot-syncer.js: Added.
256 (BuildbotBuildEntry): Added.
257 (BuildbotBuildEntry.prototype.slaveName): Added.
258 (BuildbotBuildEntry.prototype.buildRequestId): Added.
259 (BuildbotBuildEntry.prototype.isInProgress): Added.
260 (BuildbotSyncer): Added.
261 (BuildbotSyncer.prototype.testPath): Added.
262 (BuildbotSyncer.prototype.builderName): Added.
263 (BuildbotSyncer.prototype.platformName): Added.
264 (BuildbotSyncer.prototype.fetchPendingRequests): Added.
265 (BuildbotSyncer.prototype._propertiesForBuildRequest): Added.
266 (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added.
267 (BuildbotSyncer._loadConfig): Added.
268 (BuildbotSyncer._validateAndMergeConfig): Added.
269 (BuildbotSyncer._validateAndMergeProperties): Added.
270 * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js.
271 (beforeEach): Deleted since this only defined inside mocha.
272 * unit-tests/analysis-task-tests.js:
273 * unit-tests/buildbot-syncer-tests.js: Added.
275 (createSampleBuildRequest):
276 (.smallConfiguration):
277 * unit-tests/measurement-adaptor-tests.js:
278 * unit-tests/measurement-set-tests.js:
279 * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js.
281 * unit-tests/test-groups-tests.js:
284 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
286 Add unit tests for test-group.js
287 https://bugs.webkit.org/show_bug.cgi?id=155781
289 Reviewed by Joseph Pecoraro.
291 Added unit tests for test-group.js that would have caught regressions fixed in r198503.
293 * public/v3/components/chart-pane-base.js:
294 (ChartPaneBase.prototype._renderAnnotations): Added a forgotten break statement.
295 * public/v3/models/build-request.js:
296 (BuildRequest.prototype.setResult):
298 * public/v3/models/test-group.js:
299 * unit-tests/measurement-set-tests.js: Use ./resources/v3-models.js to reduce the code duplication.
300 * unit-tests/resources/v3-models.js: Import more stuff from v3 models.
302 * unit-tests/test-groups-tests.js: Added. Added some unit tests for TestGroup.
304 (.testGroupWithStatusList):
306 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
312 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
314 Commit log viewer repaints too frequently after r198499
315 https://bugs.webkit.org/show_bug.cgi?id=155732
317 Reviewed by Joseph Pecoraro.
319 The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
320 if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
321 and avoiding work in the commit log viewer when the requested repository and the revision range were
322 the same as those of the last request.
324 * public/v3/components/commit-log-viewer.js:
326 (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
327 identical to the one we already have to avoid repaints and issuing multiple network requests.
328 * public/v3/components/interactive-time-series-chart.js:
329 (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
330 indicator hadn't changed.
331 * public/v3/pages/chart-pane.js:
332 (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
333 the URL. We need to check whether the lock state had changed. The old condition was also redundant
334 since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
336 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
338 Fix A/B testing after r198503.
340 * public/include/build-requests-fetcher.php:
342 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
344 Analysis task page is broken after r198479
345 https://bugs.webkit.org/show_bug.cgi?id=155735
347 Rubber-stamped by Chris Dumez.
349 * public/api/measurement-set.php:
350 (AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
351 * public/include/build-requests-fetcher.php:
352 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
353 * public/v3/models/commit-log.js:
354 (CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
355 * public/v3/models/root-set.js:
356 (RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
357 we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
358 find the repository with "[object]" as the ID.
359 * public/v3/models/test-group.js:
360 (TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.
362 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
364 v3 UI sometimes don't update the list of revisions on the commit log viewer
365 https://bugs.webkit.org/show_bug.cgi?id=155729
367 Rubber-stamped by Chris Dumez.
369 Fixed multiple bugs that were affecting the list of blame range and commit logs for the range weren't
370 updated in some cases on v3 UI. Also, the commit log viewer state is now a part of the URL state so
371 opening and closing the commit log viewer will persist across page loads.
373 Also fixed a regression from r198479 that Test object can't be created for a top level test.
375 * public/v3/components/chart-pane-base.js:
376 (ChartPaneBase.prototype.configure):
377 (ChartPaneBase.prototype._mainSelectionDidChange): Fixed the bug that the list of blame range nor the
378 commit log viewer don't get updated when the selected range changes.
379 (ChartPaneBase.prototype._indicatorDidChange):
380 (ChartPaneBase.prototype._didFetchData):
381 (ChartPaneBase.prototype._updateStatus): Extracted from _indicatorDidChange and _didFetchData.
382 (ChartPaneBase.prototype._requestOpeningCommitViewer): Renamed from _openCommitViewer.
384 * public/v3/components/chart-status-view.js:
385 (ChartStatusView.prototype.updateStatusIfNeeded): Fixed the bug that the blame range doesn't get set
386 on the initial page load when the selection range is set but the chart data hadn't been fetched yet.
388 * public/v3/components/commit-log-viewer.js:
389 (CommitLogViewer.prototype.view): Fixed the bug that we don't clear out the old list of commits while
390 loading the next set of commits to show as it looked as if the list was never updated.
391 (CommitLogViewer.prototype.render): Fixed the bug that the view always show the last repository name
392 even if there were nothing being fetched or commits to show.
394 * public/v3/components/pane-selector.js:
395 (PaneSelector.prototype.focus): Removed superfluous call to console.log.
397 * public/v3/models/data-model.js:
398 (DataModelObject.listForStaticMap): Generalized the code for all to fix the bug in Test.
399 (DataModelObject.all):
401 * public/v3/models/test.js:
402 (Test): Fixed the bug that this code was relying on the static map to be an array.
403 (Test.topLevelTests): Use newly added listForStaticMap to convert the dictionary to an array.
405 * public/v3/pages/chart-pane-status-view.js:
406 (ChartPaneStatusView): Always initialize _usedRevisionRange as a triple to simplify code elsewhere.
407 (ChartPaneStatusView.prototype.render): Invoke _revisionCallback when user clicks on a repository
408 expansion mark (>>). Also fixed click handler from the row since this made selecting revision range
409 on the view cumbersome. Now user has to explicitly click on the expansion mark (>>).
410 (ChartPaneStatusView.prototype._setRevisionRange): Now takes shouldNotify, from, and to as arguments
411 as this function must not invoke_revisionCallback inside _updateRevisionListForNewCurrentRepository.
412 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Use newly added setCurrentRepository
413 instead of manually invoking setCurrentRepository and updateRevisionListWithNotification.
414 (ChartPaneStatusView.prototype.setCurrentRepository): Fixed the bug that we weren't updating the
416 (ChartPaneStatusView.prototype.updateRevisionList): Renamed from updateRevisionListWithNotification
417 since we no longer call _revisionCallback. In general, callbacks are only meant to communicate user
418 initiated actions, and not program induced updates like this API so this was a bad pattern anyway.
419 ChartPane now explicitly updates the commit log viewer instead of relying on this function calling
420 _requestOpeningCommitViewer implicitly.
421 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Extracted from
422 updateRevisionListWithNotification so that setCurrentRepository can also call this function.
424 * public/v3/pages/chart-pane.js:
425 (ChartPane.prototype._requestOpeningCommitViewer): Overrides ChartPaneBase's method. Open the same
426 repository in other panes via ChartsPage.setOpenRepository.
427 (ChartPane.prototype.setOpenRepository): This method is called when the user selected a repository in
428 another pane. Open the same repository in this pane if it wasn't already open.
430 * public/v3/pages/charts-page.js:
431 (ChartsPage): Added this._currentRepositoryId.
432 (ChartsPage.prototype.serializeState): Serialize _currentRepositoryId.
433 (ChartsPage.prototype.updateFromSerializedState): Set the commit log viewer's
434 (ChartsPage.prototype.setOpenRepository): Added.
436 * tests/api-measurement-set.js: Fixed a test after r198479.
438 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
440 V3 Perf Dashboard should automatically select initial range when creating a new task
441 https://bugs.webkit.org/show_bug.cgi?id=155677
443 Reviewed by Joseph Pecoraro.
445 Select the entire range of points for which the analysis task is created by default so that creating
446 a test group to confirm the regression / progression is easy.
448 * public/v3/pages/analysis-task-page.js:
449 (AnalysisTaskPage): Added a boolean flag which indicates the user had modified main chart's selection.
450 * public/v3/pages/analysis-task-page.js:
451 (AnalysisTaskPage.prototype.render): Set the main chart's selection to the entire range of points in
452 the analysis task if the user had never modified selection.
453 (AnalysisTaskPage.prototype._chartSelectionDidChange): This callback is invoked only when the user had
454 modified the selection so set _selectionWasModifiedByUser true here unconditionally.
456 2016-03-19 Ryosuke Niwa <rniwa@webkit.org>
458 Associated commits don't immediately show up on an analysis task page
459 https://bugs.webkit.org/show_bug.cgi?id=155692
461 Reviewed by Darin Adler.
463 The bug was caused by resolveCommits in AnalysisTask._constructAnalysisTasksFromRawData not being
464 able to find the matching commit log if the commit log had been created by the charts which don't
465 set the remote identifiers on each CommitLog objects.
467 Fixed the bug by modifying /api/measurement-set to include the commit ID, and making CommitLog
468 use the real database ID as its ID instead of a fake ID we create from repository and revision.
470 Also added a bunch of Mocha unit tests for AnalysisTask.fetchAll.
472 * public/api/measurement-set.php:
473 (MeasurementSetFetcher::execute_query): Fetch commit_id.
474 (MeasurementSetFetcher::format_run): Use pass-by-reference to avoid making a copy of the row.
475 (MeasurementSetFetcher::parse_revisions_array): Include commit_id as the first item in the result.
476 * public/v3/instrumentation.js:
477 * public/v3/models/analysis-task.js:
478 (AnalysisTask): Fixed a bug that _buildRequestCount and _finishedBuildRequestCount could be kept
479 as strings and hasPendingRequests() could return a wrong result because it would perform string
480 inequality instead of numerical inequality.
481 (AnalysisTask.prototype.updateSingleton): Ditto.
482 (AnalysisTask.prototype.dissociateCommit):
483 (AnalysisTask._constructAnalysisTasksFromRawData):
484 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Use findById now that CommitLog
485 objects all use the same id as the database id.
486 * public/v3/models/commit-log.js:
488 (CommitLog.prototype.remoteId): Deleted since we no longer create a fake id for commit logs for
490 (CommitLog.findByRemoteId): Deleted.
491 (CommitLog.ensureSingleton): Deleted.
492 (CommitLog.fetchBetweenRevisions):
494 * public/v3/models/data-model.js:
495 (DataModelObject.clearStaticMap): Added to aid unit testing.
496 (DataModelObject.ensureNamedStaticMap): Fixed a typo. Each map is a dictionary, not an array.
497 * public/v3/models/metric.js:
498 * public/v3/models/platform.js:
499 * public/v3/models/root-set.js:
500 (RootSet): Updated per the interface change in CommitLog.ensureSingleton.
501 (MeasurementRootSet): Updated per /api/measurement-set change. Use the first value as the id.
502 * public/v3/models/test.js:
503 * unit-tests/analysis-task-tests.js: Added.
504 (sampleAnalysisTask):
505 (measurementCluster):
506 * unit-tests/checkconfig.js: Added some assertion message to help aid diagnosing the failure.
507 * unit-tests/measurement-adaptor-tests.js: Updated the sample data per the API change in
508 /api/measurement-set and also added assertions for commit log ids.
509 * unit-tests/measurement-set-tests.js:
511 * unit-tests/resources: Added.
512 * unit-tests/resources/mock-remote-api.js: Added. Extracted from measurement-set-tests.js to be
513 used in analysis-task-tests.js.
514 (assert.notReached.assert.notReached):
515 (global.RemoteAPI.getJSON):
516 (global.RemoteAPI.getJSONWithStatus):
518 * unit-tests/resources/v3-models.js: Added. Extracted from measurement-set-tests.js to be used in
519 analysis-task-tests.js and added more imports as needed.
523 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
525 Build fix after r198464.
527 * public/v3/components/analysis-results-viewer.js:
528 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
530 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
532 Build fix after r198234.
534 * public/api/commits.php:
535 (main): Typo: fetch_latest_reported -> fetch_last_reported.
536 * public/include/commit-log-fetcher.php:
537 (CommitLogFetcher::format_single_commit): commits should be an array.
539 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
541 Perf Dashboard v3 confuses better and worse on A/B task page
542 https://bugs.webkit.org/show_bug.cgi?id=155675
543 <rdar://problem/25208723>
545 Reviewed by Joseph Pecoraro.
547 The analysis results viewer on v3 UI sometimes treats regressions as progressions and vice versa when
548 the first set (i.e. set A) of the revisions used in an A/B testing never appears in the original graph,
549 and its latest commit time matches that of the second set, which appears in the original graph.
551 Because the analysis results viewer compares results in the increasing row number, this results in
552 B to be compared to A instead of A to be compared to B. Fixed the bug by preventing the wrong ordering
553 to occur in _buildRowsForPointsAndTestGroups by always inserting a root set A before B when B appears
554 and A doesn't appear in the original graph.
556 * public/v3/components/analysis-results-viewer.js:
557 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Remember the succeeding root set B
558 when creating an entry for root set A.
559 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Fixed the bug. Also un-duplicated
560 the code to create a new row.
561 (AnalysisResultsViewer.RootSetInTestGroup): Now takes a succeeding root set. e.g. it's B for A and
562 undefined for B in A/B testing.
563 (AnalysisResultsViewer.RootSetInTestGroup.prototype.succeedingRootSet): Added.
564 * public/v3/components/time-series-chart.js:
565 (TimeSeriesChart.computeTimeGrid): Fixed the bug that we would end up showing 0 AM instead of dates
566 when both dates and months change.
568 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
570 Add unit tests for measurement-set.js and measurement-adapter.js
571 https://bugs.webkit.org/show_bug.cgi?id=155673
573 Reviewed by Daniel Bates.
575 Add tests which were supposed to be added in r198462.
577 * unit-tests/measurement-adaptor-tests.js: Added.
578 * unit-tests/measurement-set-tests.js: Added.
579 (assert.notReached): Added.
580 (global.RemoteAPI.getJSON): Added.
581 (global.RemoteAPI.getJSONWithStatus): Added. A mock.
583 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
585 Add unit tests for measurement-set.js and measurement-adapter.js
586 https://bugs.webkit.org/show_bug.cgi?id=155673
588 Reviewed by Darin Adler.
590 Added mocha unit tests for MeasurementSet and MeasurementAdapter classes along with the necessary
591 refactoring to run these tests in node.
593 getJSON and getJSONStatus are now under RemoteAPI so that unit tests can mock them.
595 Removed the dependency on v2 UI's TimeSeries and Measurement class by adding a new implementation
596 of TimeSeries in v3 and removing the dependency on Measurement in chart-pane-status-view.js with
597 new helper methods on Build and CommitLog.
599 Many js files now use 'use strict' (node doesn't support class syntax in non-strict mode) and
600 module.exports to export symbols in node's require function.
602 * public/v3/index.html:
604 * public/v3/models/analysis-results.js:
605 (AnalysisResults.fetch):
606 * public/v3/models/analysis-task.js:
607 (AnalysisTask.fetchAll):
608 * public/v3/models/builder.js:
610 (Build.prototype.builder): Added. Used by ChartPaneStatusView.
611 (Build.prototype.buildNumber): Ditto.
612 (Build.prototype.buildTime): Ditto.
613 * public/v3/models/commit-log.js:
614 (CommitLog.prototype.diff): Ditto.
615 (CommitLog.fetchBetweenRevisions):
616 * public/v3/models/data-model.js:
617 (DataModelObject.cachedFetch):
618 * public/v3/models/measurement-adaptor.js:
619 (MeasurementAdaptor.prototype.applyToAnalysisResults): Renamed from adoptToAnalysisResults.
620 (MeasurementAdaptor.prototype.applyTo): Renamed from adoptToSeries. Now shares a lot more
621 code with applyToAnalysisResults. The code to set 'series' and 'seriesIndex' has been moved
622 to TimeSeries.append. 'measurement' is no longer needed as this patch removes its only use
623 in ChartPaneStatusView.
624 * public/v3/models/measurement-cluster.js:
625 (MeasurementCluster.prototype.addToSeries): Use TimeSeries.append instead of directly mutating
627 * public/v3/models/measurement-set.js:
628 (Array.prototype.includes): Added a polyfill for node.
629 (MeasurementSet.prototype._fetchSecondaryClusters): Removed a bogus assertion. When fetchBetween
630 is called with a mixture of clusters that have been fetched and not fetched, this assertion fails.
631 (MeasurementSet.prototype._fetch):
632 (TimeSeries.prototype.findById): Moved to time-series.js.
633 (TimeSeries.prototype.dataBetweenPoints): Ditto.
634 (TimeSeries.prototype.firstPoint): Ditto.
635 (TimeSeries.prototype.fetchedTimeSeries): Moved the code to extend the last point to TimeSeries'
637 * public/v3/models/repository.js:
638 * public/v3/models/root-set.js:
639 (MeasurementRootSet): Ignore repositories that had not been defined (e.g. it could be added after
640 manifest.json had been downloaded but before a given root set is created for an A/B testing).
641 * public/v3/models/time-series.js:
643 (TimeSeries.prototype.append): Added.
644 (TimeSeries.prototype.extendToFuture): Added.
645 (TimeSeries.prototype.firstPoint): Moved from measurement-set.js.
646 (TimeSeries.prototype.lastPoint): Added.
647 (TimeSeries.prototype.previousPoint): Added.
648 (TimeSeries.prototype.nextPoint): Added.
649 (TimeSeries.prototype.findPointByIndex): Added.
650 (TimeSeries.prototype.findById): Moved from measurement-set.js.
651 (TimeSeries.prototype.findPointAfterTime): Added.
652 (TimeSeries.prototype.dataBetweenPoints): Moved from measurement-set.js.
653 * public/v3/pages/chart-pane-status-view.js:
654 (ChartPaneStatusView.prototype.render): Use newly added helper functions on Build.
655 (ChartPaneStatusView.prototype._formatTime): Added.
656 (ChartPaneStatusView.prototype.setCurrentRepository):
657 (ChartPaneStatusView.prototype.computeChartStatusLabels): Rewrote the code using RootSet object on
658 currentPoint and previousPoint instead of Measurement class from v2 UI. Also sort the results using
659 sortByNamePreferringOnesWithURL.
660 * public/v3/remote.js:
661 (RemoteAPI.getJSON): Moved under RemoteAPI.
662 (RemoteAPI.getJSONWithStatus): Ditto.
664 (PrivilegedAPI.requestCSRFToken):
666 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
668 Add unit tests for config.json and statistics.js
669 https://bugs.webkit.org/show_bug.cgi?id=155626
671 Reviewed by Darin Adler.
673 Added mocha unit tests for statistics.js and validating config.json. For segmentations, I've extracted
674 real data from our internal perf dashboard.
676 Also fixed some bugs covered by these new tests.
678 * public/shared/statistics.js:
679 (Statistics.movingAverage): Fixed a bug that forwardWindowSize was never used.
680 (Statistics.exponentialMovingAverage): Fixed the bug that the moving average starts at 0. It should
681 start at the first value instead.
682 (.splitIntoSegmentsUntilGoodEnough): Fixed the bug that we may try to segment a time series into
683 more parts than there are data points. Clearly, that doesn't make any sense.
684 (.findOptimalSegmentation): Renamed local variables so that they're more descriptive, and rewrote
685 the debugging code was the old code was emitting some useless data. Also fixed the bug that the length
686 of "segmentation" was off by one (we need segmentCount + 1 elements in the array sine we always
687 include the start of the first segment = 0 and the end of the last segment = values.length).
688 (.SampleVarianceUpperTriangularMatrix):
689 (Statistics): Modernized the export code.
691 * tools/js/config.js: Added.
693 (Config.prototype.configFilePath): Added.
694 (Config.prototype.value): Added.
695 (Config.prototype.path): Added.
696 * tools/js/database.js: Added.
698 (Database.prototype.connect): Added.
699 (Database.prototype.disconnect): Added.
701 * unit-tests/checkconfig.js: Added. Validates config.json. This is useful while setting up
702 a local instance of the perf dashboard.
703 * unit-tests/statistics-tests.js: Added.
704 (assert.almostEqual): Added. Asserts that two floating values are within a given significant digits.
709 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
711 Fix a typo which was supposed to be fixed in r198351.
713 * public/v3/pages/analysis-task-page.js:
714 (AnalysisTaskPage.prototype.render):
716 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
718 An analysis task should be closed if a progression cause is identified
719 https://bugs.webkit.org/show_bug.cgi?id=155549
721 Reviewed by Chris Dumez.
723 Since a progression is desirable, we should close an analysis task once its cause is identified.
727 * init-database.sql: Fixed a typo.
728 * public/api/analysis-tasks.php:
729 * public/v3/models/analysis-task.js:
730 (AnalysisTask.prototype.dissociateBug): Renamed from dissociateBug.
731 * public/v3/pages/analysis-task-page.js:
732 (AnalysisTaskPage.prototype.render):
733 (AnalysisTaskPage.prototype._dissociateBug): Renamed from _dissociateBug.
734 (AnalysisTaskPage.prototype._dissociateCommit): Fixed the typo in the alert.
736 2016-03-16 Ryosuke Niwa <rniwa@webkit.org>
738 Analysis task page should allow specifying commits that caused or fixed a regression or a progression
739 https://bugs.webkit.org/show_bug.cgi?id=155529
741 Reviewed by Chris Dumez.
743 Added the capability to associate revisions that caused or fixed a progression or a regression for which
744 an analysis task was created. Added task_commits that stores this relationship and added the backend
745 support to retrieve this table in /api/analysis-tasks and an privileged API to update this table at
746 /privileged-api/associate-commit.
748 Also extracted a new component, MutableListView, out of AnalysisTaskPage to render and manipulate a list
749 of mutable items, and used it to render the list of associated bugs and commits. The view takes a list of
750 kinds (e.g. repositories or bug trackers), and accepts a pair of a kind and arbitrary text as a new item
753 * init-database.sql: Added task_commits table.
755 * public/api/analysis-tasks.php:
757 (fetch_associated_data_for_tasks): Renamed from fetch_and_push_bugs_to_tasks now that it also fetches
758 the list of commits associated with each analysis task by calling CommitLogFetcher::fetch_for_tasks.
759 Also fixe the bug that we were not taking
760 (format_task): No longer sets 'category' since the computation of category now depends on the list of
761 commits associated with this analysis task which aren't available until fetch_associated_data_for_tasks.
762 (determine_category): Added. Categorize any analysis tasks with "fixes" commits as "closed" and "causes"
763 commits as "identified".
765 * public/include/commit-log-fetcher.php:
766 (CommitLogFetcher::__construct): Remove the unused instance variable.
767 (CommitLogFetcher::fetch_for_tasks): Added. Fetches all commits associated with a list of analysis tasks.
768 Assumes the caller (fetch_associated_data_for_tasks) had setup "fixes" and "causes" fields on each task.
770 * public/privileged-api/associate-commit.php: Added. Updates task_commits table to associate or disassociate
771 a commit with an analysis task. When the specified analysis task and the specified commit are already
772 associated, we simply update the table instead of adding a duplicating entry or error. For dissociation,
773 the front-end specifies the commit ID.
776 * public/v3/index.html:
777 * public/v3/components/mutable-list-view.js: Added. Used by the list associated bugs and commits.
778 (MutableListView): Added.
779 (MutableListView.prototype.setList): Added.
780 (MutableListView.prototype.setKindList): Added.
781 (MutableListView.prototype.setAddCallback): Added. This callback is invoked when the user tries to add
782 a new item to the list.
783 (MutableListView.prototype.render): Added.
784 (MutableListView.prototype._submitted): Added.
785 (MutableListView.cssTemplate):
786 (MutableListView.htmlTemplate):
787 (MutableListItem): Added. RemovalLink could be a hyperlink or a callback and gets involved when the user
788 tries to delete this item.
789 (MutableListItem.prototype.content):
791 * public/v3/models/analysis-task.js:
792 (AnalysisTask): Added the support of the list of commits that fixed and caused changes.
793 (AnalysisTask.prototype.updateSingleton): Ditto.
794 (AnalysisTask.prototype.causes): Added.
795 (AnalysisTask.prototype.fixes): Added.
796 (AnalysisTask.prototype.associateCommit): Added. Use the API added at /privileged-api/associate-commit
797 to associate a new commit with this analysis task. Each commit has either caused or fixed the change.
798 (AnalysisTask.prototype.dissociateCommit): Added. Use the same API to disassociate each commit.
799 (AnalysisTask._constructAnalysisTasksFromRawData): Find all commits associated with each analysis task.
800 Because commit log objects use a fake ID fdue to /api/measurement-set not providing commit IDs, we must
801 use CommitLog.findByRemoteId to find each commit instead of usual CommitLog.findById.
802 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Added.
804 * public/v3/models/build-request.js:
805 (BuildRequest.prototype.hasFinished): Renamed from hasCompleted since it was confusing for this._status
806 being "completed" wasn't a necessary condition for this function to return true.
808 * public/v3/models/commit-log.js:
809 (CommitLog): Added the static map for actual commit ID instead of a fake ID created in ensureSingleton.
810 (CommitLog.prototype.remoteId): Added. Returns the real commit ID.
811 (CommitLog.findByRemoteId): Added. Finds an CommitLog object using the real ID.
813 * public/v3/models/test-group.js:
814 (TestGroup.prototype.hasFinished): Renamed from hasCompleted to match the rename in BuildRequest.
816 * public/v3/pages/analysis-task-page.js:
817 (AnalysisTaskPage): Added lists for the commits that fixed and caused the change using MutableListView.
818 Also adopted MutableListView for the list of associated bugs.
819 (AnalysisTaskPage.prototype.render): Added the code to populate the newly added lists.
820 (AnalysisTaskPage.prototype._makeCommitListItem): Added.
821 (AnalysisTaskPage.prototype._associateBug): Now this is a callback from MutableListView.
822 (AnalysisTaskPage.prototype._associateCommit): Added.
823 (AnalysisTaskPage.prototype._dissociateCommit): Added.
824 (AnalysisTaskPage.htmlTemplate):
825 (AnalysisTaskPage.cssTemplate):
827 * public/v3/remote.js:
828 (getJSON): Spit out the entire responseText when JSON failed to parse to make debugging easier.
830 2016-03-15 Ryosuke Niwa <rniwa@webkit.org>
832 Extract the code to format commit logs into its own PHP file
833 https://bugs.webkit.org/show_bug.cgi?id=155514
835 Rubber-stamped by Chris Dumez.
837 Extracted CommitLogFetcher out of /api/commits so that it could be used in analysis-tasks.php
838 in the future to support associating cause/fix for each analysis task.
840 * public/api/commits.php:
841 * public/include/commit-log-fetcher.php: Added.
843 (CommitLogFetcher::__construct): Added.
844 (CommitLogFetcher::repository_id_from_name): Added.
845 (CommitLogFetcher::fetch_between): Added.
846 (CommitLogFetcher::fetch_oldest): Added.
847 (CommitLogFetcher::fetch_latest): Added.
848 (CommitLogFetcher::fetch_last_reported): Added.
849 (CommitLogFetcher::fetch_revision): Added.
850 (CommitLogFetcher::commit_for_revision): Added.
851 (CommitLogFetcher::format_single_commit): Added.
852 (CommitLogFetcher::format_commit): Added.
854 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
856 Build fix after r196870.
858 * public/include/report-processor.php:
860 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
862 Add Size metric to perf dashboard
863 https://bugs.webkit.org/show_bug.cgi?id=155266
865 Reviewed by Chris Dumez.
867 Added the "Size" metric and use bytes as its unit.
869 * public/js/helper-classes.js:
872 (RunsData.unitFromMetricName):
874 2016-02-20 Ryosuke Niwa <rniwa@webkit.org>
876 Add the support for universal slave password
877 https://bugs.webkit.org/show_bug.cgi?id=154476
879 Reviewed by David Kilzer.
881 Added the support for universalSlavePassword.
884 * public/include/report-processor.php:
885 (ReportProcessor::process):
886 (ReportProcessor::authenticate_and_construct_build_data): Extracted from process().
888 2016-02-19 Ryosuke Niwa <rniwa@webkit.org>
890 Analysis tasks page complains about missing repository but with a wrong name
891 https://bugs.webkit.org/show_bug.cgi?id=154468
893 Reviewed by Chris Dumez.
895 Fixed the bug by using the right variable in the template literal.
897 * public/v3/components/customizable-test-group-form.js:
898 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use querySelector here since Chrome doesn't have
899 getElementsByClassName on ShadowRoot.
900 * public/v3/pages/analysis-task-page.js:
901 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Use name which is the name of
904 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
906 Revert an unintended change made in the previous commit.
910 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
912 Perf dashboard should let user cancel pending A/B testing and hide failed ones
913 https://bugs.webkit.org/show_bug.cgi?id=154433
915 Reviewed by Chris Dumez.
917 Added a button to hide a test group in the details view (the bottom table) in the analysis task page, and
918 "Show hidden tests" link to show the hidden test groups on demand. When a test group is hidden, all pending
919 requests in the group will also be canceled since a common scenario of using this feature is that the user
920 had triggered an useless A/B testing; e.g. all builds will fail, wrong, etc... We can revisit and add the
921 capability to just cancel the pending requests and leaving the group visible later if necessary.
923 Run `ALTER TYPE build_request_status_type ADD VALUE 'canceled';` to add the new type.
925 * init-database.sql: Added testgroup_hidden column to analysis_test_groups table and added 'canceled'
926 as a value to build_request_status_type table.
927 * public/api/test-groups.php:
928 (format_test_group): Added 'hidden' field in the JSON result.
929 * public/privileged-api/update-test-group.php:
930 (main): Added the support for updating testgroup_hidden column. When this column is set to true, also
931 cancel all pending build requests (by setting its request_status to 'canceled' which will be ignore by
933 * public/v3/components/test-group-results-table.js:
934 (TestGroupResultsTable.prototype.setTestGroup): Reset _renderedTestGroup here so that the next call to
935 render() will update the table; e.g. when build requests' status change from 'Pending' to 'Canceled'.
936 * public/v3/models/build-request.js:
937 (BuildRequest.prototype.hasCompleted): A build request is considered complete/finished if it's canceled.
938 (BuildRequest.prototype.hasPending): Added.
939 (BuildRequest.prototype.statusLabel): Handle 'canceled' status.
940 * public/v3/models/test-group.js:
942 (TestGroup.prototype.updateSingleton): Added to update 'hidden' field.
943 (TestGroup.prototype.isHidden): Added.
944 (TestGroup.prototype.hasPending): Added.
945 (TestGroup.prototype.hasPending): Added.
946 (TestGroup.prototype.updateHiddenFlag): Added. Uses the privileged API to update testgroup_hidden column.
947 The JSON API also updates the status of the 'pending' build requests in the group to 'canceled'.
948 * public/v3/pages/analysis-task-page.js:
949 (AnalysisTaskPage): Added _showHiddenTestGroups and _filteredTestGroups as instance variables.
950 (AnalysisTaskPage.prototype._didFetchTestGroups):
951 (AnalysisTaskPage.prototype._showAllTestGroups): Added.
952 (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState): Extracted from _didFetchTestGroups.
953 (AnalysisTaskPage.prototype._renderTestGroupList): Use the filtered list of test groups to show the list
954 of test groups. When all test groups are shown, we would first show the hidden ones after the regular ones.
955 (AnalysisTaskPage.prototype._createTestGroupListItem): Extracted from _renderTestGroupList.
956 (AnalysisTaskPage.prototype._renderTestGroupDetails): Update the text inside the button to hide the test
957 group. Also show a warning text that the pending requests will be canceled if there are any.
958 (AnalysisTaskPage.prototype._hideCurrentTestGroup): Added.
959 (AnalysisTaskPage.cssTemplate): Updated the style.
961 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
963 The rows in the analysis results table should be expandable
964 https://bugs.webkit.org/show_bug.cgi?id=154427
966 Reviewed by Chris Dumez.
968 Added "(Expand)" link between rows that have hidden points. Upon click it inserts the hidden rows.
970 We insert around five rows at a time when there are hundreds of hidden points but we also avoid leaving
971 behind expandable rows of less than two rows.
973 Also fixed a bug in CustomizableTestGroupForm that getElementsById would throw in the shipping Safari
974 because getElementsById doesn't exist on Element.prototype by using class name instead.
976 * public/v3/components/analysis-results-viewer.js:
977 (AnalysisResultsViewer):
978 (AnalysisResultsViewer.prototype.setCurrentTestGroup): Removed superfluous call to render().
979 (AnalysisResultsViewer.prototype.setPoints): Always show the start and the end points.
980 (AnalysisResultsViewer.prototype.buildRowGroups):
981 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Add an instance of ExpandableRow which
982 shows a "(Expand)" link to show hidden rows here.
983 (AnalysisResultsViewer.prototype._expandBetween): Added. Expands rows between two points.
984 (AnalysisResultsViewer.cssTemplate): Added rules for "(Expand)" links.
985 (AnalysisResultsViewer.ExpandableRow): Added.
986 (AnalysisResultsViewer.ExpandableRow.prototype.resultContent): Added. Overrides what's in the results column.
987 (AnalysisResultsViewer.ExpandableRow.prototype.heading): Added. Generates "(Expand)" link.
989 * public/v3/components/customizable-test-group-form.js:
990 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use getElementsByClassName instead of
992 (CustomizableTestGroupForm.prototype._classForLabelAndRepository): Renamed from _idForLabelAndRepository.
993 (CustomizableTestGroupForm._constructRevisionRadioButtons): Set class name instead of id.
995 * public/v3/components/results-table.js:
996 (ResultsTable.prototype.render): Don't generate radio buttons to select a row when root set is missing;
997 e.g. for rows that show "(Expand)" links.
999 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1001 Statistically significant A/B testing results should be color coded in details view
1002 https://bugs.webkit.org/show_bug.cgi?id=154414
1004 Reviewed by Chris Dumez.
1006 Color code the statistically significant comparisions in TestGroupResultsTable as done in the analysis
1009 * public/v3/components/customizable-test-group-form.js:
1010 (CustomizableTestGroupForm.cssTemplate): Build fix after r196768.
1011 * public/v3/components/test-group-results-table.js:
1012 (TestGroupResultsTable.prototype.buildRowGroups): Add the status as a class name.
1013 (TestGroupResultsTable.cssTemplate): Added styles to color-code statistically significant results.
1015 2016-02-17 Ryosuke Niwa <rniwa@webkit.org>
1017 v3 UI should allow custom revisions for A/B testing
1018 https://bugs.webkit.org/show_bug.cgi?id=154379
1020 Reviewed by Chris Dumez.
1022 Added the capability to customize revisions selected in the overview chart and the results viewer.
1024 Newly added CustomizableTestGroupForm is responsible for allowing users to modify the set of revisions in
1025 a new A/B testing group. Unlike TestGroupForm which doesn't know anything about which revisions are selected
1026 for each project/repository, CustomizableTestGroupForm is aware of the list of revisions used in each set.
1028 The list of revisions used in each set is represented by RootSet if users had not customized them, and
1029 CustomRootSet otherwise; the latter was added since regular RootSet object requires CommitLog and other
1030 DataModelObjects which are hard to create without corresponding database entries.
1032 * public/v3/components/customizable-test-group-form.js: Added.
1033 (CustomizableTestGroupForm): Added.
1034 (CustomizableTestGroupForm.prototype.setRootSetMap): Added.
1035 (CustomizableTestGroupForm.prototype._submitted): Overrides the superclass' method.
1036 (CustomizableTestGroupForm.prototype._customize): Ditto. Unlike TestGroupForm's callback, this class'
1037 callback passes in a root set map as the third argument.
1038 (CustomizableTestGroupForm.prototype._computeRootSetMap): Added. Returns this._rootSetMap, which is set by
1039 AnalysisTaskPage if user had not customized the root sets. Otherwise return a new map with CustomRootSet's.
1040 (CustomizableTestGroupForm.prototype.render): Added. Creates a table to allow customization of root sets.
1041 (CustomizableTestGroupForm._constructRevisionRadioButtons): Added.
1042 (CustomizableTestGroupForm._createRadioButton): Added.
1043 (CustomizableTestGroupForm.cssTemplate): Added.
1044 (CustomizableTestGroupForm.formContent): Added. This method is called by TestGroupForm.htmlTemplate.
1045 * public/v3/components/test-group-form.js:
1046 (TestGroupForm): Updated the various methods to not directly mutate DOM. Store the state in instance
1047 variables and update DOM in render() as done elsewhere.
1048 (TestGroupForm.prototype.setNeedsName): Deleted. We no longer need this flag since TestGroupForm which is
1049 used for retries never needs a name and CustomizableTestGroupForm which is used to create a new test group
1050 always requires a name.
1051 (TestGroupForm.prototype.setDisabled):
1052 (TestGroupForm.prototype.setLabel):
1053 (TestGroupForm.prototype.setRepetitionCount):
1054 (TestGroupForm.prototype.render): Added.
1055 (TestGroupForm.prototype._submitted): Moved the code to prevent the default action has been moved to the
1056 constructor since this method is overridden by CustomizableTestGroupForm.
1057 (TestGroupForm.cssTemplate): Added.
1058 (TestGroupForm.htmlTemplate):
1059 (TestGroupForm.formContent): Extracted from htmlTemplate.
1060 * public/v3/index.html:
1061 * public/v3/models/repository.js:
1062 (Repository.sortByNamePreferringOnesWithURL): Added.
1063 * public/v3/models/root-set.js:
1064 (RootSet.prototype.revisionForRepository): Added so that _createTestGroupAfterVerifyingRootSetList can retrieve
1065 the revision information from CustomRootSet without going through CommitLog objects since CustomRootSet doesn't
1066 have associated CommitLog objects.
1067 (CustomRootSet): Added. Used by CustomizableTestGroupForm to create a custom root map since regular RootSet
1068 requires CommitLog and other related objects which are hard to create without database entries.
1069 (CustomRootSet.prototype.setRevisionForRepository): Added.
1070 (CustomRootSet.prototype.repositories): Added.
1071 (CustomRootSet.prototype.revisionForRepository): Added.
1072 * public/v3/pages/analysis-task-page.js:
1074 (AnalysisTaskPage.prototype.render): Removed the reference to v2 UI since v3 UI is now strictly more powerful
1075 than v2 UI. Also update the root set maps in each form here.
1076 (AnalysisTaskPage.prototype._retryCurrentTestGroup): No longer takes unused name argument as it got removed
1078 (AnalysisTaskPage.prototype._chartSelectionDidChange): No longer updates the disabled-ness here since it's now
1079 done in render() via setRootSetMap().
1080 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Now takes rootSetMap as an argument.
1081 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): No longer updates the disabled-ness here
1082 since it's now done in render() via setRootSetMap().
1083 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Now takes rootSetMap as an argument.
1084 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Take a dictionary of root set labels
1085 such as A and B, which maps to a RootSet or a newly-added CustomRootSet.
1086 (AnalysisTaskPage.htmlTemplate): Use customizable-test-group-form for creating a new A/B testing group. Retry
1087 form will continue to use TestGroupForm since customizing revisions is non-sensical in retries.
1088 (AnalysisTaskPage.cssTemplate): Updated the style.
1090 2016-02-16 Ryosuke Niwa <rniwa@webkit.org>
1092 v3 UI has the capability to schedule an A/B testing in a specific range
1093 https://bugs.webkit.org/show_bug.cgi?id=154329
1095 Reviewed by Chris Dumez.
1097 Extended AnalysisTaskChartPane and ResultsTable so that users can select a range of points in either
1098 the overview chart pane and the results viewer table. Extracted TestGroupForm out of the analysis task
1099 page and used right below those two components in the analysis task page.
1101 * public/v3/components/results-table.js:
1103 (ResultsTable.prototype.setRangeSelectorLabels): Added.
1104 (ResultsTable.prototype.setRangeSelectorCallback): Added.
1105 (ResultsTable.prototype.selectedRange): Added.
1106 (ResultsTable.prototype._rangeSelectorClicked): Added.
1107 (ResultsTable.prototype.render): Generate radio boxes to select a range.
1109 * public/v3/components/test-group-form.js:
1111 (TestGroupForm.prototype.setStartCallback): Added.
1112 (TestGroupForm.prototype.setNeedsName): Added.
1113 (TestGroupForm.prototype.setDisabled): Added.
1114 (TestGroupForm.prototype.setLabel): Added.
1115 (TestGroupForm.prototype.setRepetitionCount): Added.
1116 (TestGroupForm.prototype._submitted): Added.
1117 (TestGroupForm.htmlTemplate): Extracted from AnalysisTaskPage.htmlTemplate.
1119 * public/v3/index.html:
1121 * public/v3/pages/analysis-task-page.js:
1122 (AnalysisTaskChartPane.prototype._mainSelectionDidChange): Added. Delegates the work to AnalysisTaskPage.
1123 (AnalysisTaskChartPane.prototype.selectedPoints): Added.
1125 (AnalysisTaskPage.prototype.title):
1126 (AnalysisTaskPage.prototype.render):
1127 (AnalysisTaskPage.prototype._renderTestGroupDetails): Use TestGroupForm's methods instead of mutating DOM.
1128 (AnalysisTaskPage.prototype._retryCurrentTestGroup):
1129 (AnalysisTaskPage.prototype._chartSelectionDidChange): Added.
1130 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Added.
1131 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Added.
1132 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Added.
1133 (AnalysisTaskPage.prototype._createRetryNameForTestGroup):
1134 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Extracted from _retryCurrentTestGroup
1135 so that we can call it in _createNewTestGroupFromChart and _createNewTestGroupFromViewer.
1136 (AnalysisTaskPage.htmlTemplate):
1138 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1140 Extract the code specific to v2 UI out of shared statistics.js
1141 https://bugs.webkit.org/show_bug.cgi?id=154277
1143 Reviewed by Chris Dumez.
1145 Extracted statistics-strategies.js out of statistics.js for v2 UI and detect-changes.js. The intent is to
1146 deprecate this file once we implement refined statistics tools in v3 UI and adopt it in detect-changes.js.
1148 * public/shared/statistics.js:
1149 (Statistics.movingAverage): Extracted from the "Simple Moving Average" strategy.
1150 (Statistics.cumultaiveMovingAverage): Extracted from the "Cumulative Moving Average" strategy.
1151 (Statistics.exponentialMovingAverage): Extracted from the "Exponential Moving Average" strategy.
1152 Use a temporary "movingAverage" to keep the last moving average instead of relying on the previous
1153 entry in "averages" array to avoid special casing an array of length 1 and starting the loop at i = 1.
1154 (Statistics.segmentTimeSeriesGreedyWithStudentsTTest): Extracted from "Segmentation: Recursive t-test"
1155 strategy. Don't create the list of averages to match segmentTimeSeriesByMaximizingSchwarzCriterion here.
1156 It's done in newly added averagesFromSegments.
1157 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Extracted from
1158 "Segmentation: Schwarz criterion" strategy.
1159 (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Just store the start index to match
1161 (App.Pane.updateStatisticsTools):
1162 (App.Pane._computeMovingAverageAndOutliers):
1163 * public/v2/data.js:
1164 * public/v2/index.html:
1165 * public/v2/statistics-strategies.js: Added.
1166 (StatisticsStrategies.MovingAverageStrategies): Added.
1167 (averagesFromSegments): Extracted from "Segmentation: Schwarz criterion" strategy. Now used by both
1168 "Segmentation: Recursive t-test" and "Segmentation: Schwarz criterion" strategies.
1169 (StatisticsStrategies.EnvelopingStrategies): Moved from Statistics.EnvelopingStrategies.
1170 (StatisticsStrategies.TestRangeSelectionStrategies): Moved from Statistics.TestRangeSelectionStrategies.
1171 (createWesternElectricRule): Moved from statistics.js.
1172 (countValuesOnSameSide): Ditto.
1173 (StatisticsStrategies.executeStrategy): Moved from Statistics.executeStrategy.
1174 * tools/detect-changes.js:
1175 (computeRangesForTesting):
1177 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1179 v1 UI and v2 UI should share statistics.js
1180 https://bugs.webkit.org/show_bug.cgi?id=154262
1182 Reviewed by Chris Dumez.
1184 Share statistics.js between v1 and v2 UI.
1186 * public/index.html:
1187 * public/js/shared.js: Deleted.
1188 * public/js/statistics.js: Removed.
1189 * public/shared: Added.
1190 * public/shared/statistics.js: Moved from Websites/perf.webkit.org/public/v2/js/statistics.js.
1191 * public/v2/index.html:
1192 * public/v2/js/statistics.js: Removed.
1193 * public/v3/index.html:
1194 * tools/detect-changes.js:
1196 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1198 v3 UI sometimes shows same dates twice on the x-axis of time series charts
1199 https://bugs.webkit.org/show_bug.cgi?id=154210
1201 Reviewed by Chris Dumez.
1203 The bug was caused by the label generation code in TimeSeriesChart.computeTimeGrid never emitting hours.
1205 Use hours instead of dates as labels when the current time's date is same as the previous label's date.
1206 Always include dates before entering this mode to avoid just having hours as labels on the entire x-axis.
1208 * public/v3/components/time-series-chart.js:
1209 (TimeSeriesChart.prototype._renderXAxis): Slightly increase the "average" width of x-axis label.
1210 (TimeSeriesChart.computeTimeGrid): See above. Also assert that the number of labels we generate never
1211 exceeds maxLabels as a sanity check.
1212 (TimeSeriesChart._timeIterators): Added an iterator that increments by two hours for zoomed graphs.
1214 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1216 v3 UI should show status and associated bugs on analysis task pages
1217 https://bugs.webkit.org/show_bug.cgi?id=154212
1219 Reviewed by Chris Dumez.
1221 Added the capability to see and modify the status and the list of associated of bugs on analysis task pages.
1223 Also added the list of related tasks, which are analysis tasks associated with the same bug or have
1224 overlapping time ranges with the same test metric but on a potentially different platform.
1226 In addition, categorize analysis tasks with the status of "no change" or "inconclusive" as "closed" as no
1227 further action can be taken (users can bring them back to non-closed state without any restrictions).
1229 * public/api/analysis-tasks.php:
1230 (format_task): Categorize 'unchanged' and 'inconclusive' analysis tasks as closed.
1232 * public/privileged-api/associate-bug.php:
1233 (main): Added shouldDelete as a new mechanism to disassociate a bug since v3 UI shares a single Bug object
1234 between multiple analysis tasks (as it should have been in the first place).
1236 * public/v3/components/chart-pane-base.js:
1238 (ChartPaneBase.prototype._fetchAnalysisTasks): Since each analysis task's change type (status/result) could
1239 change, we need to create annotation objects during each render() call.
1240 (ChartPaneBase.prototype.render):
1241 (ChartPaneBase.prototype._renderAnnotations): Extracted from ChartPaneBase.prototype._fetchAnalysisTasks to
1242 do that. I was afraid of the perf impact of this but it doesn't seem to be an issue in my testing.
1243 (ChartPaneBase.cssTemplate): Removed superfluous margins (moved to ChartPane.cssTemplate) around the charts
1244 since they are only useful in the charts page.
1246 * public/v3/models/analysis-task.js:
1248 (AnalysisTask.prototype.updateSingleton): Added a comment as to why object.result cannot be renamed to
1249 object.changeType in the JSON API.
1250 (AnalysisTask.prototype.updateName): Added.
1251 (AnalysisTask.prototype.updateChangeType): Added.
1252 (AnalysisTask.prototype._updateRemoteState): Added.
1253 (AnalysisTask.prototype.associateBug): Added.
1254 (AnalysisTask.prototype.disassociateBug): Added.
1255 (AnalysisTask.fetchRelatedTasks): Added. See above for the criteria of related-ness.
1257 * public/v3/pages/analysis-task-page.js:
1259 (AnalysisTaskPage.prototype.updateFromSerializedState):
1260 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): Extracted from updateFromSerializedState.
1261 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks): Added.
1262 (AnalysisTaskPage.prototype.render): Render the list of associated bugs, the list of bug trackers (so that
1263 users can use it to associate with a new bug), and the list of related analysis tasks.
1264 (AnalysisTaskPage.prototype._renderTestGroupList): Extracted from render since it was getting too long.
1265 (AnalysisTaskPage.prototype._renderTestGroupDetails): Ditto.
1266 (AnalysisTaskPage.prototype._updateChangeType): Added.
1267 (AnalysisTaskPage.prototype._associateBug): Added.
1268 (AnalysisTaskPage.prototype._disassociateBug): Added.
1269 (AnalysisTaskPage.htmlTemplate): Added various elements to show and modify the status, associate bugs,
1270 and a list of related analysis tasks.
1271 (AnalysisTaskPage.cssTemplate): Added various styles for those form controls.
1273 * public/v3/pages/chart-pane.js:
1274 (ChartPane.cssTemplate): Moved the margins from ChartPaneBase.cssTemplate.
1276 2016-02-12 Ryosuke Niwa <rniwa@webkit.org>
1278 Perf dashboard should allow renaming analysis tasks and test groups
1279 https://bugs.webkit.org/show_bug.cgi?id=154200
1281 Reviewed by Chris Dumez.
1283 Allow editing names of analysis tasks and A/B testing groups in the v3 UI.
1285 Added the support for updating the name to the privileged API at /privileged-api/update-analysis-task
1286 and added a new prevailed API to update A/B testing groups at /privileged-api/update-test-group.
1288 * public/privileged-api/update-analysis-task.php: Added the support for renaming the analysis task.
1291 * public/privileged-api/update-test-group.php: Added. Supports updating the test group's name.
1294 * public/v3/components/editable-text.js: Added.
1295 (EditableText): Added. A new editable text label control. It looks like a text node with "(Edit)" link
1296 at the end which allow users to go into the "editing mode", which reveals an input element.
1297 The user can exit the editing mode by either moving the focus away from the control or clicking on
1298 "(Save)" at the end. It calls _updateCallback in the latter case.
1299 (EditableText.prototype.editedText): Returns the current value of the input element user.
1300 (EditableText.prototype.setText): Sets the label. This does not live-update the input element until
1301 the user exists the current editing mode and re-enters it.
1302 (EditableText.prototype.setStartedEditingCallback): Sets a callback which gets called when the user
1303 requested to enter the editing mode. Since EditableText relies on AnalysisTaskPage to render, this
1304 callback only exits to call EditableText.render() in AnalysisTask._didStartEditingTaskName.
1305 (EditableText.prototype.setUpdateCallback): Sets a callback which gets called when the user exits
1306 the editing mode by activating the "(Save)" link. This callback MUST return a promise upon resolution
1307 of which the control gets out of the editing mode. While the promise is in flight, the input element
1309 (EditableText.prototype.render): Updates various states of the elements. When _updatingPromise is not
1310 falsy, we make the input element readonly and show '(...)' on the link. Don't show the action link
1311 if the label is empty (e.g. analysis task or test group is still being fetched).
1312 (EditableText.prototype._didClick): Called when the user clicked on the action link. Enter the editing
1313 mode or save the edited label via _updateCallback.
1314 (EditableText.prototype._didBlur): Exit the editing mode without saving if the input element is not
1315 focused, there is no inflight promise returned by _updateCallback, and the action link "(Save)" does
1317 (EditableText.prototype._didUpdate): Called when exiting the editing mode.
1318 (EditableText.htmlTemplate):
1319 (EditableText.cssTemplate):
1321 * public/v3/index.html: Include newly added editable-text.js.
1323 * public/v3/models/analysis-task.js:
1324 (AnalysisTask.prototype.updateSingleton): Added.
1325 (AnalysisTask.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1326 the analysis task from the sever.
1327 (AnalysisTask._constructAnalysisTasksFromRawData): Use ensureSingleton instead of manually calling
1328 findById since we need to update the name of the singleton object we found (via updateSingleton).
1330 * public/v3/models/bug.js:
1331 (Bug.ensureSingleton): Moved the code to compute the synthetic id from AnalysisTask's
1332 _constructAnalysisTasksFromRawData.
1333 (Bug.prototype.updateSingleton): Added. Just assert that nothing changes.
1335 * public/v3/models/build-request.js:
1336 (BuildRequest.prototype.updateSingleton): Added. Assert that the intrinsic values of a build request
1337 doesn't change and update status text, status url, and build id as they could change.
1339 * public/v3/models/commit-log.js:
1340 (CommitLog): Made the constructor argument conform to the convention of id, object pair so that we can
1341 use DataModelObject.ensureSingleton.
1342 (CommitLog.ensureSingleton):
1343 (CommitLog.prototype.updateSingleton): Extracted from CommitLog.ensureSingleton.
1345 * public/v3/models/data-model.js:
1346 (DataModelObject.ensureSingleton): Call newly added updateSingleton.
1347 (DataModelObject.prototype.updateSingleton):
1348 (LabeledObject): Removed the name map since it's never used (findByName is never called anywhere).
1349 (LabeledObject.prototype.updateSingleton): Added. Updates _name.
1350 (LabeledObject.findByName): Deleted.
1352 * public/v3/models/test-group.js:
1353 (TestGroup.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1354 the test group from the sever.
1355 (TestGroup._createModelsFromFetchedTestGroups): Removed bogus code. A root set doesn't have a test
1356 group associated with it since multiple test groups can share a single root set (this property doesn't
1359 * public/v3/pages/analysis-task-page.js:
1360 (AnalysisTaskPage): Removed useless _taskId and added this._testGroupLabelMap and this._taskNameLabel.
1361 (AnalysisTaskPage.prototype.updateFromSerializedState): Cleanup.
1362 (AnalysisTaskPage.prototype._didFetchTask): Assert that this function is called exactly once.
1363 (AnalysisTaskPage.prototype.render): Use this._task.id() to show the v2 link. Use EditableText to show
1364 the names of the analysis task and the associated test groups. Hide the overview chart and the list of
1365 test groups (along with the retry/confirm button) when the analysis task failed to fetch. We always
1366 update the names of the analysis task and the associated test groups since they could be updated by
1368 (AnalysisTaskPage.prototype._didStartEditingTaskName): Added.
1369 (AnalysisTaskPage.prototype._updateTaskName): Added.
1370 (AnalysisTaskPage.prototype._updateTestGroupName): Added.
1371 (AnalysisTaskPage.htmlTemplate): Updated the style.
1373 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1375 Land the change that was supposed to be the part of r196463.
1377 * public/v3/pages/analysis-task-page.js:
1378 (AnalysisTaskPage.prototype._didFetchTestGroups): Select the latest test group by default.
1380 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1382 Refine v3 UI's analysis task page
1383 https://bugs.webkit.org/show_bug.cgi?id=154152
1385 Reviewed by Chris Dumez.
1387 This patch makes the following refinements to the analysis task page:
1388 - Always show the relative different of in-progress A/B testing.
1389 - Make the annotations (colored bars) in the chart open other analysis tasks.
1390 - Order the A/B testing groups in the reverse chronological order.
1391 - Select the time range corresponding to the current test group.
1393 * public/v3/components/analysis-results-viewer.js:
1394 (AnalysisResultsViewer.cssTemplate): Fixed the bug that pending and running testing groups are no longer
1395 colored after r196440. Use a slightly more opaque color for currently running groups compared to pending ones.
1397 * public/v3/components/chart-pane-base.js:
1398 (ChartPaneBase.prototype.setMainSelection): Added.
1399 (ChartPaneBase.prototype._openAnalysisTask): Moved the code from ChartPane._openAnalysisTask so that it can be
1400 reused in both AnalysisTaskChartPane and ChartPane (in charts page).
1401 (ChartPaneBase.prototype.router): Added. Overridden by each subclass.
1403 * public/v3/components/test-group-results-table.js:
1404 (TestGroupResultsTable.prototype.buildRowGroups): Always show the summary (relative difference of A to B) as
1405 long as there are some results in each set.
1407 * public/v3/models/test-group.js:
1408 (TestGroup.prototype.compareTestResults): Always set .label and .fullLabel with the relative change as long as
1409 there are some values. Keep using "pending" and "running" in .status since that would determine the color of
1410 stacking blocks representing those A/B testing groups.
1412 * public/v3/pages/analysis-task-page.js:
1413 (AnalysisTaskChartPane):
1414 (AnalysisTaskChartPane.prototype.setPage): Added.
1415 (AnalysisTaskChartPane.prototype.router): Added.
1417 (AnalysisTaskPage.prototype.render): Show the list of A/B testing groups in the reverse chronological order.
1418 Also set the main chart's selection to the time range of the current test group.
1420 * public/v3/pages/chart-pane.js:
1421 (ChartPane.prototype.router): Added.
1422 (ChartPane.prototype._openAnalysisTask): Moved to ChartPaneBase.prototype._openAnalysisTask.
1424 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1426 Add a script to process backlogs created while perf dashboard was in the maintenance mode
1427 https://bugs.webkit.org/show_bug.cgi?id=154140
1429 Reviewed by Chris Dumez.
1431 Added a script to process the backlog JSONs created while the perf dashboard was put in the maintenance mode.
1432 It re-submits each JSON file to the perf dashboard using the same server config file used by syncing scripts.
1434 * public/include/report-processor.php:
1435 (TestRunsGenerator::test_value_list_to_values_by_iterations): Fixed a bug in the error message code. It was
1436 referencing an undeclared variable.
1437 * tools/process-maintenance-backlog.py: Added.
1439 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1441 AnalysisResultsViewer never uses this._smallerIsBetter
1442 https://bugs.webkit.org/show_bug.cgi?id=154134
1444 Reviewed by Chris Dumez.
1446 Removed the unused instance variable _smallerIsBetter from AnalysisResultsViewer and TestGroupStackingBlock.
1448 * public/v3/components/analysis-results-viewer.js:
1449 (AnalysisResultsViewer): Removed the unused _smallerIsBetter.
1450 (AnalysisResultsViewer.prototype.setSmallerIsBetter): Deleted.
1451 (AnalysisResultsViewer.prototype.buildRowGroups):
1452 (AnalysisResultsViewer.TestGroupStackingBlock): Removed the unused _smallerIsBetter.
1453 * public/v3/pages/analysis-task-page.js:
1454 (AnalysisTaskPage.prototype._didFetchTask):
1456 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1458 Build fix after r196440.
1460 * public/v3/models/test-group.js:
1461 (TestGroup.prototype.addBuildRequest): Clear the map instead of setting the property to null.
1463 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
1465 Perf dashboard should have UI to retry A/B testing
1466 https://bugs.webkit.org/show_bug.cgi?id=154090
1468 Reviewed by Chris Dumez.
1470 Added a button to re-try an existing A/B testing group with a custom repetition count. The same button functions
1471 as a way of confirming the progression/regression when there have been no A/B testing scheduled in the task.
1473 Also fixed the bug that A/B testing groups that have been waiting for other test groups will be shown as "running".
1475 * public/v3/components/results-table.js:
1476 (ResultsTable.cssTemplate): Don't pad the list of extra repositories when it's empty.
1478 * public/v3/components/test-group-results-table.js:
1479 (TestGroupResultsTable.prototype.buildRowGroups): Use TestGroup.labelForRootSet instead of manually
1480 computing the letter for each configuration set.
1482 * public/v3/models/build-request.js:
1483 (BuildRequest.prototype.hasStarted): Added.
1485 * public/v3/models/data-model.js:
1486 (DataModelObject.ensureSingleton): Added.
1487 (DataModelObject.cachedFetch): Added noCache option. This is used when re-fetching the test groups after
1490 * public/v3/models/measurement-cluster.js:
1491 (MeasurementCluster.prototype.startTime): Added.
1493 * public/v3/models/measurement-set.js:
1494 (MeasurementSet.prototype.hasFetchedRange): Added. Returns true only if there are no "holes" (cluster
1495 yet to be fetched) between the specified time range. This was added to fix a bug in AnalysisTaskPage's
1496 _didFetchMeasurement.
1498 * public/v3/models/test-group.js:
1499 (TestGroup): Added this._rootSetToLabel.
1500 (TestGroup.prototype.addBuildRequest): Reset this._rootSetToLabel along with this._requestedRootSets.
1501 (TestGroup.prototype.repetitionCount): Added. Returns the number of iterations executed per set. We assume that
1502 every root set in the test group shares a single repetition count.
1503 (TestGroup.prototype.requestedRootSets): Now populates this._rootSetToLabel for labelForRootSet.
1504 (TestGroup.prototype.labelForRootSet): Added.
1505 (TestGroup.prototype.hasStarted): Added.
1506 (TestGroup.prototype.compareTestResults): Use 'running' and 'pending' to differentiate test groups that are waiting
1507 for other groups to finish running from the ones that are actually running ('incomplete' before this patch).
1508 (TestGroup.fetchByTask):
1509 (TestGroup.createAndRefetchTestGroups): Added. Creates a new test group using the privileged-api/create-test-group
1510 and fetches the list of test groups for the specified analysis task.
1511 (TestGroup._createModelsFromFetchedTestGroups): Extracted from TestGroup.fetchByTask.
1513 * public/v3/pages/analysis-task-page.js:
1514 (AnalysisTaskPage): Initialize _renderedCurrentTestGroup to undefined so that we'd always can differentiate
1515 the initial call to AnalysisTaskPage.render and subsequent calls in which it's identical to _currentTestGroup.
1516 (AnalysisTaskPage.prototype._didFetchMeasurement): Fixed a bug that we don't exit early even when some
1517 clusters in between startPoint and endPoint are still being fetched via newly added hasFetchedRange.
1518 (AnalysisTaskPage.prototype.render): Update the default repetition count based on the current test group.
1519 Also update the label of the button to "Confirm the change" if there is no A/B testing in this task.
1520 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Added. Re-triggers an existing A/B testing group or creates
1521 the A/B testing for the entire range of the analysis task.
1522 (AnalysisTaskPage.prototype._hasDuplicateTestGroupName): Added.
1523 (AnalysisTaskPage.prototype._createRetryNameForTestGroup): Added.
1524 (AnalysisTaskPage.htmlTemplate): Added form controls to re-trigger A/B testing.
1525 (AnalysisTaskPage.cssTemplate): Updated the style.
1527 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
1529 Removed the duplicated definition of ChartPaneBase.
1531 * public/v3/components/chart-pane-base.js:
1533 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
1535 Analysis task page on v3 UI should show charts
1536 https://bugs.webkit.org/show_bug.cgi?id=154057
1538 Reviewed by Chris Dumez.
1540 Extracted ChartPaneBase out of ChartPane and added an instance of its new subclass, AnalysisTaskChartPane,
1541 to the analysis task page. The main difference is that ChartPaneBase doesn't depend on the presence of
1542 this._chartsPage unlike ChartPane. It also doesn't have the header with toolbar (to show breakdown, etc...).
1544 * public/v3/components/base.js:
1545 (ComponentBase.prototype._constructShadowTree): Call htmlTemplate() and cssTemplate() with the right "this".
1547 * public/v3/components/chart-pane-base.js: Added.
1548 (ChartPaneBase): Extracted from ChartPane.
1549 (ChartPaneBase.prototype.configure): Extracted from the constructor. Separating this function allows the
1550 component to be instantiated inside a HTML template.
1551 (ChartPaneBase.prototype._fetchAnalysisTasks): Moved from ChartPane._fetchAnalysisTasks.
1552 (ChartPaneBase.prototype.platformId): Ditto.
1553 (ChartPaneBase.prototype.metricId): Ditto.
1554 (ChartPaneBase.prototype.setOverviewDomain): Ditto.
1555 (ChartPaneBase.prototype.setMainDomain): Ditto.
1556 (ChartPaneBase.prototype._overviewSelectionDidChange): Extracted from the constructor. This is overridden in
1557 ChartPane and unused in AnalysisTaskChartPane.
1558 (ChartPaneBase.prototype._mainSelectionDidChange): Extracted from ChartPane._mainSelectionDidChange.
1559 (ChartPaneBase.prototype._mainSelectionDidZoom): Extracted from ChartPane._mainSelectionDidZoom.
1560 (ChartPaneBase.prototype._indicatorDidChange): Extracted from ChartPane._indicatorDidChange.
1561 (ChartPaneBase.prototype._didFetchData): Moved from ChartPane._fetchAnalysisTasks.
1562 (ChartPaneBase.prototype._openAnalysisTask): Ditto.
1563 (ChartPaneBase.prototype._openCommitViewer): Ditto. Also fixed a bug that we don't show the spinner while
1564 waiting for the data to be fetched by calling this.render() here.
1565 (ChartPaneBase.prototype._keyup): Moved from ChartPane._keyup. Also fixed the bug that the revisions list
1566 doesn't update by calling this.render() here.
1567 (ChartPaneBase.prototype.render): Extracted from ChartPane.render.
1568 (ChartPaneBase.htmlTemplate): Extracted from ChartPane.htmlTemplate.
1569 (ChartPaneBase.paneHeaderTemplate): Added. This is overridden in ChartPane and unused in AnalysisTaskChartPane.
1570 (ChartPaneBase.cssTemplate): Extracted from ChartPane.htmlTemplate.
1572 * public/v3/components/chart-styles.js: Renamed from public/v3/pages/page-with-charts.js.
1573 (PageWithCharts): Renamed from PageWithCharts since it no longer extends PageWithHeading.
1574 (ChartStyles.createChartSourceList):
1576 * public/v3/components/commit-log-viewer.js:
1577 (CommitLogViewer.prototype.view): Set this._repository right away instead of waiting for the fetched data
1578 so that spinner will be shown while the data is being fetched.
1580 * public/v3/index.html:
1582 * public/v3/pages/analysis-task-page.js:
1583 (AnalysisTaskChartPane): Added extends ChartPaneBase.
1584 (AnalysisTaskPage): Added. this._chartPane.
1585 (AnalysisTaskPage.prototype._didFetchTask): Initialize this._chartPane with a domain.
1586 (AnalysisTaskPage.prototype.render): Render this._chartPane.
1587 (AnalysisTaskPage.htmlTemplate):
1589 * public/v3/pages/chart-pane-status-view.js:
1590 (ChartPaneStatusView): Removed the unused router from the argument list.
1591 (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Renamed from analyzeData() since it was ambiguous.
1592 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Fixed the bug that we don't update the list
1593 of the revisions here.
1594 (ChartPaneStatusView.prototype.computeChartStatusLabels):
1596 * public/v3/pages/chart-pane.js:
1597 (ChartPane): Now extends ChartPaneBase.
1598 (ChartPane.prototype._overviewSelectionDidChange): Extracted from the constructor.
1599 (ChartPane.prototype._mainSelectionDidChange):
1600 (ChartPane.prototype._mainSelectionDidZoom):
1601 (ChartPane.prototype._indicatorDidChange):
1602 (ChartPane.prototype.render):
1603 (ChartPane.prototype._renderActionToolbar):
1604 (ChartPane.paneHeaderTemplate): Extracted from htmlTemplate.
1605 (ChartPane.cssTemplate):
1606 (ChartPane.overviewOptions.selection.onchange): Deleted.
1607 (ChartPane.prototype._fetchAnalysisTasks): Deleted.
1608 (ChartPane.prototype.platformId): Deleted.
1609 (ChartPane.prototype.metricId): Deleted.
1610 (ChartPane.prototype.setOverviewDomain): Deleted.
1611 (ChartPane.prototype.setMainDomain): Deleted.
1612 (ChartPane.prototype._openCommitViewer): Deleted.
1613 (ChartPane.prototype._didFetchData): Deleted.
1614 (ChartPane.prototype._keyup): Deleted.
1616 * public/v3/pages/charts-page.js:
1618 (ChartsPage.createDomainForAnalysisTask): Extracted by createDomainForAnalysisTask; used to set the domain
1619 of the charts in the analysis task page.
1620 (ChartsPage.createStateForAnalysisTask):
1622 * public/v3/pages/dashboard-page.js:
1624 (DashboardPage.prototype._createChartForCell):
1626 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
1628 Add the support for maintenance mode
1629 https://bugs.webkit.org/show_bug.cgi?id=154072
1631 Reviewed by Chris Dumez.
1633 Added the crude support for maintenance mode whereby which the reports are stored in the filesystem
1634 instead of the database.
1636 * config.json: Added maintenanceMode and maintenanceDirectory as well as forgotten siteTitle and
1637 remoteServer.httpdMutexDir.
1638 * public/api/report.php:
1639 (main): Don't connect to the database or modify database when maintenanceMode is set.
1640 * public/include/json-header.php:
1641 (ensure_privileged_api_data): Exit with InMaintenanceMode when maintenanceMode is set. This prevents
1642 privileged API such as creating analysis tasks and new A/B testing groups from modifying the database.
1644 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
1646 Analysis task page on v3 show progression as regressions
1647 https://bugs.webkit.org/show_bug.cgi?id=154045
1649 Reviewed by Chris Dumez.
1651 The bug was caused by TestGroup.compareTestResults referring to undefined _smallerIsBetter.
1652 Retrieve it from the associated metric object via the owner analysis task.
1654 * public/v3/models/test-group.js:
1656 2016-02-05 Ryosuke Niwa <rniwa@webkit.org>
1658 Testing with remote server cache is unusably slow
1659 https://bugs.webkit.org/show_bug.cgi?id=153928
1661 Reviewed by Chris Dumez.
1663 Don't use the single process mode of httpd as it's way too slow even for testing.
1664 Also we'll hit a null pointer crash (http://svn.apache.org/viewvc?view=revision&revision=1711479)
1666 Since httpd exits immediately when launched in multi-process mode, remote-cache-server.py (renamed from
1667 run-with-remote-server.py) now has "start" and "stop" commands to start/stop the Apache. Also added
1668 "reset" command to reset the cache for convenience.
1670 * Install.md: Updated the instruction.
1671 * config.json: Fixed a typo: httpdErro*r*Log.
1672 * tools/remote-cache-server.py: Copied from Websites/perf.webkit.org/tools/run-with-remote-server.py.
1673 Now takes one of the following commands: "start", "stop", and "reset".
1675 (start_httpd): Extracted from main.
1676 (stop_httpd): Added.
1677 * tools/remote-server-relay.conf: Removed redundant (duplicate) LoadModule's.
1678 * tools/run-with-remote-server.py: Removed.
1680 2016-02-04 Ryosuke Niwa <rniwa@webkit.org>
1682 Perf dashboard should have a script to setup database
1683 https://bugs.webkit.org/show_bug.cgi?id=153906
1685 Reviewed by Chris Dumez.
1687 Added tools/setup-database.py to setup the database. It retrieves the database name, username, password
1688 and initializes a database at the specified location.
1690 * Install.md: Updated instruction to setup postgres to use setup-database.py.
1691 * tools/setup-database.py: Added.
1693 (load_database_config):
1694 (determine_psql_dir):
1695 (start_or_stop_database):
1696 (execute_psql_command):
1698 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
1700 buildbot syncing scripts sometimes schedule more than one requests per builder
1701 https://bugs.webkit.org/show_bug.cgi?id=153047
1703 Reviewed by Chris Dumez.
1705 The bug was caused by the check for singularity of scheduledRequests being conducted per configuration
1706 instead of per builder. So if there were multiple test configurations (e.g. Speedometer and Octane) that
1707 both used the same builder, then we may end up scheduling both at once.
1709 Fixed the bug by sharing a single set to keep track of the scheduled requests for all configurations per
1712 * tools/sync-with-buildbot.py:
1713 (load_config): Share a set amongst test configurations for each builder.
1714 (find_request_updates): Instead of creating a new set for each configuration, reuse the existing sets to
1715 share a single set agmonst test configurations for each builder.
1717 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
1719 Analysis results viewer sometimes doesn't show the correct relative difference
1720 https://bugs.webkit.org/show_bug.cgi?id=152930
1722 Reviewed by Chris Dumez.
1724 The bug was caused by single A/B testing result associated with multiple rows when there are multiple data
1725 points with the same root set which matches that of an A/B testing.
1727 Fixed the bug by detecting such a case, and only associating each A/B testing result with the row created
1728 for the first matching point.
1730 * public/v3/components/analysis-results-viewer.js:
1731 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
1733 2016-01-08 Ryosuke Niwa <rniwa@webkit.org>
1735 Make v3 UI analysis task page is hard to understand
1736 https://bugs.webkit.org/show_bug.cgi?id=152917
1738 Reviewed by Antti Koivisto.
1740 Add a dark gray border around the selected block in the analysis results viewer instead of using darker
1741 shades since that looks as if they were bigger regression/progression.
1743 Explicitly show "Failed" as the label instead of omitting with "-" when all build requests in an A/B
1744 testing group fails.
1746 * public/v3/components/analysis-results-viewer.js:
1747 (AnalysisResultsViewer.cssTemplate): Tweaked the style to underline text in the hovered blocks and the
1748 selected blocks and show a dark gray border around the selected blocks.
1749 (AnalysisResultsViewer.TestGroupStackingBlock):
1750 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Use this._title for title.
1751 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
1752 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForRootSet): Deleted.
1754 * public/v3/components/results-table.js:
1755 (ResultsTable.prototype.render):
1756 (ResultsTable.prototype._createRevisionListCells): Extracted from ResultsTable.prototype.render.
1757 (ResultsTable.cssTemplate): Tweaked the style.
1759 (ResultsTableRow.prototype.constructor): Added _labelForWholeRow to store the label for the entire row.
1760 This is used to show the comparison result of two root sets (e.g. A vs B).
1761 (ResultsTableRow.prototype.setLabelForWholeRow): Added.
1762 (ResultsTableRow.prototype.labelForWholeRow): Added.
1763 (ResultsTableRow.prototype.resultContent): Extracted from buildHeading. Creates a hyperlinked bar graph
1764 used for each A/B testing result.
1765 (ResultsTableRow.prototype.buildHeading): Deleted since we need to set colspan on the second table cell
1766 when we're creating a row with _labelForWholeRow.
1768 * public/v3/components/test-group-results-table.js:
1769 (TestGroupResultsTable.prototype.buildRowGroups): Added rows to show relative differences and statistical
1770 significance between root sets (e.g. A vs B).
1772 * public/v3/models/build-request.js:
1773 (BuildRequest.prototype.hasCompleted): Added.
1775 * public/v3/models/test-group.js:
1776 (TestGroup.prototype.compareTestResults): Extracted from AnalysisResultsViewer.TestGroupStackingBlock's
1777 _computeTestGroupStatus and generalized to be reused in TestGroupResultsTable.
1778 (TestGroup.prototype._valuesForRootSet): Moved from AnalysisResultsViewer.TestGroupStackingBlock.
1780 * public/v3/pages/analysis-task-page.js:
1781 (AnalysisTaskPage.cssTemplate): Tweaked the style.
1783 2016-01-07 Ryosuke Niwa <rniwa@webkit.org>
1785 Perf dashboard should automatically add aggregators
1786 https://bugs.webkit.org/show_bug.cgi?id=152818
1788 Reviewed by Chris Dumez.
1790 When an aggregator entry is missing in aggregators table, automatically insert it in /api/report.
1792 In a very early version of the perf dashboard, we had the ability to define a custom aggregator
1793 in an admin page. In practice, nobody used or needed this feature so we got rid of it even before
1794 the dashboard was landed into WebKit repository. This patch cleans up that mess.
1797 (main): Added the filtering capability.
1798 (TestEnvironment): Expose the config JSON in the test environment.
1800 * public/include/report-processor.php:
1801 (ReportProcessor): Renamed name_to_aggregator now that it only contains ID.
1802 (ReportProcessor::__construct): No longer fetches the aggregator table. An equivalent work is done
1803 in newly added ensure_aggregators.
1804 (ReportProcessor::process): Calls ensure_aggregators which populates name_to_aggregator_id.
1805 (ReportProcessor::ensure_aggregators): Added. Add the builtin aggregators: Arithmetic, Geometric,
1806 Harmonic, and Total.
1807 (TestRunsGenerator): Renamed name_to_aggregator now that it only contains ID.
1808 (TestRunsGenerator::__construct):
1809 (TestRunsGenerator::add_aggregated_metric): Don't include aggregator_definition here since it's
1810 never used now that all the aggregations are done natively in PHP.
1811 (TestRunsGenerator::$aggregators): Added. We don't include SquareSum since it's only used for
1812 computing run_square_sum_cache in test_runs table and it's useless elsewhere.
1813 (TestRunsGenerator::aggregate_values): Add a comment about that.
1815 * tests/api-report.js: Updated a test case to reflect the change.
1817 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
1819 Perf dashboard JSON API should fail gracefully when postgres is down
1820 https://bugs.webkit.org/show_bug.cgi?id=152812
1822 Reviewed by Chris Dumez.
1824 Even though all JSON APIs returned DatabaseConnectionFailure as the status when Database::connect
1825 returned a falsy value, PHP was spitting out warnings and producing HTTP responses that cannot be
1826 parsed as a JSON when pg_connect failed.
1828 Fixed the bug by suppressing warning messages in pg_connect.
1830 * public/include/db.php:
1831 (Database::connect): Use '@' prefix to suppress warning messages.
1833 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
1835 Perf dashboard should auto-generate manifest file when one is missing
1836 https://bugs.webkit.org/show_bug.cgi?id=152813
1838 Reviewed by Chris Dumez.
1840 When /data/manifest.json is missing, fall back to newly added /api/manifest instead of
1841 silently failing to show the UI. This will make the initial setup easier.
1843 * public/api/manifest.php: Added.
1845 * public/include/manifest.php:
1846 (Manifest::manifest): Added.
1847 * public/v3/main.js:
1849 (didFetchManifest): Extracted from fetchManifest.
1851 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
1853 Commit another forgotten change, this time, for r194653.
1855 * public/v3/models/measurement-set.js:
1857 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
1859 The sampling of time series on v3 UI is too aggressive
1860 https://bugs.webkit.org/show_bug.cgi?id=152804
1862 Reviewed by Chris Dumez.
1864 Fixed a bug that we were always halving the number of data points in _sampleTimeSeries
1865 and increased the number of data points allowed to make the sampling less aggressive.
1867 * public/v3/components/time-series-chart.js:
1868 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Increase the number of maximum points
1869 to 2x the number of pixels divided by the radius of each point.
1870 (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Changed the semantics of endIndex
1871 to mean the index after the last point and renamed it to indexAfterEnd.
1872 (TimeSeriesChart.prototype._sampleTimeSeries): Fixed a bug that this code always coerced two
1873 data points into one sampled data point despite of the fact i and j are sufficiently apart
1874 since data[j].time - data[i].time > timePerSample by definition.
1876 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
1878 Commit the forgotten change for r194651.
1880 * public/v3/pages/domain-control-toolbar.js:
1881 (DomainControlToolbar.prototype.setStartTime):
1883 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
1885 The right hand side of main chart appears to be cut off as you zoom out on v3 UI
1886 https://bugs.webkit.org/show_bug.cgi?id=152778
1888 Reviewed by Antti Koivisto.
1890 Add a padding on x-axis after the end time to make the main chart more easily interactive.
1892 * public/v3/components/time-series-chart.js:
1893 (TimeSeriesChart.prototype._computeHorizontalRenderingMetrics):
1895 * public/v3/pages/page-with-charts.js:
1896 (PageWithCharts.mainChartOptions): Add a padding of 5px at the end of x-axis.
1898 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
1900 v3 UI should use four sig-figs to label y-axis of the main charts
1901 https://bugs.webkit.org/show_bug.cgi?id=152779
1903 Reviewed by Antti Koivisto.
1905 Increase the number of significant figures used in the main charts to four as done in v2 UI.
1907 * public/v3/pages/chart-pane.js:
1908 (ChartPane.constructor): Create a formatter with four significant figures.
1909 * public/v3/pages/page-with-charts.js:
1910 (PageWithCharts.mainChartOptions): Increase the width of y-axis labels.
1912 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
1914 v3 UI's time range slider is harder to use than that of v2 UI
1915 https://bugs.webkit.org/show_bug.cgi?id=152780
1917 Reviewed by Antti Koivisto.
1919 Improved the time range slider by using a cubic mapping to time range and providing a text field
1920 to directly edit the number of days to show.
1922 Now an user can enter the text mode to directly edit the number of days to show by clicking on
1923 the number of days (text field is always there with opacity=0).
1925 * public/v3/pages/charts-toolbar.js:
1926 (ChartsToolbar): Store the minimum and maximum number of days allowed. Also rename _inputElement
1927 to _slider and added a new type=number text field as _editor.
1928 (ChartsToolbar.prototype.render):
1929 (ChartsToolbar.prototype.setStartTime): Exit the text mode when the number of days is changed by
1930 an URL state transition (i.e. back/forward navigation).
1931 (ChartsToolbar.prototype._setInputElementValue): Added. Updates the values of _slider and _editor.
1932 (ChartsToolbar.prototype._enterTextMode): Added. Hide the elements used by the slider mode and
1933 show the text field.
1934 (ChartsToolbar.prototype._exitTextMode): Added. Does the opposite.
1935 (ChartsToolbar.prototype._sliderValueMayHaveChanged): Renamed from _inputValueMayHaveChanged.
1936 (ChartsToolbar.prototype._editorValueMayHaveChanged): Added. Similar to _sliderValueMayHaveChanged
1937 but also corrects the value of _editor if needed.
1938 (ChartsToolbar.prototype._callNumberOfDaysCallback): Extracted from _inputValueMayHaveChanged.
1939 Also fixed a bug that we didn't update the URL state when the change event was fired without
1940 modifying the effective number of days.
1941 (ChartsToolbar.cssTemplate): Tweaked the style to support the new mode. Also set a fixed width on
1942 the span showing the number of days in the slider mode.
1944 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
1946 Zooming button is broken on v3 UI
1947 https://bugs.webkit.org/show_bug.cgi?id=152777
1949 Reviewed by Chris Dumez.
1951 Bring up the zoom button in z-index so that users can click it.
1953 * public/v3/components/interactive-time-series-chart.js:
1954 (InteractiveTimeSeriesChart.cssTemplate):
1956 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
1958 v3 UI doesn't preserve the time range when charts page is opened from a dashboard
1959 https://bugs.webkit.org/show_bug.cgi?id=152776
1961 Reviewed by Chris Dumez.
1963 Fixed the bug by moving the construction of charts URL from DashboardPage.prototype.open to
1964 DashboardPage.prototype.render and re-rendering the entire page upon an URL state transition.
1966 * public/v3/pages/charts-page.js:
1967 (ChartsPage.createStateForDashboardItem): Takes the start time for the charts page.
1969 * public/v3/pages/dashboard-page.js:
1970 (DashboardPage.prototype.updateFromSerializedState): Merged _numberOfDaysDidChange and
1971 _updateChartsDomainFromToolbar into this function since they're not used elsewhere. Also re-render
1972 the entire page when transition between different number of days to show.
1973 (DashboardPage.prototype._numberOfDaysDidChange): Deleted.
1974 (DashboardPage.prototype._updateChartsDomainFromToolbar): Deleted.
1975 (DashboardPage.prototype.render): Construct URL for each charts here.
1976 (DashboardPage.prototype._createChartForCell): Don't construct URL here since this function is
1977 called once when the dashboard page is opened, and not when the time range is changed.
1979 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
1981 Build fix for an old version of PHP after r194618.
1983 * public/api/measurement-set.php:
1985 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
1987 A/B testing results should be visualized intuitively on v3 UI
1988 https://bugs.webkit.org/show_bug.cgi?id=152496
1990 Rubber-stamped by Chris Dumez.
1992 Add the "stacking block" view of A/B testing results to the analysis task page on v3 UI.
1994 The patch enhances JSON APIs at /api/analysis-task /api/measurement-set/ to reduce the number of
1995 HTTP requests, and adds two UI components: TestGroupResultsTable and AnalysisResultsViewer both
1996 of which inherits from an abstract superclass: ResultsTable.
1998 ResultsTable provides a tabular presentation of measured values in regular measurement sets and
1999 A/B testing results using groups of bar graphs created by BarGraphGroup. TestGroupResultsTable
2000 inherits from this class to display A/B testing configurations and the averaged results for each
2001 configuration, and AnalysisResultsViewer inherits from it to provide an intuitive visualization
2002 of the outcomes of all A/B testing results associated with a given analysis task.
2004 * public/api/analysis-tasks.php:
2005 (main): Add the capability to find the analysis task based on its build request.
2006 This allows /v3/#/analysis/task/?buildRequest=<id> to be hyperlinked on buildbot page.
2008 * public/api/measurement-set.php:
2009 (main): Removed the unused startTime and endTime, and added "analysisTask" to query parameters.
2010 (AnalysisResultsFetcher): Added. Used to fetch measured data associated with every build request
2011 on an analysis task.
2012 (AnalysisResultsFetcher::__construct):
2013 (AnalysisResultsFetcher::fetch): Unlike MeasurementSetFetcher, we fetch the list of commits and
2014 list of measurements separately since there will be a lot less builds and commits than measured
2015 data (since we're fetching measured values for all tests and their metrics).
2016 (AnalysisResultsFetcher::fetch_commits): Fetches commits.
2017 (AnalysisResultsFetcher::format_measurement): Like MeasurementSetFetcher::format_measurement but
2018 with config_type and config_metric since we're returning measured data for all metrics and test
2020 (AnalysisResultsFetcher::format_map): Similar to MeasurementSetFetcher::format_map.
2022 * public/v3/components/analysis-results-viewer.js: Added.
2023 (AnalysisResultsViewer): Added.
2024 (AnalysisResultsViewer.prototype.didUpdateResults): This callback is called by AnalysisTaskPage
2025 when A/B testing results become available.
2026 (AnalysisResultsViewer.prototype.render): Overrides ResultsTable's render to highlight the block
2027 representing the currently selected test group.
2029 (AnalysisResultsViewer.prototype.buildRowGroups): Creates a list of rows with "stacking blocks"
2030 that visualizes A/B testing results. The algorithm works as follows: 1. Create all table rows.
2031 2. Find which row is associated with each set in each test group. 3. Layout "blocks".
2033 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Collects root sets from all data
2034 in the measurement set as well as A/B testing **requests** (results may contain more repositories
2035 than requested but they aren't interesting for the purpose of visualizing results for the entire
2038 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Create table rows. First,
2039 create table rows for measurement set points that have a matching test group (i.e. either set A
2040 or set B of an A/B testing uses the same root set as a point). Second, insert a new row for each
2041 root set in each test group which didn't find a matching measurement set point. There is a little
2042 subtlety that some A/B testing may specify revisions for a subset of repositories and/or some A/B
2043 testing results may appear as if it goes back in time with respect to other A/B testing results.
2044 For example, consider creating two A/B test groups for WebKit changes and OS changes separately.
2045 There could be no coherent linearization of those two A/B testing in which both WebKit and OS
2046 versions move forward.
2048 (AnalysisResultsViewer.RootSetInTestGroup): Added. Represents a pair (test group, root set) since
2049 a root set could be shared by multiple test groups.
2050 (AnalysisResultsViewer.TestGroupStackingBlock): Added. A stacked block representing a test group.
2051 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex): Associates a row number with
2052 either set A or set B.
2053 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Creates a table cell
2055 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Returns true if this test group
2056 has failed and this block should look "thin" without any label.
2057 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus): Computes the
2058 status for this test group.
2060 (AnalysisResultsViewer.TestGroupStackingGrid): Added. AnalysisResultsViewer uses this class to
2061 layout blocks representing test groups.
2062 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.insertBlockToColumn): Inserts a new block
2063 to layout. We keep all test groups doing the same A/B test next to each other.
2064 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.layout): Layouts each block / test group
2065 in the order they are created.
2066 (AnalysisResultsViewer.TestGroupStackingGrid.prototype._layoutBlock): Places the block in the
2067 left-most column that can accommodate it while avoiding columns of a different thin-ness. A column
2068 is thin if its A/B testing has failed, and not thin otherwise.
2069 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.createCellsForRow): Creates table cells for
2070 a given row. For each column, generate a table cell if we're in the first row and the first block
2071 starts in a later row, a block starts in the current row, or the last block ended in the previous
2072 row and the next block or the last row appears later.
2074 * public/v3/components/bar-graph-group.js: Added. A component for showing a group of bar graphs.
2075 (BarGraphGroup): Added. Creates a group of bar graphs with the same value range. It's used by
2076 AnalysisResultsViewer and ResultsTable to show bar graphs to compare values.
2077 (SingleBarGraph): A component created and collectively controlled by BarGraphGroup.
2079 * public/v3/components/results-table.js: Added.
2080 (ResultsTable): An abstract superclass for TestGroupResultsTable and AnalysisResultsViewer.
2082 (ResultsTable.prototype.render): Renders the table. 1. Call "buildRowGroups()" implemented by
2083 a subclass to obtain the list of rows. 2. Compute the list of repositories to show. 3. For each
2084 cell in the table, compute the number of rows to show the same value (for rowspan). 4. Render the
2085 table with an extra list of repositories if exists.
2087 (ResultsTable.prototype._computeRepositoryList): Compute the list of repositories to list
2088 revisions in the table. Omit repositories not present in any row or for which all rows have the
2089 same revision. In the latter case, include it in the extra repositories listed below the table.
2090 This minimizes the amount of redundant information presented to the user.
2092 (ResultsTableRow): Added. Represents a single row in the table. ResultsTable constructs necessary
2093 table cells to tabulate the associated root sets, and shows the associated result using a grouped
2094 bar graph. Additional columns are used by AnalysisResultsViewer to show stacked blocks for A/B
2097 * public/v3/components/test-group-results-table.js: Added.
2098 (TestGroupResultsTable):
2099 (TestGroupResultsTable.prototype.didUpdateResults):
2100 (TestGroupResultsTable.prototype.setTestGroup):
2101 (TestGroupResultsTable.prototype.heading):
2102 (TestGroupResultsTable.prototype.render):
2103 (TestGroupResultsTable.prototype.buildRowGroups):
2105 * public/v3/index.html:
2106 * public/v3/models/analysis-results.js: Added.
2107 (AnalysisResults): Added. Like MeasurementSet, this class represents a set of measured values
2108 associated with a given analysis task.
2109 (AnalysisResults.prototype.find): Returns a measured valued for a given build and metric.
2110 (AnalysisResults.prototype.add): Adds a new measured value. Used by AnalysisResults.fetch.
2111 (AnalysisResults.fetch): Fetches data and creates AnalysisResults for a given analysis task.
2113 * public/v3/models/analysis-task.js:
2114 (AnalysisTask.prototype.startMeasurementId): Added.
2115 (AnalysisTask.prototype.endMeasurementId): Added.
2116 (AnalysisTask.fetchByBuildRequestId): Added.
2117 (AnalysisTask._fetchSubset): Uses DataModelObject.cachedFetch.
2119 * public/v3/models/build-request.js: Added.
2120 (BuildRequest): Added. Represents a single A/B testing request associated with a test group.
2122 * public/v3/models/builder.js:
2123 (Build): Added. Represents a build associated with a given A/B testing result.
2125 * public/v3/models/commit-log.js:
2126 (CommitLog): Made this class inherit from DataModelObject.
2127 (CommitLog.ensureSingleton): Added. Finds the singleton object created for a given revision
2128 in the specified repository. This helps RootSet and other classes compare commits fast.
2129 (CommitLog.prototype.repository): Added.
2130 (CommitLog.fetchBetweenRevisions): Uses CommitLog.ensureSingleton.
2132 * public/v3/models/data-model.js:
2134 (DataModelObject.namedStaticMap): Added.
2135 (DataModelObject.ensureNamedStaticMap): Renamed from namedStaticMap instead of implicitly
2136 assuming that the non-static version always creates the map.
2137 (DataModelObject.prototype.namedStaticMap): Added.
2138 (DataModelObject.cachedFetch): Extracted from AnalysisTask._fetchSubset so that TestGroup's
2139 fetchByTask could also use it.
2142 * public/v3/models/measurement-adaptor.js: Added.
2143 (MeasurementAdaptor): Extracted from MeasurementCluster. This class is responsible for
2144 re-formatting the data received via /api/measurement-set JSON API inside the v3 UI.
2145 (MeasurementAdaptor.prototype.extractId): Added.
2146 (MeasurementAdaptor.prototype.adoptToAnalysisResults): Added. Used by AnalysisResults.
2147 (MeasurementAdaptor.aggregateAnalysisResults): Added. Used by TestGroupResultsTable to
2148 aggregate results for each test configuration; e.g. computing the average for set A.
2149 (MeasurementAdaptor.prototype.adoptToSeries): Extracted from MeasurementCluster.addToSeries.
2150 Added rootSet() to each point. This allows AnalysisResultsViewer to compare them against root
2151 sets associated with A/B testing results.
2152 (MeasurementAdaptor.computeConfidenceInterval): Moved from MeasurementCluster.
2154 * public/v3/models/measurement-cluster.js:
2155 (MeasurementCluster):
2156 (MeasurementCluster.prototype.addToSeries):
2158 * public/v3/models/repository.js:
2159 (Repository.prototype.hasUrlForRevision): Added.
2161 * public/v3/models/root-set.js: Added.
2162 (RootSet): Added. Represents a set of commits in measured results.
2163 (MeasurementRootSet): Added. Ditto for results associated with A/B testing.
2165 * public/v3/models/test-group.js: Added.
2166 (TestGroup): Added. Represents a A/B testing on analysis task.
2167 (TestGroup.prototype.createdAt): Added.
2168 (TestGroup.prototype.buildRequests): Returns the list of build requests associated with this
2170 (TestGroup.prototype.addBuildRequest): Added. Used by BuildRequest's constructor to associate
2171 itself with this group.
2172 (TestGroup.prototype.didSetResult): Added. Called by BuildRequest.setResult when measured
2173 values are fetched and associated with a build request in this group.
2175 * public/v3/models/test.js:
2178 * public/v3/pages/analysis-task-page.js:
2180 (AnalysisTaskPage.prototype.updateFromSerializedState): Fetch the analysis task, test groups
2181 associated with it, and all A/B testing results based on the task id or the build request id
2182 specified in the URL.
2183 (AnalysisTaskPage.prototype._didFetchTask): Added. Start fetching the measured data. This is
2184 the data on charts page for which this analysis task was created, not results of A/B testing.
2185 (AnalysisTaskPage.prototype._didFetchMeasurement): Added. Display the fetched data in a table
2186 inside AnalysisResultsViewer.
2187 (AnalysisTaskPage.prototype._didFetchTestGroups): Added. Display the list of A/B test groups
2188 as well as the results of the first A/B testing.
2189 (AnalysisTaskPage.prototype._didFetchAnalysisResults): Added.
2190 (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Added. Once both the analysis task,
2191 A/B test groups as well as their results are fetched, update build requests in each test group
2193 (AnalysisTaskPage.prototype.render): Show the list of test groups and highlight the currently
2195 (AnalysisTaskPage.prototype._showTestGroup): Added. A callback used by AnalysisResultsViewer
2196 and TestGroupResultsTable to notify this class when the user selects a new test group.
2197 (AnalysisTaskPage.htmlTemplate): Updated the template.
2198 (AnalysisTaskPage.cssTemplate): Ditto.
2200 * public/v3/pages/charts-page.js:
2201 (ChartsPage.createStateForAnalysisTask): Added. Creates a URL state object for opening a chart
2202 associated with an analysis task.
2204 2015-12-22 Ryosuke Niwa <rniwa@webkit.org>
2206 Analysis task page is slow to load
2207 https://bugs.webkit.org/show_bug.cgi?id=152517
2209 Reviewed by Andreas Kling.
2211 The slowness comes from r194130 which made the JSON API at /api/analysis-tasks to report the start
2212 and the end of each analysis task. This query was adding ~2s to the total JSON generation time.
2214 Cache these values on analysis_task table since they never change once an analysis task is created.
2216 * init-database.sql: Added columns task_start_run_time and task_end_run_time to analysis_task table.
2217 Also added the missing drop statements at the top.
2219 * public/api/analysis-tasks.php:
2220 (fetch_and_push_bugs_to_tasks): Don't fetch the latest commit time of the start and the end.
2221 (format_task): Report task_start_run_time and task_end_run_time as startRunTime and endRunTime.
2223 * public/privileged-api/create-analysis-task.php:
2224 (main): Set start_run_time and end_run_time when creating an analysis task.
2225 (time_for_run): Added.
2227 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2229 v3 UI shouldn't open/close pane selector by mouseenter/leave
2230 https://bugs.webkit.org/show_bug.cgi?id=152399
2232 Reviewed by Andreas Kling.
2234 Removed the code to open and close the pane selector by mouseenter and mouseleave
2235 since multiple people have complained about the behavior.
2237 * public/v3/pages/charts-toolbar.js:
2238 (ChartsToolbar): Removed the event listeners.
2239 (ChartsToolbar.prototype._addPane): Don't close the pane selector when adding a new pane
2240 to better support the use case of adding multiple panes.
2241 (ChartsToolbar.cssTemplate): Tweaked CSS.
2243 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2245 Popover for analysis tasks shows up at the left edge of annotation bars in the v3 UI
2246 https://bugs.webkit.org/show_bug.cgi?id=152389
2248 Reviewed by Darin Adler.
2250 Compute the x coordinate of the popover from the center of each annotation bar.
2252 Also adjust the x coordinate to keep the popover within the charts.
2254 * public/v3/components/interactive-time-series-chart.js:
2255 (InteractiveTimeSeriesChart.prototype._renderChartContent):
2257 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2259 Dashboard charts should have uniform widths on v3 UI
2260 https://bugs.webkit.org/show_bug.cgi?id=152395
2262 Reviewed by Chris Dumez.
2264 Fix the bug by applying table-layout: fixed on the dashboard table.
2266 * public/v3/pages/dashboard-page.js:
2267 (DashboardPage.prototype.render): Added header-column as a class name to explicitly set the header column with.
2268 (DashboardPage.cssTemplate): Adjusted CSS accordingly.
2270 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2272 Closing a pane on v3 UI always closes the last pane
2273 https://bugs.webkit.org/show_bug.cgi?id=152388
2275 Reviewed by Chris Dumez.
2277 The bug was caused by closePane being called without arguments. (The first argument to bind is "this" value.)
2278 Fixed it by passing in "this" pane object to the first argument.
2280 * public/v3/pages/chart-pane.js:
2283 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2285 Perf Dashboard v3 UI doesn't show recent data points on v2 UI
2286 https://bugs.webkit.org/show_bug.cgi?id=152368
2288 Reviewed by Chris Dumez.
2290 The bug was caused by the last modified date in measurement set JSON being a string instead of a POSIX timestamp,
2291 which prevented the v3 UI from invalidating the cache. Specifically, the following boolean logic always evaluated
2292 to false because +data['lastModified'] was NaN in MeasurementSet.prototype._fetch (/v3/models/measurement-set.js):
2294 !clusterEndTime && useCache && +data['lastModified'] < self._lastModified
2296 Fixed the bug by calling Database::to_js_time on the last modified date fetched from the database.
2298 * public/api/measurement-set.php:
2299 (MeasurementSetFetcher::fetch_config_list): Convert the string returned by the database to a POSIX timestamp.
2300 * tests/api-measurement-set.js: Added a test to ensure the last modified date in JSON is numeric. Since the value
2301 of the last modified date depends on when tests run, we can't assert it to be a certain value.
2303 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2305 v3 UI should show and link the build number on charts page
2306 https://bugs.webkit.org/show_bug.cgi?id=152359
2308 Reviewed by Chris Dumez.
2310 Show the hyperlinked build number in the v3 UI.
2312 * public/v3/models/builder.js:
2313 (Builder): Renamed _buildURL to _buildUrlTemplate.
2314 (Builder.prototype.urlForBuild): Added.
2315 * public/v3/pages/chart-pane-status-view.js:
2316 (ChartPaneStatusView):
2317 (ChartPaneStatusView.prototype.render): Added the code to render hyperlinked build number when one is available.
2318 (ChartPaneStatusView.prototype.computeChartStatusLabels): Store currentPoint's measurement object as _buildInfo
2319 if the current point is set by an indicator (not by a selection).
2321 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2323 v3 dashboard doesn't stretch charts to fill the screen
2324 https://bugs.webkit.org/show_bug.cgi?id=152354
2326 Reviewed by Chris Dumez.
2328 The bug was caused by a workaround to avoid canvas stretching table cell too much.
2330 Fix the problem instead by making the canvas absolutely positioned inside the "time-series-chart" element
2331 so that it does not contribute to the intrinsic/natural width of the cell.
2333 * public/v3/components/time-series-chart.js:
2334 (TimeSeriesChart.prototype._ensureCanvas): Make the canvas absolutely positioned inside the shadow root.
2335 (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Use the container element's size now that
2336 the canvas does not resize with it.
2337 * public/v3/pages/dashboard-page.js:
2338 (DashboardPage.cssTemplate): Updated the CSS so that the chart stretches all the way.
2340 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2342 The chart status on v3 UI sometimes show wrong revision ranges
2343 https://bugs.webkit.org/show_bug.cgi?id=152331
2345 Reviewed by Chris Dumez.
2347 The bug was caused by the status view not taking the data sampling that happens in TimeSeriesChart into account
2348 when finding the previous point. Take this into account by using InteractiveTimeSeries.currentPoint(-1) which
2349 finds the sampled data point immediately preceding the current point (at which the indicator is shown).
2351 * public/v3/components/chart-status-view.js:
2352 (ChartStatusView.prototype.updateStatusIfNeeded):
2354 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2356 Perf dashboard's cycler page should use v3 UI
2357 https://bugs.webkit.org/show_bug.cgi?id=152324
2359 Reviewed by Chris Dumez.
2361 Use the v3 UI in cycler.html after r194130.
2363 * public/cycler.html:
2364 * public/v3/index.html: Removed the reference to a non-existent platform-selector.js.
2366 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2368 Add v3 UI to perf dashboard
2369 https://bugs.webkit.org/show_bug.cgi?id=152311
2371 Reviewed by Chris Dumez.
2373 Add the third iteration of the perf dashboard UI. UI for viewing and modifying analysis tasks is coming soon.
2374 The v3 UI is focused on speed, and removes all third-party script dependencies including jQuery, d3, and Ember.
2375 Both the DOM-based UI and graphing are implemented manually.
2378 The entire app is structured using new component library implemented in components/base.js. Each component is
2379 an instance of a subclass of ComponentBase which owns a single DOM element. Each subclass may supply static
2380 methods named htmlTemplate and cssTemplate as the template for a component instance. ComponentBase automatically
2381 clones the templates inside the associated element (or its shadow root on the supported browsers). Each subclass
2382 must supply a method called "render()" which constructs and updates the DOM as needed.
2384 There is a special component called Page, which represents an entire page. Each Page is opened by PageRouter's
2385 "route()" function. Each subclass of Page supplies "open()" for initialization and "updateFromSerializedState()"
2386 for a hash URL transition.
2389 The key feature of the v3 UI is the split of time series into chunks called clusters (see r194120). On an internal
2390 instance of the dashboard, the v2 UI downloads 27MB of data whereas the same page loads only 3MB of data in the v3.
2391 The key logic for fetching time series in chunks is implemented by MeasurementSet in /v3/models/measurement-set.js.
2392 We first fetch the cached primary cluster (the cluster that contains the newest data) at:
2393 /data/measurement-set-<platform-id>-<metric-id>.json
2395 If that's outdated according to lastModified in manifest.json, then we immediately re-fetch the primary cluster at:
2396 /api/measurement-set/?platform=<platform-id>&metric=<metric-id>
2398 Once the up-to-date primary cluster is fetched, we fetch all "secondary" clusters. For each cluster being fetched,
2399 including the primary, we invoke registered callbacks.
2402 In addition, the v3 UI reduces the initial page load time by loading a single bundled JS file generated by
2403 tools/bundle-v3-scripts.py. index.html has a fallback to load all 44 JS files individually during development.
2405 * public/api/analysis-tasks.php:
2406 (fetch_and_push_bugs_to_tasks): Added the code to fetch start and end run times. This is necessary in V3 UI
2407 because no longer fetch the entire time series. See r194120 for the new measurement set JSON API.
2408 (format_task): Compute the category of an analysis task based on "result" value. This will be re-vamped once
2409 I add the UI for the analysis task page in v3.
2411 * public/include/json-header.php:
2412 (require_format): CamelCase the name.
2413 (require_match_one_of_values): Ditto.
2414 (validate_arguments): Renamed from require_existence_of and used in measurement-set.php landed in r194120.
2417 * public/v3/components: Added.
2419 * public/v3/components/base.js: Added.
2420 (ComponentBase): The base component class.
2421 (ComponentBase.prototype.element): Returns the DOM element associated with the DOM element.
2422 (ComponentBase.prototype.content): Returns the shadow root if one exists and the associated element otherwise.
2423 (ComponentBase.prototype.render): To be implemented by a subclass.
2424 (ComponentBase.prototype.renderReplace): A helper function to "render" DOM contents.
2425 (ComponentBase.prototype._constructShadowTree): Called inside the constructor to instantiate the templates.
2426 (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Instantiates components referred by
2427 its element name inside the instantiated content.
2428 (ComponentBase.isElementInViewport): A helper function. Returns true if the element is in the viewport and it has
2429 non-zero width and height.
2430 (ComponentBase.defineElement): Defines a custom element that can be automatically instantiated from htmlTemplate.
2431 (ComponentBase.createElement): A helper function to create DOM tree to be used in "render()" method.
2432 (ComponentBase._addContentToElement): A helper for "createElement".
2433 (ComponentBase.createLink): A helper function to create a hyperlink or another clickable element (via callback).
2434 (ComponentBase.createActionHandler): A helper function to create an event listener that prevents the default action
2435 and stops the event propagation.
2437 * public/v3/components/button-base.js: Added.
2439 * public/v3/components/chart-status-view.js: Added.
2440 (ChartStatusView): A component that reports the current status of time-series-chart. It's subclasses by
2441 ChartPaneStatusView to provide additional information in the charts page's panes.
2443 * public/v3/components/close-button.js: Added.
2445 * public/v3/components/commit-log-viewer.js: Added.
2446 (CommitLogViewer): A component that lists commit revisions along with commit messages for a range of data points.
2448 * public/v3/components/interactive-time-series-chart.js: Added.
2449 (InteractiveTimeSeriesChart): A subclass of InteractiveTimeSeriesChart with interactivity (selection & indicator).
2450 Selection and indicator are mutually exclusive.
2452 * public/v3/components/pane-selector.js: Added.
2453 (PaneSelector): A component for selecting (platform, metric) pair to add in the charts page.
2455 * public/v3/components/spinner-icon.js: Added.
2457 * public/v3/components/time-series-chart.js: Added.
2458 (TimeSeriesChart): A canvas-based chart component without interactivity. It takes a source list and options as
2459 the constructor arguments. A source list is a list of measurement sets (measurement-set.js) with drawing options.
2460 This component fetches data via MeasurementSet.fetchBetween inside TimeSeriesChart.prototype.setDomain and
2461 progressively updates the charts as more data arrives. The canvas is updated on animation frame via rAF and all
2462 layout and rendering metrics are lazily computed in _layout. In addition, this component samples data before
2463 rendering the chart when there are more data points per pixel in _ensureSampledTimeSeries.
2465 * public/v3/index.html: Added. Loads bundled-scripts.js if it exists, or individual script files otherwise.
2467 * public/v3/instrumentation.js: Added. This class is used to gather runtime statistics of v3 UI. (It measures
2468 the performance of the perf dashboard UI).
2470 * public/v3/main.js: Added. Bootstraps the app.
2474 * public/v3/models: Added.
2475 * public/v3/models/analysis-task.js: Added.
2476 * public/v3/models/bug-tracker.js: Added.
2477 * public/v3/models/bug.js: Added.
2478 * public/v3/models/builder.js: Added.
2479 * public/v3/models/commit-log.js: Added.
2480 * public/v3/models/data-model.js: Added.
2481 (DataModelObject): The base class for various data objects that correspond to database tables. It supplies static
2482 hash map to find entries by id as well as other keys.
2483 (LabeledObject): A subclass of DataModelObject with the capability to find an object via its name.
2485 * public/v3/models/measurement-cluster.js: Added.
2486 (MeasurementCluster): Represents a single cluster or a chunk of data in a measurement set.
2488 * public/v3/models/measurement-set.js: Added.
2489 (MeasurementSet): Represents a measurement set.
2490 (MeasurementSet.findSet): Returns the singleton set given (metric, platform). We use singleton to avoid issuing
2491 multiple HTTP requests for the same JSON when there are multiple TimeSeriesChart that show the same graph (e.g. on
2492 charts page with overview and main charts).
2493 (MeasurementSet.prototype.findClusters): Finds the list of clusters to fetch in a given time range.
2494 (MeasurementSet.prototype.fetchBetween): Fetch clusters for a given time range and calls callback whenever new data
2495 arrives. The number of callbacks depends on the how many clusters need to be newly fetched.
2496 (MeasurementSet.prototype._fetchSecondaryClusters): Fetches non-primary (non-latest) clusters.
2497 (MeasurementSet.prototype._fetch): Issues a HTTP request to fetch a cluster.
2498 (MeasurementSet.prototype._didFetchJSON): Called when a cluster is fetched.
2499 (MeasurementSet.prototype._failedToFetchJSON): Called when the fetching of a cluster has failed.
2500 (MeasurementSet.prototype._invokeCallbacks): Invokes callbacks upon an approval of a new cluster.
2501 (MeasurementSet.prototype._addFetchedCluster): Adds the newly fetched cluster in the order.
2502 (MeasurementSet.prototype.fetchedTimeSeries): Returns a time series that contains data from all clusters that have
2504 (TimeSeries.prototype.findById): Additions to TimeSeries defined in /v2/data.js.
2505 (TimeSeries.prototype.dataBetweenPoints): Ditto.
2506 (TimeSeries.prototype.firstPoint): Ditto.
2508 * public/v3/models/metric.js: Added.
2509 * public/v3/models/platform.js: Added.
2510 * public/v3/models/repository.js: Added.
2511 * public/v3/models/test.js: Added.
2513 * public/v3/pages: Added.
2514 * public/v3/pages/analysis-category-page.js: Added. The "Analysis" page that lists the analysis tasks.
2515 * public/v3/pages/analysis-category-toolbar.js: Added. The toolbar to filter analysis tasks based on its category
2516 (unconfirmed, bisecting, identified, closed) and a keyword.
2518 * public/v3/pages/analysis-task-page.js: Added. Not implemented yet. It just has the hyperlink to the v2 UI.
2520 * public/v3/pages/chart-pane-status-view.js: Added.
2521 (ChartPaneStatusView): A subclass of ChartStatusView used in the charts page. In addition to the current value,
2522 comparison to baseline/target, it shows the list of repository revisions (e.g. WebKit revision, OS version).
2524 * public/v3/pages/chart-pane.js: Added.
2525 (ChartPane): A component a pane in the charts page. Each pane has the overview chart and the main chart. The zooming
2526 is synced across all panes in the charts page.
2528 * public/v3/pages/charts-page.js: Added. Charts page.
2529 * public/v3/pages/charts-toolbar.js: Added. The toolbar to set the number of days to show. This affects the overview
2530 chart's domain in each pane.
2532 * public/v3/pages/create-analysis-task-page.js: Added.
2533 (CreateAnalysisTaskPage): A page that gets shown momentarily while creating a new analysis task.
2535 * public/v3/pages/dashboard-page.js: Added. A dashboard page.
2536 * public/v3/pages/dashboard-toolbar.js: Added. Its toolbar with buttons to select the number of days to show.
2537 * public/v3/pages/domain-control-toolbar.js: Added. An abstract superclass of charts and dashboard toolbars.
2539 * public/v3/pages/heading.js: Added. A component for displaying the header and toolbar, if exists, on each page.
2540 * public/v3/pages/page-router.js: Added. This class is responsible for updating the URL hashes as well as opening
2541 and updating each page when the hash changes (via back/forward navigation).
2542 * public/v3/pages/page-with-charts.js: Added. An abstract subclass of page used by dashboards and charts page.
2543 Supplies helper functions for creating TimeSeriesChart options.
2544 * public/v3/pages/page-with-heading.js: Added. An abstract subclass of page that uses the heading component.
2545 * public/v3/pages/page.js: Added. The Page component.
2546 * public/v3/pages/toolbar.js: Added. An abstract toolbar component.
2548 * public/v3/remote.js: Added.
2549 (getJSON): Fetches JSON from the remote server.
2550 (getJSONWithStatus): Ditto. Rejects the response if the status is not "OK".
2551 (PrivilegedAPI.sendRequest): Posts a HTTP request to a privileged API in /privileged-api/.
2552 (PrivilegedAPI.requestCSRFToken): Creates a new CSRF token to request a privileged API post.
2554 * tools/bundle-v3-scripts.py: Added.
2555 (main): Bundles js files together and minifies them by jsmin.py for the v3 UI. Without this script, we're forced to
2556 download 44 JS files or making each JS file contain multiple classes.
2558 * tools/jsmin.py: Copied from WebInspector / JavaScriptCore code.
2560 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2562 Fix v2 UI after r194093.
2564 * public/v2/data.js:
2566 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2568 Add /api/measurement-set for v3 UI
2569 https://bugs.webkit.org/show_bug.cgi?id=152312
2571 Rubber-stamped by Chris Dumez.
2573 The new API JSON allows the front end to fetch measured data in chunks called a "cluster" as specified
2574 in config.json for each measurement set specified by the pair of a platform and a metric.
2576 When the front end needs measured data in a given time range (t_0, t_1) for a measurement set, it first
2577 fetches the primary cluster by /api/measurement-set/?platform=<platform-id>&metric=<metric-id>.
2578 The primary cluster is the last cluster in the set (returning the first cluster here is not useful
2579 since we don't typically show very old data), and provides the information needed to fetch other clusters.
2581 Fetching the primary cluster also creates JSON files at:
2582 /data/measurement-set-<platform-id>-<metric-id>-<cluster-end-time>.json
2583 to allow latency free access for secondary clusters. The front end code can also fetch the cache of
2584 the primary cluster at: /data/measurement-set-<platform-id>-<metric-id>.json.
2586 Because the front end code has to behave as if all data is fetched, each cluster contains one data point
2587 immediately before the first data point and one immediately after the last data point. This avoids having
2588 to fetch multiple empty clusters for manually specified baseline data. To support this behavior, we generate
2589 all clusters for a given measurement set at once when the primary cluster is requested.
2591 Furthermore, all measurement sets are divided at the same time into clusters so that the boundary of clusters
2592 won't shift as more data are reported to the server.
2594 * config.json: Added clusterStart and clusterSize as options.
2595 * public/api/measurement-set.php: Added.
2597 (MeasurementSetFetcher::__construct):
2598 (MeasurementSetFetcher::fetch_config_list): Finds configurations that belongs to this (platform, metric) pair.
2599 (MeasurementSetFetcher::at_end): Returns true if we've reached the end of all clusters for this set.
2600 (MeasurementSetFetcher::fetch_next_cluster): Generates the JSON data for the next cluster. We generate clusters
2601 in increasing chronological order (the oldest first and the newest last).
2602 (MeasurementSetFetcher::execute_query): Executes the main query.
2603 (MeasurementSetFetcher::format_map): Returns the mapping of a measurement field to an array index. This removes
2604 the need to have key names for each measurement and reduces the JSON size by ~10%.
2605 (MeasurementSetFetcher::format_run): Creates an array that contains data for a single measurement. The order
2606 matches that of keys in format_map.
2607 (MeasurementSetFetcher::parse_revisions_array): Added. Copied from runs.php.
2608 * tests/api-measurement-set.js: Added. Added tests for /api/measurement-set.
2610 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2612 Using fake timestamp in OS version make some results invisible
2613 https://bugs.webkit.org/show_bug.cgi?id=152289
2615 Reviewed by Stephanie Lewis.
2617 Fix various bugs after r194088.
2619 * public/api/commits.php:
2620 (format_commit): Include the commit order.
2621 * public/v2/data.js:
2622 (CommitLogs._cacheConsecutiveCommits): Sort by commit order when commit time is missing.
2623 * tools/pull-os-versions.py:
2624 (OSBuildFetcher._assign_order): Use integer instead of fake time for commit order.
2625 (available_builds_from_command): Exit early when an exception is thrown.
2627 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2629 Fix a typo in the previous commit.
2631 * public/include/report-processor.php:
2633 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2635 Build fix after r192965. Suppress a warning about log being referred to as a closure variable.
2637 * public/include/report-processor.php:
2639 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2641 Using fake timestamp in OS version make some results invisible
2642 https://bugs.webkit.org/show_bug.cgi?id=152289
2644 Reviewed by Stephanie Lewis.
2646 Added commit_order column to explicitly order OS versions. This fixes the bug whereby which
2647 baseline results reported with only OS versions are shown with x coordinate set to 10 years ago.
2649 To migrate the existing database, run:
2650 ALTER TABLE commits ADD COLUMN commit_order integer;
2651 CREATE INDEX commit_order_index ON commits(commit_order);
2653 Then for each repository $1,
2654 UPDATE commits SET (commit_time, commit_order) = (NULL, CAST(EXTRACT(epoch from commit_time) as integer))
2655 WHERE commit_repository = $1;
2658 * init-database.sql: Added the column.
2659 * public/api/commits.php:
2660 (fetch_commits_between): Use commit_order to order commits when commit_time is missing.
2661 * public/api/report-commits.php:
2662 (main): Set commit_order.
2663 * tools/pull-os-versions.py:
2664 (OSBuildFetcher.fetch_and_report_new_builds):
2665 (OSBuildFetcher._assign_order): Renamed from _assign_fake_timestamps. Set the order instead of a fake timestmap.
2667 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2669 Perf dashboard can't merge when the destination platform is missing baseline/target
2670 https://bugs.webkit.org/show_bug.cgi?id=152286
2672 Reviewed by Stephanie Lewis.
2674 The bug was caused by the query to migrate test configurations to new platform checking
2675 configuration type and metric separately; that is, it assumes the configuration exists
2676 only if either the same type or the same metric exists in the destination.
2678 Fixed the bug by checking both conditions simultaneously for each configuration.
2680 * public/admin/platforms.php:
2681 * tests/admin-platforms.js: Added a test.
2683 2015-12-11 Ryosuke Niwa <rniwa@webkit.org>
2685 Perf dashboard's buildbot sync config JSON duplicates too much information
2686 https://bugs.webkit.org/show_bug.cgi?id=152196
2688 Reviewed by Stephanie Lewis.
2690 Added shared, per-builder, and per-test (called type) configurations.
2692 * tools/sync-with-buildbot.py:
2694 (load_config.merge):
2696 2015-12-02 Ryosuke Niwa <rniwa@webkit.org>
2698 Perf dashboard should avoid overflow during geometric mean computation
2699 https://bugs.webkit.org/show_bug.cgi?id=151773
2701 Reviewed by Chris Dumez.
2703 * public/include/report-processor.php:
2705 2015-11-30 Ryosuke Niwa <rniwa@webkit.org>
2707 Perf dashboard should extend baseline and target to the future
2708 https://bugs.webkit.org/show_bug.cgi?id=151511
2710 Reviewed by Darin Adler.
2712 * public/v2/data.js:
2713 (RunsData.prototype.timeSeriesByCommitTime): Added extendToFuture as an argument.
2714 (RunsData.prototype.timeSeriesByBuildTime): Ditto.
2715 (RunsData.prototype._timeSeriesByTimeInternal): Ditto.
2716 (TimeSeries): Add a new point to the end if extendToFuture is set and the series is not empty.
2717 * public/v2/manifest.js:
2718 (App.Manifest._formatFetchedData): Set extendToFuture to true for baselines and targets.
2720 2015-11-30 Ryosuke Niwa <rniwa@webkit.org>
2722 Perf dashboard should always show comparison to baseline and target even if one is missing
2723 https://bugs.webkit.org/show_bug.cgi?id=151510
2725 Reviewed by Darin Adler.
2727 Show the comparison status against the baseline when baseline is present but target is missing.
2729 To make the code more readable, this patch splits the logic into three cases:
2730 1. Both baseline and target are present
2731 2. Only baseline is present
2732 3. Only target is present
2734 Also extracted a helper function to construct the label.
2737 (.labelForDiff): Added.
2738 (App.Pane.computeStatus):
2740 2015-11-23 Commit Queue <commit-queue@webkit.org>
2742 Unreviewed, rolling out r192716 and r192717.
2743 https://bugs.webkit.org/show_bug.cgi?id=151582
2745 The patch was incorrect. We always need at least one data
2746 point in each configuration (Requested by rniwa on #webkit).
2748 Reverted changesets:
2750 "Perf dashboard's should not include results more than 366
2752 https://bugs.webkit.org/show_bug.cgi?id=151529
2753 http://trac.webkit.org/changeset/192716
2755 "Build fix for old version of PHP."
2756 http://trac.webkit.org/changeset/192717
2758 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
2760 Build fix for old version of PHP.
2762 * public/api/runs.php:
2764 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
2766 Perf dashboard's should not include results more than 366 days old in JSON
2767 https://bugs.webkit.org/show_bug.cgi?id=151529
2769 Reviewed by Timothy Hatcher.
2771 Don't return results more than 366 days old in /api/runs/ JSON API.
2772 This is a ~5% runtime improvement and reduces the JSON file size by 20-50% in the internal perf dashboard.
2774 * public/api/runs.php:
2775 (main): Added the support for "?noResults" to avoid echoing results. This is useful for debugging.
2776 Also instantiate RunsGenerator before issuing the query to find all configurations so that the runtime cost
2777 of doing so will be included in elapsedTime.
2778 (RunsGenerator::fetch_runs): Skip a row when its build and commit times are more than 366 days old.
2779 (RunsGenerator::format_run): Takes build_time and revisions as arguments since fetch_runs uses them now.
2780 (RunsGenerator::parse_revisions_array): Compute the max of commit times.
2782 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
2784 Remove chartPointRadius from interactive chart component
2785 https://bugs.webkit.org/show_bug.cgi?id=151480
2787 Reviewed by Darin Adler.
2789 Replaced the parameter by CSS rules.
2791 * public/v2/chart-pane.css:
2793 (.chart .dot.foreground):
2794 (.chart .highlight):
2796 * public/v2/index.html:
2797 * public/v2/interactive-chart.js:
2798 (App.InteractiveChartComponent.Ember.Component.extend._constructGraphIfPossible):
2799 (App.InteractiveChartComponent.Ember.Component.extend._highlightedItemsChanged):
2801 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
2803 Perf dashboard's runs API uses more than 128MB of memory
2804 https://bugs.webkit.org/show_bug.cgi?id=151478
2806 Reviewed by Andreas Kling.
2808 Don't fetch all query results at once to avoid using twice as much memory as needed.
2809 Use iterative API to format each result at a time.
2811 This change is also a 5% runtime performance gain.
2813 * public/api/runs.php:
2814 (RunsGenerator::__construct): Takes a Database instance instead of a list of configurations. The latter is
2815 no longer needed as we pass in each configuration type explicitly to fetch_runs.
2816 (RunsGenerator::fetch_runs): Renamed from add_runs since it now executes the database query via execute_query.
2817 Also moved the logic to compute the last modified time here.
2818 (RunsGenerator::execute_query): Moved from fetch_runs_for_config. Use Database::query instead of query_and_fetch_all.
2819 (RunsGeneratorForTestGroup):
2820 (RunsGeneratorForTestGroup::__construct):
2821 (RunsGeneratorForTestGroup::execute_query): Moved from fetch_runs_for_config_and_test_group.
2823 * public/include/db.php:
2824 (generate_data_file): Lock the file to avoid corruption.
2826 2015-11-19 Ryosuke Niwa <rniwa@webkit.org>
2828 Perf dashboard always fetches charts JSON twice
2829 https://bugs.webkit.org/show_bug.cgi?id=151483
2831 Reviewed by Andreas Kling.
2833 Only re-generate "runs" JSON via /api/runs/ when the cache doesn't exist in /data/ or the cached JSON is
2834 obsolete (shouldRefetch is set true) or corrupt (the second closure).
2839 2015-11-18 Ryosuke Niwa <rniwa@webkit.org>
2841 Internal perf dashboard takes forever to load
2842 https://bugs.webkit.org/show_bug.cgi?id=151430
2844 Rubber-stamped by Antti Koivisto.
2846 Fix a few performance problems with the perf dashboard v2 UI.
2849 (App.DashboardRow._createPane): Set "inDashboard" to true.
2850 (App.Pane._fetch): Immediately show the cached chart instead of waiting for the refetched data which invokes
2851 a PHP JSON API. Also don't fetch the analysis tasks when the chart is shown in the dashboard since we don't
2852 show annotate charts in the dashboard.
2854 2015-10-15 Ryosuke Niwa <rniwa@webkit.org>
2856 Unreviewed fix of a test after r190687.
2858 * tests/admin-regenerate-manifest.js:
2860 2015-10-12 Ryosuke Niwa <rniwa@webkit.org>
2862 Perf dashboard tools shouldn't require server credentials in multiple configuration files
2863 https://bugs.webkit.org/show_bug.cgi?id=149994
2865 Reviewed by Chris Dumez.
2867 Made detect-changes.js and pull-svn.py pull username and passwords from the server config JSON to reduce
2868 the number of JSON files that need to include credentials.
2870 Also made each script reload the server config after sleep to allow dynamic credential updates.
2872 In addition, change the server config JSON's format to include scheme, host, and port numbers separately
2873 instead of a url since detect-changes.js needs each value separately.
2875 This reduces the number of JSONs with credentials to two for our internal dashboard.
2877 * tools/detect-changes.js:
2878 (main): Added a property argument parsing. Now takes --server-config-json, --change-detection-config-json,
2879 and --seconds-to-sleep like other scripts.
2880 (parseArgument): Added.
2881 (fetchManifestAndAnalyzeData): Reload the server config JSON.
2882 (loadServerConfig): Added. Set settings.perfserver and settings.slave from the server config JSON. Also
2883 add settings.perfserver.host to match the old format.
2884 (configurationsForTesting): Fixed a bug that we throw an exception when a dashboard contains an empty cell.
2886 * tools/pull-os-versions.py:
2887 (main): Use load_server_config after each sleep.
2889 * tools/pull-svn.py:
2890 (main): Use load_server_config after each sleep.
2891 (fetch_commits_and_submit): Use the perf dashboard's auth as subversion credential when useServerAuth is set.
2893 * tools/sync-with-buildbot.py:
2894 (main): Use load_server_config after each sleep.
2897 (load_server_config): Extracted from python scripts. Computes server's url from scheme, host, and port number
2898 to match the old format python scripts except.
2900 2015-10-11 Ryosuke Niwa <rniwa@webkit.org>
2902 Build fix after r190817. Now that pull-os-versions store fake timestamps, we need to bypass timestamp
2903 checks for OS versions when bots try to report new results. Otherwise, we fail to process the reports
2904 with a MismatchingCommitTime error.
2906 * public/include/report-processor.php:
2907 (ReportProcessor::resolve_build_id):
2909 2015-10-08 Ryosuke Niwa <rniwa@webkit.org>
2911 Perf dashboard erroneously shows an old OS build in A/B testing range
2912 https://bugs.webkit.org/show_bug.cgi?id=149942
2914 Reviewed by Darin Adler.
2916 Ordering OS builds lexicologically turned out be a bad idea since 15A25 falls between 15A242 and 15A251.
2917 Use a fake/synthetic timestamp to force the commonly understood total order instead.
2919 Refactored pull-os-versions.py to share the server config JSON with other scripts. Also made the script
2920 support pulling multiple sources; e.g. both OS X and iOS.
2922 Also removed superfluous feature to submit results in chunks. The perf dashboard can handle thousands of
2923 revisions being submitted at once just fine.
2925 * public/api/commits.php:
2926 (main): A partial revert of r185574 since we no longer need to order builds lexicologically.
2928 * tools/pull-os-versions.py:
2929 (main): Takes --os-config-json, --server-config-json, and --seconds-to-sleep as arguments instead of
2930 a single --config argument to share the server config JSON with other scripts.
2931 (OSBuildFetcher): Extracted out of main. This class is instantiated for each OS kind (e.g. OS X).
2932 (OSBuildFetcher.__init__): Added.
2933 (OSBuildFetcher._fetch_available_builds): Extracted out of main. Fetches available builds from a website
2935 (OSBuildFetcher.fetch_and_report_new_builds): Extracted out of main. Submits the fetched builds after
2936 filtering out the ones we've already reported.
2937 (OSBuildFetcher._assign_fake_timestamps): Creates a fake timestamp to establish a total order amongst each
2938 OS X / iOS style build number such as 12A3456b.
2940 2015-10-08 Ryosuke Niwa <rniwa@webkit.org>
2942 pull-svn.py fails to sync revisions when SVN credentials is not setup
2943 https://bugs.webkit.org/show_bug.cgi?id=149941
2945 Reviewed by Chris Dumez.
2947 Added the support for specifying subversion credentials.
2949 Also added the support for pulling from multiple subversion servers. Subversion servers are specified
2950 in a JSON configuration file specified by --svn-config formatted as follows:
2955 "url": "http://svn.webkit.org/repository/webkit",
2956 "username": "webkitten",
2957 "password": "webkitten's password",
2958 "trustCertificate": true,
2959 "accountNameFinderScript":
2960 ["python", "/Volumes/Data/WebKit/Tools/Scripts/webkit-patch", "find-users"]
2965 In addition, refactored it to use the shared server config JSON for the dashboard access.
2967 * tools/pull-svn.py:
2968 (main): Now takes --svn-config-json, --server-config-json, --seconds-to-sleep and --max-fetch-count
2969 as required options instead of seven unnamed arguments.
2970 (fetch_commits_and_submit): Extracted from main. Fetches at most max_fetch_count new revisions from
2971 the subversion server, and submits them in accordance with server_config.
2972 (fetch_commit_and_resolve_author): Now takes a single repository dictionary instead of two separate
2973 arguments for name and URL to pass down the repository's authentication info to fetch_commit.
2974 (fetch_commit): Ditto. Add appropriate arguments when username and passwords are specified.
2975 (resolve_author_name_from_account): Use a list argument instead of a single string argument now that
2976 the argument comes from a JSON instead of sys.argv.
2978 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
2980 Unreviewed race condition fix. Exit early when xScale or yScale is not defined.
2982 * public/v2/interactive-chart.js:
2983 (App.InteractiveChartComponent._updateRangeBarRects):
2985 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
2987 Add a page that cycles through v2 dashboards
2988 https://bugs.webkit.org/show_bug.cgi?id=149907
2990 Reviewed by Chris Dumez.
2992 Add cycler.html that goes through each dashboard on v2 UI.
2994 This allows the dashboards to be cycled through on a TV screen.
2996 * public/cycler.html: Added.
2997 (loadURLAt): Appends a new iframe to load the next URL (i is the index of the dashboard to be shown)
2998 at the end of body. We don't immediately show the new iframe since it might take a while to load.
2999 (showNewFrameIfLoaded): Remove the current iframe and show the next iframe if the next dashboard has
3000 finished loading. We can't rely on DOMContentLoaded or load events because we use asynchronous XHR to
3001 load each chart's data. Instead, wait until some chart becomes available or fails to load and none of
3002 charts are still in progress to be shown.
3004 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3006 Allow custom revisions to be specified in A/B testing
3007 https://bugs.webkit.org/show_bug.cgi?id=149905
3009 Reviewed by Chris Dumez.
3011 Allow custom revision number on each "repository" when creating a test group.
3013 * public/v2/app.css:
3014 (form .analysis-group [name=customValue]): Added.
3017 (App.AnalysisTaskController._createConfiguration): Added "Custom" as a revision option.
3018 Also added point labels such as (point 3) on "None" for when some points are missing revision info.
3019 (App.AnalysisTaskController._labelForPoints): Extracted from _createConfiguration.
3020 (App.AnalysisTaskController.actions.createTestGroup): Respect the custom revision number when custom
3021 revision option is selected.
3023 * public/v2/index.html: Added a text field for specifying a custom revision number.
3025 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3027 Make the site name configurable in perf dashboard
3028 https://bugs.webkit.org/show_bug.cgi?id=149894
3030 Reviewed by Chris Dumez.
3032 Added "siteTitle" as a new configuration key to specify the site name.
3034 * public/include/db.php:
3035 (config): Now takes the default value as an argument.
3036 * public/include/manifest.php:
3037 (ManifestGenerator::generate): Include siteTitle in the manifest.
3038 * public/index.html: Update the title and the heading when the manifest is loaded.
3039 * public/v2/index.html: Use App.Manifest.siteTitle as the heading. document.title needs to be updated manually.
3040 * public/v2/manifest.js:
3041 (App.MetricSerializer.normalizePayload): Update document.title and App.Manifest.siteTitle.
3043 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3045 Perf dashboard doesn't show analysis tasks anchored at outliers
3046 https://bugs.webkit.org/show_bug.cgi?id=149870
3048 Reviewed by Chris Dumez.
3050 The bug was caused by the computation of start and end times of analysis tasks being dependent on
3051 time series provided to the interactive chart component even though they are already filtered.
3053 Since the interactive chart component shouldn't be messing with the underlying data models, moved
3054 the code to compute start and end times to App.Pane, to where it belongs, and made the moved code use
3055 the unfiltered time series newly exposed on ChartData.
3057 Also fixed a bug in fetch-from-remote.php which resulted in Ember endlessly fetching same JSON files.
3059 * public/admin/fetch-from-remote.php:
3060 (.): Use the full request URI for HTTP requests and caching. Otherwise, we're going to mix up caches
3061 and Ember can start hanging browsers (took me three hours to debug this).
3064 (App.Pane._showOutlierChanged): Added. Resets chartData when showOutlier flag has been changed.
3065 (App.Pane.fetchAnalyticRanges): The old code wasn't filtering analysis tasks by platforms and metrics
3066 at all since it relied on the server-side REST API to do the filtering, which I haven't implemented yet.
3067 Filter the results manually instead.
3068 (App.Pane.ranges): Moved the logic to compute startTime and endTime here from InteractiveChartComponent.
3069 (App.PaneController.toggleShowOutlier): Now that App.Pane responds to showOutlier changes, we don't
3070 need to call a private method on it.
3071 (App.AnalysisTaskController._chartDataChanged): When end points are not found, try showing outliers.
3072 This will cause chartData to be modified so just exit early and wait for getting called again.
3074 * public/v2/interactive-chart.js:
3075 (App.InteractiveChartComponent._rangesChanged): The code to compute start and end time has been moved
3078 * public/v2/manifest.js:
3079 (App.Manifest._formatFetchedData): Added unfiltered time series as new properties as they are now used
3080 to compute the end points of analysis tasks when their end points are outliers.
3082 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3084 Unreviewed. Fix a typo in r190645.
3086 * public/include/db.php:
3088 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3090 V2 UI shouldn't sort dashboards lexicologically
3091 https://bugs.webkit.org/show_bug.cgi?id=149856
3093 Reviewed by Chris Dumez.
3095 Don't sort the dashboards by name in App.Manifest.
3098 (App.IndexRoute.beforeModel): Don't transition to "undefined" (string) dashboard.
3099 * public/v2/manifest.js:
3100 (App.Manifest.._fetchedManifest):
3102 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3104 V2 UI fails to show the data for the very first point in charts
3105 https://bugs.webkit.org/show_bug.cgi?id=149857
3107 Reviewed by Chris Dumez.
3109 The bug was caused by seriesBetweenPoints returning null for when point.seriesIndex is 0.
3110 Explicitly check the type of this property instead.
3112 * public/v2/data.js:
3113 (TimeSeries.prototype.seriesBetweenPoints):
3115 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3117 Perf dashboard should have the capability to test local UI with production data
3118 https://bugs.webkit.org/show_bug.cgi?id=149834
3120 Reviewed by Chris Dumez.
3122 Added tools/run-with-remote-server.py which runs a local httpd server and pulls data from a remote server.
3124 * Install.md: Added the instruction on how to use the script. Also updated the remaining instructions
3126 * config.json: Added remote server configurations.
3127 * public/admin/fetch-from-remote.php: Added. This script fetches JSON from the remote server specified in
3128 config.json and caches the results in the location specified as "cacheDirectory" in config.json.
3131 * public/include/db.php:
3132 (config_path): Extracted from generate_data_file.
3133 (generate_data_file):
3134 * tools/remote-server-relay.conf: Added. Apache 2.4 configuration file for a local http server launched by
3135 run-with-remote-server.py.
3136 * tools/run-with-remote-server.py: Added. Launches Apache with the right set of directives.
3138 (abspath_from_root):
3140 2015-07-13 Ryosuke Niwa <rniwa@webkit.org>
3144 * public/js/helper-classes.js:
3146 2015-06-27 Ryosuke Niwa <rniwa@webkit.org>
3148 build-requests should use conform to JSON API format
3149 https://bugs.webkit.org/show_bug.cgi?id=146375
3151 Reviewed by Stephanie Lewis.
3153 Instead of returning single dictionary that maps root set id to a dictionary of repository names
3154 to revisions, timestamps, simply return root sets and roots "rows" or "objects" as defined in
3155 JSON API (http://jsonapi.org/). This API change makes it easier to resolve the bug 146374 and
3156 matches what we do in /api/test-groups.
3158 Also add the support for /api/build-requests/?id=<id> to fetch the build request with <id>.
3159 This is useful for debugging purposes.
3161 * public/api/build-requests.php:
3162 (main): Added the support for $_GET['id']. Also return "rootSets" and "roots".
3163 (update_builds): Extracted from main.
3165 * public/include/build-requests-fetcher.php:
3166 (BuildRequestFetcher::fetch_request): Added. Used for /api/build-requests/?id=<id>.
3167 (BuildRequestFetcher::results_internal): Always call fetch_roots_for_set_if_needed.
3168 (BuildRequestFetcher::fetch_roots_for_set_if_needed): Renamed from fetch_roots_for_set.
3169 Moved the logic to exit early when the root set had already been fetched here.
3171 * public/v2/analysis.js:
3172 (App.TestGroup._fetchTestResults): Fixed the bug that test groups without any successful results
3175 * tools/pull-os-versions.py:
3177 (setup_auth): Moved to util.py
3179 * tools/sync-with-buildbot.py:
3180 (main): Replaced a bunch of perf dashboard related options by --server-config-json.
3181 (update_and_fetch_build_requests): No longer takes build_request_auth since that's now taken care
3183 (organize_root_sets_by_id_and_repository_names): Added. Builds the old rootsSets directory based
3184 on "roots" and "rootSets" dictionaries returned by /api/build-requests.
3185 (config_for_request): Fixed a bug that the script blows up when the build request is missing
3186 the repository specified in the configuration. This tolerance is necessary when a new repository
3187 dependency is added but we want to run A/B tests for old builds without the dependency.
3188 (fetch_json): No longer takes auth.
3191 (setup_auth): Moved from pull-os-versions.py to be shared with sync-with-buildbot.py.
3193 2015-06-23 Ryosuke Niwa <rniwa@webkit.org>
3195 Build fix. A/B testing is broken when continuous builders report revisions out of order.
3198 (App.AnalysisTaskController.Ember.Controller.extend.):
3200 2015-06-22 Ryosuke Niwa <rniwa@webkit.org>