1 2014-10-18 Ryosuke Niwa <rniwa@webkit.org>
3 Perf dashboard should provide a way to associate bugs with a test run
4 https://bugs.webkit.org/show_bug.cgi?id=137857
6 Reviewed by Andreas Kling.
8 Added a "privileged" API, /privileged-api/associate-bug, to associate a bug with a test run.
9 /privileged-api/ is to be protected by an authentication mechanism such as DigestAuth over https by
10 the Apache configuration.
13 The Cross Site Request (CSRF) Forgery prevention for privileged APIs work as follows. When a user is
14 about to make a privileged API access, the front end code obtains a CSRF token generated by POST'ing
15 to privileged-api/generate-csrf-token; the page sets a randomly generated salt and an expiration time
16 via the cookie and returns a token computed from those two values as well as the remote username.
18 The font end code then POST's the request along with the returned token. The server side code verifies
19 that the specified token can be generated from the salt and the expiration time set in the cookie, and
20 the token hasn't expired.
23 * init-database.sql: Added bug_url to bug_trackers table, and added bugs table. Each bug tracker will
24 have zero or exactly one bug associated with a test run.
26 * public/admin/bug-trackers.php: Added the support for editing bug_url.
27 * public/api/runs.php:
28 (fetch_runs_for_config): Modified the query to fetch bugs associated with test_runs.
29 (parse_bugs_array): Added. Parses the aggregated bugs and creates a dictionary that maps a tracker id to
30 an associated bug if there is one.
31 (format_run): Calls parse_bugs_array.
33 * public/include/json-header.php: Added helper functions to deal for CSRF prevention.
34 (ensure_privileged_api_data): Added. Dies immediately if the request's method is not POST or doesn't
35 have a valid JSON payload.
36 (ensure_privileged_api_data_and_token): Ditto. Also checks that the CSRF prevention token is valid.
37 (compute_token): Computes a CSRF token using the REMOTE_USER (e.g. set via BasicAuth), the salt, and
38 the expiration time stored in the cookie.
39 (verify_token): Returns true iff the specified token matches what compute_token returns from the cookie.
41 * public/include/manifest.php:
42 (ManifestGenerator::bug_trackers): Include bug_url as bugUrl in the manifest. Also use tracker_id instead
43 of tracker_name as the key in the manifest. This requires changes to both v1 and v2 front end.
46 (Chart..showTooltipWithResults): Updated for the manifest format changed mentioned above.
48 * public/privileged-api/associate-bug.php: Added.
49 (main): Added. Associates or dissociates a bug with a test run inside a transaction. It prevent a CSRF
50 attack via ensure_privileged_api_data_and_token, which calls verify_token.
52 * public/privileged-api/generate-csrf-token.php: Added. Generates a CSRF token valid for one hour.
55 (.disabled .icon-button:hover g): Used by the "bugs" icon when a range of points or no points are
59 (App.PaneController.actions.toggleBugsPane): Added. Toggles the visibility of the bugs pane when exactly
60 one point is selected in the chart. Also hides the search pane when making the bugs pane visible since
61 they would overlap on each other if both of them are shown.
62 (App.PaneController.actions.associateBug): Makes a privileged API request to associate the specified bug
63 with the currently selected point (test run). Updates the bug information in "details" and colors of dots
64 in the charts to reflect new states. Because chart data objects aren't real Ember objects for performance
65 reasons, we have to use a dirty hack of modifying a dummy counter bugsChangeCount.
66 (App.PaneController.actions.toggleSearchPane): Renamed from toggleSearch. Also hides the bugs pane when
67 showing the search pane.
68 (App.PaneController.actions.rangeChanged): Takes all selected points as the second argument instead of
69 taking start and end points as the second and the third arguments so that _showDetails can enumerate all
70 bugs in the selected range.
72 (App.PaneController._detailsChanged): Added. Hide the bugs pane whenever a new point is selected.
73 Also update singlySelectedPoint, which is used by toggleBugsPane and associateBug.
74 (App.PaneController._currentItemChanged): Updated for the _showDetails change.
75 (App.PaneController._showDetails): Takes an array of selected points in place of old arguments.
76 Simplified the code to compute the revision information. Calls _updateBugs to format the associated bugs.
77 (App.PaneController._updateBugs): Sets details.bugTrackers to a dictionary that maps a bug tracker id to
78 a bug tracker proxy with an array of (bugNumber, bugUrl) pairs and also editedBugNumber, which is used by
79 the bugs pane to associate or dissociate a bug number, if exactly one point is selected.
81 (App.InteractiveChartComponent._updateDotsWithBugs): Added. Sets hasBugs class on dots as needed.
82 (App.InteractiveChartComponent._setCurrentSelection): Finds and passes all points in the selected range
83 to selectionChanged action instead of just finding the first and the last points.
85 * public/v2/chart-pane.css: Updated the style.
88 (PrivilegedAPI): Added. A wrapper for privileged APIs' CSRF tokens.
89 (PrivilegedAPI.sendRequest): Makes a privileged API call. Fetches a new CSRF token if needed.
90 (PrivilegedAPI._generateTokenInServerIfNeeded): Makes a request to privileged-api/generate-csrf-token if
91 we haven't already obtained a CSRF token or if the token has already been expired.
92 (PrivilegedAPI._post): Makes a single POST request to /privileged-api/* with a JSON payload.
94 (Measurement.prototype.bugs): Added.
95 (Measurement.prototype.hasBugs): Returns true iff bugs has more than one bug number.
96 (Measurement.prototype.associateBug): Associates a bug with a test run via privileged-api/associate-bug.
98 * public/v2/index.html: Added the bugs pane. Also added a list of bugs associated with the current run in
101 * public/v2/manifest.js:
102 (App.BugTracker.bugUrl):
103 (App.BugTracker.newBugUrl): Added.
104 (App.BugTracker.repositories): Added. This was a missing back reference to repositories.
105 (App.MetricSerializer.normalizePayload): Now parses/loads the list of bug trackers from the manifest.
106 (App.Manifest.repositoriesWithReportedCommits): Now initialized to an empty array instead of null.
107 (App.Manifest.bugTrackers): Added.
108 (App.Manifest._fetchedManifest): Sets App.Manifest.bugTrackers. Also sorts the list of repositories by
109 their respective ids to make the ordering stable.
111 2014-10-14 Ryosuke Niwa <rniwa@webkit.org>
113 Remove unused jobs table
114 https://bugs.webkit.org/show_bug.cgi?id=137724
116 Reviewed by Daniel Bates.
118 Removed jobs table in the database as well as related code.
121 * public/admin/jobs.php: Removed.
122 * public/admin/tests.php:
123 * public/include/admin-header.php:
125 2014-10-13 Ryosuke Niwa <rniwa@webkit.org>
127 New perf dashboard should have an ability to search commits by a keyword
128 https://bugs.webkit.org/show_bug.cgi?id=137675
130 Reviewed by Geoffrey Garen.
132 /api/commits/ now accepts query parameters to search a commit by a keyword. Its output format changed to
133 include "authorEmail" and "authorName" directly as columns instead of including an "author" object.
134 This API change allows fetch_commits_between to generate results without processing Postgres query results.
136 In the front end side, we've added a search pane in pane controller, and the interactive chart component
137 now has a concept of highlighted items which is used to indicate commits found by the search pane.
139 * public/api/commits.php:
140 (main): Extract query parameters: keyword, from, and to and use that to fetch appropriate commits.
141 (fetch_commits_between): Moved some code from main. Now takes a search term as the third argument.
142 We look for a commit if its author name or email contains the keyword or if its revision matches the keyword.
143 (format_commit): Renamed from format_commits. Now only formats one commit.
145 * public/include/db.php:
146 (Database::query_and_fetch_all): Now returns array() when the query results is empty (instead of false).
148 * public/v2/app.css: Renamed .close-button to .icon-button since it's used by a search button as well.
151 (App.Pane.searchCommit): Added. Finds the commits by a search term and assigns 'highlightedItems',
152 which is a hash table that contains highlighted items' measurements' ids as keys.
153 (App.PaneController.actions.toggleSearch): Toggles the visibility of the search pane. Also sets
154 the default commit repository.
155 (App.PaneController.actions.searchCommit): Delegates the work to App.Pane.searchCommit.
156 (App.InteractiveChartComponent._constructGraphIfPossible): Fixed a bug that we weren't removing old this._dots.
157 Added the code to initialize this._highlights.
158 (App.InteractiveChartComponent._updateDimensionsIfNeeded): Updates dimensions of highlight lines.
159 (App.InteractiveChartComponent._updateHighlightPositions): Added. Ditto.
160 (App.InteractiveChartComponent._highlightedItemsChanged): Adds vertical lines for highlighted items and deletes
161 the existing lines for the old highlighted items.
162 (App.CommitsViewerComponent.commitsChanged): Updated the code per JSON API change mentioned above.
163 Also fixed a bug that the code tries to update the commits viewer even if the viewer had already been destroyed.
165 * public/v2/chart-pane.css: Added style for the search pane and the search button.
167 * public/v2/data.js: Turned FetchCommitsForTimeRange into a class: CommitLogs.
169 (CommitLogs.fetchForTimeRange): Renamed from FetchCommitsForTimeRange. Takes a search term as an argument.
170 (CommitLogs._cachedCommitsBetween): Extracted from FetchCommitsForTimeRange.
171 (CommitLogs._cacheConsecutiveCommits): Ditto.
172 (FetchCommitsForTimeRange._cachedCommitsByRepository): Deleted.
173 (Measurement.prototype.commitTimeForRepository): Extracted from formattedRevisions.
174 (Measurement.prototype.formattedRevisions): Uses formattedRevisions. Deleted the unused code for commitTime.
176 * public/v2/index.html: Added the search pane and the search button. Also removed the unused attribute binding
177 for showingDetails since this property is no longer used.
179 * public/v2/manifest.js:
180 (App.Manifest.repositories): Added.
181 (App.Manifest.repositoriesWithReportedCommits): Ditto. Used by App.PaneController.actions.toggleSearch to find
182 the default repository to search.
183 (App.Manifest._fetchedManifest): Populates repositories and repositoriesWithReportedCommits.
185 2014-10-13 Ryosuke Niwa <rniwa@webkit.org>
187 Unreviewed build fix after r174555.
189 * public/include/manifest.php:
190 (ManifestGenerator::generate): Assign an empty array to $repositories_with_commit when there are no commits.
191 * tests/admin-regenerate-manifest.js: Fixed the test case.
193 2014-10-09 Ryosuke Niwa <rniwa@webkit.org>
195 New perf dashboard UI tries to fetch commits all the time
196 https://bugs.webkit.org/show_bug.cgi?id=137592
198 Reviewed by Andreas Kling.
200 Added hasReportedCommits boolean to repository meta data in manifest.json, and used that in
201 the front end to avoid issuing HTTP requests to fetch commit logs for repositories with
202 no reported commits as they are all going to fail.
204 Also added an internal cache to FetchCommitsForTimeRange in the front end to avoid fetching
205 the same commit logs repeatedly. There are two data structures we cache: commitsByRevision
206 which maps a given commit revision/hash to a commit object; and commitsByTime which is an array
207 of commits sorted chronologically by time.
209 * public/include/manifest.php:
212 (App.CommitsViewerComponent.commitsChanged):
215 (FetchCommitsForTimeRange):
216 (FetchCommitsForTimeRange._cachedCommitsByRepository):
218 * public/v2/manifest.js:
221 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
223 Another unreviewed build fix after r174477.
225 Don't try to insert a duplicated row into build_commits as it results in a database constraint error.
227 This has been caught by a test in /api/report. I don't know why I thought all tests were passing.
229 * public/include/report-processor.php:
231 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
233 Unreviewed build fix after r174477.
235 * init-database.sql: Removed build_commits_index since it's redundant with build_commit's primary key.
236 Also fixed a syntax error that we were missing "," after line that declared build_commit column.
238 * public/api/runs.php: Fixed the query so that test_runs without commits data will be retrieved.
239 This is necessary for baseline and target values manually added via admin pages.
241 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
243 Add v2 UI for the perf dashboard
244 https://bugs.webkit.org/show_bug.cgi?id=137537
246 Rubber-stamped by Andreas Kling.
249 * public/v2/app.css: Added.
250 * public/v2/app.js: Added.
251 * public/v2/chart-pane.css: Added.
252 * public/v2/data.js: Added.
253 * public/v2/index.html: Added.
254 * public/v2/js: Added.
255 * public/v2/js/d3: Added.
256 * public/v2/js/d3/LICENSE: Added.
257 * public/v2/js/d3/d3.js: Added.
258 * public/v2/js/d3/d3.min.js: Added.
259 * public/v2/js/ember-data.js: Added.
260 * public/v2/js/ember.js: Added.
261 * public/v2/js/handlebars.js: Added.
262 * public/v2/js/jquery.min.js: Added.
263 * public/v2/js/statistics.js: Added.
264 * public/v2/manifest.js: Added.
265 * public/v2/popup.js: Added.
267 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
269 Remove superfluously duplicated code in public/api/report-commits.php.
271 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
273 Perf dashboard should store commit logs
274 https://bugs.webkit.org/show_bug.cgi?id=137510
276 Reviewed by Darin Adler.
278 For the v2 version of the perf dashboard, we would like to be able to see commit logs in the dashboard itself.
280 This patch replaces "build_revisions" table with "commits" and "build_commits" relations to store commit logs,
281 and add JSON APIs to report and retrieve them. It also adds a tools/pull-svn.py to pull commit logs from
282 a subversion directory. The git version of this script will be added in a follow up patch.
285 In the new database schema, each revision in each repository is represented by exactly one row in "commits"
286 instead of one row for each build in "build_revisions". "commits" and "builds" now have a proper many-to-many
287 relationship via "build_commits" relations.
289 In order to migrate an existing instance of this application, run the following SQL commands:
293 INSERT INTO commits (commit_repository, commit_revision, commit_time)
294 (SELECT DISTINCT ON (revision_repository, revision_value)
295 revision_repository, revision_value, revision_time FROM build_revisions);
297 INSERT INTO build_commits (commit_build, build_commit) SELECT revision_build, commit_id
298 FROM commits, build_revisions
299 WHERE commit_repository = revision_repository AND commit_revision = revision_value;
301 DROP TABLE build_revisions;
306 The helper script to submit commit logs can be used as follows:
308 python ./tools/pull-svn.py "WebKit" https://svn.webkit.org/repository/webkit/ https://perf.webkit.org
309 feeder-slave feeder-slave-password 60 "webkit-patch find-users"
311 The above command will pull the subversion server at https://svn.webkit.org/repository/webkit/ every 60 seconds
312 to retrieve at most 10 commits, and submits the results to https://perf.webkit.org using "feeder-slave" and
313 "feeder-slave-password" as the builder name and the builder password respectively.
315 The last, optional, argument is the shell command to convert a subversion account to the corresponding username.
316 e.g. "webkit-patch find-users rniwa@webkit.org" yields "Ryosuke Niwa" <rniwa@webkit.org> in the stdout.
319 * init-database.sql: Replaced "build_revisions" relation with "commits" and "build_commits" relations.
321 * public/api/commits.php: Added. Retrieves a list of commits based on arguments in its path of the form
322 /api/commits/<repository-name>/<filter>. The behavior of this API depends on <filter> as follows:
324 - Not specified - It returns every single commit for a given repository.
325 - Matches "oldest" - It returns the commit with the oldest timestamp.
326 - Matches "latest" - It returns the commit with the latest timestamp.
327 - Matches "last-reported" - It returns the commit with the latest timestamp added via report-commits.php.
328 - Is entirely alphanumeric - It returns the commit whose revision matches the filter.
329 - Is of the form <alphanumeric>:<alphanumeric> or <alphanumeric>-<alphanumeric> - It retrieves the list
330 of commits added via report-commits.php between two timestamps retrieved from commits whose revisions
331 match the two alphanumeric values specified. Because it retrieves commits based on their timestamps,
332 the list may contain commits that do not appear as neither hash's ancestor in git/mercurial.
334 (commit_from_revision):
335 (fetch_commits_between):
338 * public/api/report-commits.php: Added. A JSON API to report new subversion, git, or mercurial commits.
339 See tests/api-report-commits.js for examples on how to use this API.
341 * public/api/runs.php: Updated the query to use "commit_builds" and "commits" relations instead of
342 "build_revisions". Regrettably, the new query is 20% slower but I'm going to wait until the new UI is ready
343 to optimize this and other JSON APIs.
345 * public/include/db.php:
346 (Database::select_or_insert_row):
347 (Database::update_or_insert_row): Added.
348 (Database::_select_update_or_insert_row): Extracted from select_or_insert_row. Try to update first and then
349 insert if the update fails for update_or_insert_row. Preserves the old behavior when $should_update is false.
351 (Database::select_first_row):
352 (Database::select_last_row): Added.
353 (Database::select_first_or_last_row): Extracted from select_first_row. Fixed a bug that we were asserting
354 $order_by to be not alphanumeric/underscore. Retrieve the last row instead of the first if $descending_order.
356 * public/include/report-processor.php:
357 (ReportProcessor::resolve_build_id): Store commits instead of build_revisions. We don't worry about the race
358 condition for adding "build_commits" rows since we shouldn't have a single tester submitting the same result
359 concurrently. Even if it happened, it will only result in a PHP error and the database will stay consistent.
362 (pathToTests): Don't call path.resolve with "undefined" testName; It throws an exception in the latest node.js.
364 * tests/api-report-commits.js: Added.
365 * tests/api-report.js: Fixed a test per build_revisions to build_commits/commits replacement.
368 * tools/pull-svn.py: Added. See above for how to use this script.
370 (determine_first_revision_to_fetch):
371 (fetch_revision_from_dasbhoard):
372 (fetch_commit_and_resolve_author):
375 (resolve_author_name_from_email):
378 2014-09-30 Ryosuke Niwa <rniwa@webkit.org>
380 Update Install.md for Mavericks and fix typos
381 https://bugs.webkit.org/show_bug.cgi?id=137276
383 Reviewed by Benjamin Poulain.
385 Add the instruction to copy php.ini to enable the Postgres extension in PHP.
387 Also use perf.webkit.org as the directory name instead of WebKitPerfMonitor.
389 Finally, init-database.sql is no longer located inside database directory.
393 2014-08-11 Ryosuke Niwa <rniwa@webkit.org>
395 Report run id's in api/runs.php for the new dashboard UI
396 https://bugs.webkit.org/show_bug.cgi?id=135813
398 Reviewed by Andreas Kling.
400 Include run_id in the generated JSON.
402 * public/api/runs.php:
403 (fetch_runs_for_config): Don't sort results by time since that has been done in the front end for ages now.
406 2014-08-11 Ryosuke Niwa <rniwa@webkit.org>
408 Merging platforms mixes baselines and targets into reported data
409 https://bugs.webkit.org/show_bug.cgi?id=135260
411 Reviewed by Andreas Kling.
413 When merging two platforms, move test configurations of a different type (baseline, target)
414 as well as of different metric (Time, Runs).
416 Also avoid fetching the entire table of runs just to see if there are no remaining runs.
417 It's sufficient to detect one such test_runs object.
419 * public/admin/platforms.php:
422 2014-07-30 Ryosuke Niwa <rniwa@webkit.org>
424 Merging platforms mixes baselines and targets into reported data
425 https://bugs.webkit.org/show_bug.cgi?id=135260
427 Reviewed by Geoffrey Garen.
429 Make sure two test configurations we're merging are of the same type (e.g. baseline, target, current).
430 Otherwise, we'll erroneously mix up runs for baseline, target, and current (reported values).
432 * public/admin/platforms.php:
434 2014-07-23 Ryosuke Niwa <rniwa@webkit.org>
436 Build fix after r171361.
438 * public/js/helper-classes.js:
439 (.this.formattedBuildTime):
441 2014-07-22 Ryosuke Niwa <rniwa@webkit.org>
443 Perf dashboard spends 2s processing JSON data during the page loads
444 https://bugs.webkit.org/show_bug.cgi?id=135152
446 Reviewed by Andreas Kling.
448 In the Apple internal dashboard, we were spending as much as 2 seconds
449 converting raw JSON data into proper JS objects while loading the dashboard.
451 This caused the apparent unresponsiveness of the dashboard despite of the fact
452 charts themselves updated almost instantaneously.
455 * public/js/helper-classes.js:
456 (TestBuild): Compute the return values of formattedTime and formattedBuildTime
457 lazily as creating new Date objects and running string replace is expensive.
458 (TestBuild.formattedTime):
459 (TestBuild.formattedBuildTime):
460 (PerfTestRuns.setResults): Added. Pushing each result was the biggest bottle neck.
461 (PerfTestRuns.addResult): Deleted.
463 2014-07-18 Ryosuke Niwa <rniwa@webkit.org>
465 Perf dashboard shouldn't show the full git hash
466 https://bugs.webkit.org/show_bug.cgi?id=135083
468 Reviewed by Benjamin Poulain.
470 Detect Git/Mercurial hash by checking the length.
472 If it's a hash, use the first 8 characters in the label
473 while retaining the full length to be used in hyperlinks.
475 * public/js/helper-classes.js:
476 (.this.formattedRevisions):
479 2014-05-29 Ryosuke Niwa <rniwa@webkit.org>
481 Add an instruction on how to backup the database.
482 https://bugs.webkit.org/show_bug.cgi?id=133391
484 Rubber-stamped by Andreas Kling.
488 2014-04-08 Ryosuke Niwa <rniwa@webkit.org>
490 Build fix after r166479. 'bytes' is now abbreviated as 'B'.
492 * public/js/helper-classes.js:
493 (PerfTestRuns.smallerIsBetter):
495 2014-04-08 Ryosuke Niwa <rniwa@webkit.org>
505 2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
507 WebKitPerfMonitor: There should be a way to add all metrics of a suite without also adding subtests
508 https://bugs.webkit.org/show_bug.cgi?id=131157
510 Reviewed by Andreas Kling.
512 Split "all metrics" into all metrics of a test suite and all subtests of the suite.
513 This allows, for example, adding all metrics such as Arithmetic and Geometric for
514 a given test suite without also adding its subtests.
520 2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
522 WebKitPerfMonitor: Tooltips cannot be pinned after using browser's back button
523 https://bugs.webkit.org/show_bug.cgi?id=131155
525 Reviewed by Andreas Kling.
527 The bug was caused by Chart.attach binding event listeners on plot container on each call.
528 This resulted in the click event handler toggling the visiblity of the tooltip twice upon
529 click when attach() has been called even number of times, keeping the tooltip invisible.
531 Fixed the bug by extracting the code to bind event listeners outside of Chart.attach as
532 a separate function, bindPlotEventHandlers, and calling it exactly once when Chart.attach
533 is called for the first time.
537 (Chart..bindPlotEventHandlers):
539 2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
541 WebKitPerfMonitor: Tooltips can be cut off at the top
542 https://bugs.webkit.org/show_bug.cgi?id=130960
544 Reviewed by Andreas Kling.
547 (#title): Removed the gradients, box shadows, and border from the header.
548 (#title h1): Reduce the font size.
549 (#title ul): Use line-height to vertically align the navigation bar instead of specifying a padding atop.
551 (.tooltop:before): Added. Identical to .tooltop:after except it's upside down (arrow facing up).
552 (.tooltip.inverted:before): Show the arrow facing up when .inverted is set.
553 (.tooltip.inverted:before): Hide the arrow facing down when .inverted is set.
554 * public/js/helper-classes.js:
555 (Tooltip.show): Show the tooltip below the point if placing it above the point results in the top of the
556 tooltip extending above y=0.
558 2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
560 WebKitPerfMonitor: Y-axis adjustment is too aggressive
561 https://bugs.webkit.org/show_bug.cgi?id=130937
563 Reviewed by Andreas Kling.
565 Previously, adjusted min. and max. were defined as the two standards deviations away from EWMA of measured
566 results. This had two major problems:
567 1. Two standard deviations can be too small to show the confidence interval for results.
568 2. Sometimes baseline and target can be more than two standards deviations away.
570 Fixed the bug by completely rewriting the algorithm to compute the interval. Instead of blindly using two
571 standard deviations as margins, we keep adding quarter the standard deviation on each side until more than 90%
572 of points lie in the interval or we've expanded 4 standard deviations. Once this condition is met, we reduce
573 the margin on each side separately to reduce the empty space on either side.
575 A more rigorous approach would involve computing least squared value of results with respect to intervals
576 but that seems like an overkill for a simple UI problem; it's also computationally expensive.
579 (Chart..adjustedIntervalForRun): Extracted from computeYAxisBoundsToFitLines.
580 (Chart..computeYAxisBoundsToFitLines): Compute the min. and max. adjusted intervals out of adjusted intervals
581 for each runs (current, baseline, and target) so that at least one point from each set of results is shown.
582 We wouldn't see the difference between measured values versus baseline and target values otherwise.
583 * public/js/helper-classes.js:
584 (PerfTestResult.unscaledConfidenceIntervalDelta): Returns the default value if the confidence
585 interval delta cannot be computed.
586 (PerfTestResult.isInUnscaledInterval): Added. Returns true iff the confidence intervals lies
587 within the given interval.
588 (PerfTestRuns..filteredResults): Extracted from unscaledMeansForAllResults now that PerfTestRuns.min and
589 PerfTestRuns.max need to use both mean and confidence interval delta for each result.
590 (PerfTestRuns..unscaledMeansForAllResults):
591 (PerfTestRuns.min): Take the confidence interval delta into account.
592 (PerfTestRuns.max): Ditto.
593 (PerfTestRuns.countResults): Returns the number of results in the given time frame (> minTime).
594 (PerfTestRuns.countResultsInInterval): Returns the number of results whose confidence interval lie within the
596 (PerfTestRuns.exponentialMovingArithmeticMean): Fixed the typo so that it actually computes the EWMA.
598 2014-03-31 Ryosuke Niwa <rniwa@webkit.org>
600 Some CSS tweaks after r166477 and r166479,
604 2014-03-30 Ryosuke Niwa <rniwa@webkit.org>
606 WebKitPerfMonitor: Sometimes text inside panes overlap
607 https://bugs.webkit.org/show_bug.cgi?id=130956
609 Reviewed by Gyuyoung Kim.
611 Revamped the pane UI. Now build info uses table element instead of plane text with BRs. The computed status of
612 the latest result against baseline/target such as "3% until target" is now shown above the current value. This
613 reduces the total height of the pane and fits more information per screen capita on the dashboard.
615 * public/index.html: Updated and added a bunch of CSS rules for the new look.
616 (.computeStatus): Don't append the build info here. The build info is constructed as a separate table now.
617 (.createSummaryRowMarkup): Use th instead of td for "Current", "Baseline", and "Target" in the summary table.
618 (.buildLabelWithLinks): Construct table rows instead of br separated lines of text. This streamlines the look
619 of the build info shown in a chart pane and a tooltip.
620 (Chart): Made .status a table.
621 (Chart.populate): Prepend status.text, which contains text such as "3% until target", into the summary rows
622 right above "Current" value, and populate .status with buildLabelWithLinks manually instead of status.text
623 now that status.text no longer contains it.
624 (Chart..showTooltipWithResults): Wrap buildLabelWithLinks with a table element.
626 * public/js/helper-classes.js:
627 (TestBuild.formattedRevisions): Don't include repository names in labels since repository names are now added
628 by buildLabelWithLinks inside th elements. Also place spaces around '-' between two different OS X versions.
629 e.g. "OS X 10.8 - OS X 10.9" instead of "OS X 10.8-OS X 10.9".
630 (PerfTestRuns): Use "/s" for "runs/s" and "B" for "bytes" to make text shorter in .status and .summaryTable.
631 (PerfTestRuns..computeScalingFactorIfNeeded): Avoid placing a space between 'M' and a unit starting with a
632 capital letter; e.g. "MB" instead of "M B".
634 2014-03-30 Ryosuke Niwa <rniwa@webkit.org>
636 WebKitPerfMonitor: Header and number-of-days slider takes up too much space
637 https://bugs.webkit.org/show_bug.cgi?id=130957
639 Reviewed by Gyuyoung Kim.
641 Moved the slider into the header. Also reduced the spacing between the header and platform names.
642 This reclaims 50px × width of the screen real estate.
645 (#title): Reduced the space below the header from 20px to 10px.
647 (#numberOfDaysPicker): Removed the rounded border around the number-of-days slider.
648 (#dashboard > tbody > tr > td): Added a 1.5em padding at the bottom.
649 (#dashboard > thead th): That allows us to remove the padding at the top here. This reduces the wasted screen
650 real estate between the header and the platform names.
652 2014-03-10 Zoltan Horvath <zoltan@webkit.org>
654 Update the install guidelines for perf.webkit.org
655 https://bugs.webkit.org/show_bug.cgi?id=129895
657 Reviewed by Ryosuke Niwa.
659 The current install guideline for perf.webkit.org discourages the use of the installed
660 Server application. I've actualized the documentation for Mavericks, and modified the
661 guideline to include the instructions for Server.app also.
665 2014-03-08 Zoltan Horvath <zoltan@webkit.org>
667 Update perf.webkit.org json example
668 https://bugs.webkit.org/show_bug.cgi?id=129907
670 Reviewed by Andreas Kling.
672 The current example is not valid json syntax. I fixed the syntax errors and indented the code properly.
676 2014-01-31 Ryosuke Niwa <rniwa@webkit.org>
678 Merge database-common.js and utility.js into run-tests.js.
680 Reviewed by Matthew Hanson.
682 Now that run-tests is the only node.js script, merged database-common.js and utility.js into it.
683 Also moved init-database.sql out of the database directory and removed the directory entirely.
686 * database/database-common.js: Removed.
687 * database/utility.js: Removed.
688 * init-database.sql: Moved from database/init-database.sql.
690 (connect): Moved from database-common.js.
691 (pathToDatabseSQL): Extracted from pathToLocalScript.
692 (pathToTests): Moved from database-common.js.
695 (SerializedTaskQueue): Ditto.
697 (initializeDatabase):
698 (TestEnvironment.it):
699 (TestEnvironment.queryAndFetchAll):
702 2014-01-30 Ryosuke Niwa <rniwa@webkit.org>
704 Remove the dependency on node.js from the production code.
706 Reviewed by Ricky Mondello.
708 Work towards <rdar://problem/15955053> Upstream SafariPerfMonitor.
710 Removed node.js dependency from TestRunsGenerator. It was really a design mistake to invoke node.js from php.
711 It added so much complexity with only theoretical extensibility of adding aggregators. It turns out that
712 many aggregators we'd like to add are a lot more complicated than ones that could be written under the current
713 infrastructure, and we need to make the other aspects (e.g. the level of aggregations) a lot more extensible.
714 Removing and simplifying TestRunsGenerator allows us to implement such extensions in the future.
716 Also removed the js files that are no longer used.
718 * config.json: Moved from database/config.json.
719 * database/aggregate.js: Removed. No longer used.
720 * database/database-common.js: Removed unused functions, and updated the path to config.json.
721 * database/process-jobs.js: Removed. No longer used.
722 * database/sample-data.sql: Removed. We have a much better corpus of data now.
723 * database/schema.graffle: Removed. It's completely obsolete.
724 * public/include/db.php: Updated the path to config.json.
725 * public/include/evaluator.js: Removed.
727 * public/include/report-processor.php:
728 (TestRunsGenerator::aggregate): Directly aggregate values via newly added aggregate_values method instead of
729 storing values into $expressions and calling evaluate_expressions_by_node.
730 (TestRunsGenerator::aggregate_values): Added.
731 (TestRunsGenerator::compute_caches): Directly compute the caches.
733 2014-01-30 Ryosuke Niwa <rniwa@webkit.org>
735 Build fix. Don't fail the platform merges even if there are no test configurations to be moved to the new platform.
737 * public/admin/platforms.php:
738 * public/include/db.php:
740 2014-01-30 Ryosuke Niwa <rniwa@webkit.org>
742 Zoomed y-axis view is ununsable when the last result is an outlier.
744 Reviewed by Stephanie Lewis.
746 Show two standard deviations from the exponential moving average with alpha = 0.3 instead of the mean of
747 the last result so that the graph looks sane if the last result was an outlier. However, always show
748 the last result's mean even if it was an outlier.
751 * public/js/helper-classes.js:
752 (unscaledMeansForAllResults): Extracted from min/max/sampleStandardDeviation.
753 Also added the ability to cache the unscaled means to avoid recomputation.
754 (PerfTestRuns.min): Refactored to use unscaledMeansForAllResults.
755 (PerfTestRuns.max): Ditto.
756 (PerfTestRuns.sampleStandardDeviation): Ditto.
757 (PerfTestRuns.exponentialMovingArithmeticMean): Added.
759 2014-01-30 Ryosuke Niwa <rniwa@webkit.org>
763 * public/admin/tests.php:
764 * public/js/helper-classes.js:
766 2014-01-29 Ryosuke Niwa <rniwa@webkit.org>
768 Use two standard deviations instead as I mentioned in the mailing list.
772 2014-01-28 Ryosuke Niwa <rniwa@webkit.org>
774 The performance dashboard erroneously shows upward arrow for combined metrics.
776 A single outlier can ruin the zoomed y-axis view.
778 Rubber-stamped by Antti Koivisto.
781 (computeYAxisBoundsToFitLines): Added adjustedMax and adjustedMin, which are pegged at 4 standard deviations
782 from the latest results' mean.
783 (Chart): Renamed shouldStartYAxisAtZero to shouldShowEntireYAxis.
784 (Chart.attachMainPlot): Use the adjusted max and min when we're not showing the entire y-axis.
786 * public/js/helper-classes.js:
787 (PerfTestRuns.sampleStandardDeviation): Added.
788 (PerfTestRuns.smallerIsBetter): 'Combined' is a smaller is better metric.
790 2014-01-28 Ryosuke Niwa <rniwa@webkit.org>
792 Don't include the confidence interval when computing the y-axis.
794 Rubber-stamped by Simon Fraser.
796 * public/js/helper-classes.js:
800 2014-01-25 Ryosuke Niwa <rniwa@webkit.org>
802 Tiny CSS tweak for tooltips.
806 2014-01-25 Ryosuke Niwa <rniwa@webkit.org>
808 Remove the erroneously repeated code.
810 * public/admin/test-configurations.php:
812 2014-01-24 Ryosuke Niwa <rniwa@webkit.org>
814 <rdar://problem/15704893> perf dashboard should show baseline numbers
816 Reviewed by Stephanie Lewis.
818 * public/admin/bug-trackers.php:
819 (associated_repositories): Return an array of HTMLs instead of echo'ing as expected by AdministrativePage.
822 * public/admin/platforms.php:
825 * public/admin/test-configurations.php: Added.
826 (add_run): Adds a "synthetic" test run and a corresponding build. It doesn't create run_iterations and
827 build_revisions as they're not meaningful for baseline / target numbers.
828 (delete_run): Deletes a synthetic test run and its build. It verifies that the specified build has exactly
829 one test run so that we don't accidentally delete a reported test run.
830 (generate_rows_for_configurations): Generates rows of configuration IDs and types.
831 (generate_rows_for_test_runs): Ditto for test runs. It also emits the form to add new "synthetic" test runs
832 and delete existing ones.
834 * public/admin/tests.php: We wrongfully assumed there is exactly one test configuration for each metric
835 on each platform; there could be configurations of distinct types such as "current" and "baseline".
836 Thus, update all test configurations for a given metric when updating config_is_in_dashboard.
838 * public/api/runs.php: Remove the NotImplemented when we have multiple test configurations.
839 (fetch_runs_for_config): "Synthetic" test runs created on test-configurations page are missing revision
840 data so we need to left-outer-join (instead of inner-join) build_revisions. To avoid making the query
841 unreadable, don't join revision_repository here. Instead, fetch the list of repositories upfront and
842 resolve names in parse_revisions_array. This actually reduces the query time by ~10%.
844 (parse_revisions_array): Skip an empty array created for "synthetic" test runs.
846 * public/include/admin-header.php:
847 (AdministrativePage::render_table): Now custom columns support sub columns. e.g. a configuration column may
848 have id and type sub columns, and each custom column could generate multiple rows.
850 Any table with sub columns now generates two rows for thead. We generate td's in in the first row without
851 sub columns with rowspan of 2, and generate ones with sub columns with colspan set to the sub column count.
852 We then proceed to generate the second header row with sub column names.
854 When generating the actual content, we first generate all custom columns as they may have multiple rows in
855 which case regular columns need rowspan set to the maximum number of rows.
857 Once we've generated the first row, we proceed to generate subsequent rows for those custom columns that
860 (AdministrativePage::render_custom_cells): Added. This function is responsible for generating table cells
861 for a given row in a given custom column. It generates an empty td when the custom column doesn't have
862 enough rows. It also generates empty an td when it doesn't have enough columns in some rows except when
863 the entire row consists of exactly one cell for a custom column with sub columns, in which case the cell is
864 expanded to occupy all sub columns.
866 * public/include/manifest.php:
867 (ManifestGenerator::platforms): Don't add the metric more than once.
869 * public/include/test-name-resolver.php:
870 (TestNameResolver::__construct): We had wrongfully assumed that we have exactly one test configuration on
871 each platform for each metric like tests.php. Fixed that. Also fetch the list of aggregators to compute the
872 full metric name later.
873 (TestNameResolver::map_metrics_to_tests): Populate $this->id_to_metric.
874 (TestNameResolver::test_id_for_full_name): Simplified the code using array_get.
875 (TestNameResolver::full_name_for_test): Added.
876 (TestNameResolver::full_name_for_metric): Added.
877 (TestNameResolver::configurations_for_metric_and_platform): Renamed as it returns multiple configurations.
879 * public/js/helper-classes.js:
880 (TestBuild): Use the build time as the maximum time when revision information is missing for "synthetic"
881 test runs created to set baseline and target points.
883 2014-01-24 Ryosuke Niwa <rniwa@webkit.org>
885 Build fix after r57928. Removed a superfluous close parenthesis.
887 * public/api/runs.php:
889 2014-01-24 Ryosuke Niwa <rniwa@webkit.org>
891 Unreviewed build & typo fixes.
893 * public/admin/platforms.php:
894 * tests/admin-platforms.js:
896 2014-01-24 Ryosuke Niwa <rniwa@webkit.org>
898 <rdar://problem/15704893> perf dashboard should show baseline numbers
900 Rubber-stamped by Antti Koivisto.
902 Organize some code into functions in runs.php.
904 Also added back $paths that was erroneously removed in r57925 from json-header.php.
906 * public/api/runs.php:
907 (fetch_runs_for_config): Extracted.
910 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
912 Merge the upstream json-shared.php as of https://trac.webkit.org/r162693.
914 * database/config.json:
915 * public/admin/reprocess-report.php:
916 * public/api/report.php:
917 * public/api/runs.php:
918 * public/include/json-header.php:
920 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
922 Commit yet another forgotten change.
924 Something went horribly wrong with my merge :(
926 * database/init-database.sql:
928 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
930 Commit one more forgotten change. Sorry for making a mess here.
932 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
934 Commit the forgotten files.
936 * public/admin/platforms.php: Added.
937 * tests/admin-platforms.js: Added.
939 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
941 <rdar://problem/15889905> SafariPerfMonitor: there should be a way to merge and hide platforms
943 Reviewed by Stephanie Lewis.
945 Added /admin/platforms/ page to hide and merge platforms.
947 Merging two platforms is tricky because we need to migrate test runs as well as some test configurations.
948 Recall that each test (e.g. Dromaeo) can have many "test metrics" (e.g. MaxAllocations, EndAllocations),
949 and they have a distinct "test configuration" for each platform (e.g. MaxAllocation on Mountain Lion), and
950 each test configuration a distinct "test run" for each build.
952 In order to merge platform A into platform B, we must migrate all test runs that belong to platform A via
953 their test configurations into platform B.
955 Suppose we're migrating a test run R for test configuration T_A in platform A for metric M. Since M exists
956 independent of platforms, R should continue to relate to M through some test configuration. Unfortunately,
957 we can't simply move T_A into platform B since we may already have a test configuration T_B for metric M
958 in platform B, in which case R should relate to T_B instead.
960 Thus, we first migrate all test runs for which we already have corresponding test configurations in the
961 new platform. We then migrate the test configurations of the remaining test runs.
963 * database/init-database.sql: Added platform_hidden.
965 * public/admin/platforms.php: Added.
966 (merge_platforms): Added. Implements the algorithm described above.
969 * public/admin/tests.php: Disable the checkbox to show a test configuration on the dashboard if its platform
970 is hidden since it doesn't do anything.
972 * public/include/admin-header.php: Added the hyperlink to /admin/platforms.
973 (update_field): Don't bail out if the newly added "update-column" is set to the field name even if $_POST is
974 missing it since unchecked checkbox doesn't set the value in $_POST.
975 (AdministrativePage::render_form_control_for_column): Added the support for boolean edit mode. Also used
976 switch statement instead of repeated if's.
977 (AdministrativePage::render_table): Emit "update-column" for update_field.
979 * public/include/db.php: Disable warnings when we're not in the debug mode.
981 * public/include/manifest.php:
982 (ManifestGenerator::platforms): Skip platforms that have been hidden.
985 (TestEnvironment.postJSON):
986 (TestEnvironment.httpGet):
987 (TestEnvironment.httpPost): Added.
988 (sendHttpRequest): Set the content type if specified.
990 * tests/admin-platforms.js: Added tests.
992 2014-01-22 Ryosuke Niwa <rniwa@webkit.org>
994 Extract the code to compute full test names from tests.php.
996 Reviewed by Stephanie Lewis.
998 Extracted TestNameResolver out of tests.php. This reduces the number of global variables in tests.php
999 and paves our way to re-use the code in other pages.
1001 * public/admin/tests.php:
1003 * public/include/db.php:
1004 (array_set_default): Renamed from array_item_set_default and moved from tests.php as it's used in both
1005 tests.php and test-name-resolver.php.
1007 * public/include/test-name-resolver.php: Added.
1008 (TestNameResolver::__construct):
1009 (TestNameResolver::compute_full_name): Moved from tests.php.
1010 (TestNameResolver::map_metrics_to_tests): Ditto.
1011 (TestNameResolver::sort_tests_by_full_name): Ditto.
1012 (TestNameResolver::tests): Added.
1013 (TestNameResolver::test_id_for_full_name): Ditto.
1014 (TestNameResolver::metrics_for_test_id): Ditto.
1015 (TestNameResolver::child_metrics_for_test_id): Ditto.
1016 (TestNameResolver::configuration_for_metric_and_platform): Ditto.
1018 2014-01-21 Ryosuke Niwa <rniwa@webkit.org>
1020 <rdar://problem/15867325> Perf dashboard is erroneously associating reported results with old revisions
1022 Reviewed by Stephanie Lewis.
1024 Add the ability to reprocess reports so that I can re-associate wrongfully associated reports.
1026 Added public/admin/reprocess-report.php. It doesn't have any nice UI to find reports and it returns JSON
1027 but that's sufficient to correct the wrongfully processed reports for now.
1029 * public/admin/reprocess-report.php: Added. Takes a report id in $_GET or $_POST and process the report.
1030 We should eventually add a nice UI to find and reprocess reports.
1032 * public/api/report.php: ReportProcessor and TestRunsGenerator have been removed.
1034 * public/include/db.php: Added the forgotten call to prefixed_column_names.
1036 * public/include/report-processor.php: Copied from public/api/report.php.
1037 (ReportProcessor::__construct): Fetch the list of aggregators here for simplicity.
1038 (ReportProcessor::process): Optionally takes $existing_report_id. When this value is specified, we don't
1039 create a new report or authenticate the builder password (the password is never stored in the report).
1040 Also use select_first_row instead of query_and_fetch_all to find the builder for simplicity.
1041 (ReportProcessor::construct_build_data): Extracted from store_report_and_get_build_data.
1042 (ReportProcessor::store_report): Ditto.
1044 * tests/admin-reprocess-report.js: Added.
1046 2014-01-21 Ryosuke Niwa <rniwa@webkit.org>
1048 <rdar://problem/15867325> Perf dashboard is erroneously associating reported results with old revisions
1050 Reviewed by Ricky Mondello.
1052 The bug was caused by a build fix r57645. It attempted to treat multiple reports from the same builder
1053 for the same build number as a single build by ignoring build time. This was necessary to associate
1054 multiple reports by a single build - e.g. for different performance test suites - because the scripts
1055 we use to submit results computed its own "build time" when they're called.
1057 An unintended consequence of this change was revealed when we moved a buildbot master to the new machine
1058 last week; new reports were wrongfully associated with old build numbers.
1060 Fixed the bug by not allowing reports made more than 1 day after the initial build time to be assigned
1061 to the same build. Instead, we create a new build object for those reports. Since the longest set of
1062 tests we have only take a couple of hours to run, 24 hours should be more than enough.
1064 * database/init-database.sql: We can no longer constrain that each build number is unique to a builder
1065 or that build number and build time pair is unique. Instead, constrain the uniqueness of the tuple
1066 (builder, build number, build time).
1068 * public/api/report.php:
1069 (ReportProcessor::resolve_build_id): Look for any builds made within the past one day. Create a new build
1070 when no such build exists. This prevents a report from being associated with a very old build of the same
1073 Also check that revision numbers or hashes match when we're adding revision info. This will let us catch
1074 a similar bug in the future sooner.
1076 * tests/api-report.js: Added three test cases.
1078 2014-01-20 Ryosuke Niwa <rniwa@webkit.org>
1080 Merged the upstream changes to db.php
1081 See http://trac.webkit.org/browser/trunk/Websites/test-results/public/include/db.php
1083 * public/include/db.php:
1085 2014-01-20 Ryosuke Niwa <rniwa@webkit.org>
1087 Update other scripts and tests per previous patch.
1089 * public/include/manifest.php:
1090 * tests/admin-regenerate-manifest.js:
1092 2014-01-20 Ryosuke Niwa <rniwa@webkit.org>
1094 Remove metrics_unit.
1096 Reviewed by Ricky Mondello.
1098 This column is no longer used by the front-end code since r48360.
1100 * database/init-database.sql:
1101 * public/admin/tests.php:
1103 2014-01-16 Ryosuke Niwa <rniwa@webkit.org>
1105 Unreviewed build fix.
1107 * public/api/report.php:
1109 2014-01-15 Ryosuke Niwa <rniwa@webkit.org>
1111 <rdar://problem/15832456> Automate DoYouEvenBench (124497)
1113 Reviewed by Ricky Mondello.
1115 Support a new alternative format for aggregated results where we have raw values as well as
1116 the list aggregators so that instead of
1117 "metrics": {"Time": ["Arithmetic"]}
1119 "metrics": {"Time": { "aggregators" : ["Arithmetic"], "current": [300, 310, 320, 330] }}
1121 This allows single JSON generated by run-perf-tests in WebKit to be shared between the perf
1122 dashboard and the generated results page, which doesn't know how to aggregate values.
1124 We need to keep the support for the old format because all other existing performance tests
1125 all rely on the old format. Even if we updated the tests, we need the dashboard to support
1126 the old format during the transition.
1128 * public/api/report.php:
1129 (ReportProcessor::recursively_ensure_tests): Support the new format in addition to the old one.
1130 (ReportProcessor::aggregator_list_if_exists): Replaced is_list_of_aggregators.
1132 * tests/api-report.js: Updated one of aggregator test cases to test the new format.
1134 2013-05-31 Ryosuke Niwa <rniwa@webkit.org>
1136 Unreviewed; Tweak the CSS so that chart panes align vertically.
1138 * public/index.html:
1140 2013-05-31 Ryosuke Niwa <rniwa@webkit.org>
1142 SafariPerfMonitor should support Combined metric.
1144 * public/js/helper-classes.js:
1145 (PerfTestRuns): Added 'Combined' metric. In general, it could be used for smaller-is-better
1146 value as well but assume it to be greater-is-better for now.
1148 2013-05-30 Ryosuke Niwa <rniwa@webkit.org>
1150 Commit the forgotten init-database change to add iteration_relative_time.
1152 * database/init-database.sql:
1154 2013-05-30 Ryosuke Niwa <rniwa@webkit.org>
1156 <rdar://problem/13993069> SafariPerfMonitor: Support accepting (relative time, value) pairs
1158 Reviewed by Ricky Mondello.
1160 Add the support for each value to have a relative time. This is necessary for frame rate history
1161 since a frame rate needs to be associated with a time it was sampled.
1163 * database/init-database.sql: Added iteration_relative_time to run_iterations.
1165 * public/api/report.php:
1166 (TestRunsGenerator::test_value_list_to_values_by_iterations): Reject any non-numeral values here.
1167 This code is used to aggregate values but it doesn't make sense to aggregate iteration values
1168 with relative time since taking the average of two frame rates for two subtests taken at two
1169 different times doesn't make any sense.
1170 (TestRunsGenerator::compute_caches): When we encounter an array value while computing sum, mean,
1171 etc..., use the second element since we assume values are of the form (relative time, frame rate).
1172 Also exit early with an error if the number of elements in the array is not a pair.
1173 (TestRunsGenerator::commit): Store the relative time and the frame rate as needed.
1175 * tests/api-report.js: Added a test case. Also modified existing test cases to account for
1176 iteration_relative_time.
1178 2013-05-27 Ryosuke Niwa <rniwa@webkit.org>
1180 <rdar://problem/13654488> SafariPerfMonitor: Support accepting single-value results
1182 Reviewed by Ricky Mondello.
1184 Support that. It's one line change.
1186 * public/api/report.php:
1187 (ReportProcessor.recursively_ensure_tests): When there is exactly one value, wrap it inside an array
1188 to match the convention assumed elsewhere.
1189 * tests/api-report.js: Added a test case.
1191 2013-05-26 Ryosuke Niwa <rniwa@webkit.org>
1193 SafariPerfMonitor shows popups for points outside of the visible region.
1195 Rubber-stamped by Simon Fraser.
1197 * public/index.html:
1198 (Chart.closestItemForPageXRespectingPlotOffset): renamed from closestItemForPageX.
1199 (Chart.attach): Always use closestItemForPageXRespectingPlotOffset to work around the fact flot
1200 may return an item underneath y-axis labels.
1202 2013-05-26 Ryosuke Niwa <rniwa@webkit.org>
1204 Tweak the CSS a little to avoid the test name overlapping with the summary table.
1206 * public/index.html:
1208 2013-05-26 Ryosuke Niwa <rniwa@webkit.org>
1210 Unreviewed. Fix the typo. The anchor element should wrap the svg element, not the other way around.
1212 * public/index.html:
1214 2013-05-26 Ryosuke Niwa <rniwa@webkit.org>
1216 <rdar://problem/13992266> Should be a toggle to show entire Y-axis range
1217 <rdar://problem/13992271> Should scale Y axis to include error ranges
1219 Reviewed by Ricky Mondello.
1221 Add the feature. Also made adjust y-axis respect confidence interval delta so that the gray shade behind
1222 the main graph doesn't go outside the graph even when the y-axis is adjusted.
1224 * database/config.json:
1225 * public/index.html:
1226 (Chart): Add a SVG arrow to toggle y-axis mode, and bind click on the arrow to toggleYAxis().
1227 (Chart.attachMainPlot): Respect shouldStartYAxisAtZero.
1228 (Chart.toggleYAxis): Toggle the y-axis mode of this chart by toggling shouldStartYAxisAtZero and calling
1230 * public/js/helper-classes.js:
1231 (PerfTestResult.confidenceIntervalDelta):
1232 (PerfTestResult.unscaledConfidenceIntervalDelta): Extracted.
1233 (PerfTestRuns.min): Take confidence interval delta into account.
1234 (PerfTestRuns.max): Ditto.
1235 (PerfTestRuns.hasConfidenceInterval): Not sure why this function was checking the typeof. Just use isNaN.
1237 2013-04-26 Ryosuke Niwa <rniwa@webkit.org>
1239 A build fix of the previous. Don't look for a test with NULL parent because NULL != NULL in our beloved SQL.
1241 * public/api/report.php:
1242 (ReportProcessor::recursively_ensure_tests):
1243 * tests/api-report.js: Added a test.
1245 2013-04-26 Ryosuke Niwa <rniwa@webkit.org>
1247 Unreviewed build fixes.
1249 * public/api/report.php:
1250 (ReportProcessor::process): Explicitly exit with error when builder name or build time is missing.
1251 Also, tolerate reports without any revision information.
1253 (ReportProcessor::recursively_ensure_tests): When looking for a test, don't forget to compare its
1256 * tests/api-report.js: Added few test cases.
1258 2013-04-26 Ryosuke Niwa <rniwa@webkit.org>
1260 Commit another change that was supposed to be committed in r50331.
1263 (TestEnvironment.this.postJSON):
1264 (TestEnvironment.this.httpGet):
1267 2013-04-09 Ryosuke Niwa <rniwa@webkit.org>
1269 Commit the remaining files.
1271 * public/admin/regenerate-manifest.php:
1272 * public/include/admin-header.php:
1273 * public/include/json-header.php:
1274 * public/include/manifest.php:
1276 (TestEnvironment.this.postJSON):
1277 (TestEnvironment.this.httpGet):
1280 2013-03-15 Ryosuke Niwa <rniwa@webkit.org>
1282 SafariPerfMonitor: Add some tests for admin/regenerate-manifest.
1284 Reviewed by Ricky Mondello.
1286 Added some tests for admin/regenerate-manifest.
1288 * public/admin/regenerate-manifest.php: Use require_once instead of require.
1289 * public/include/admin-header.php: Ditto.
1290 * public/include/json-header.php: Ditto.
1292 * public/include/manifest.php:
1293 (ManifestGenerator::builders): Removed a reference to a non-existent variable.
1294 When there are no builders, simply return an empty array.
1297 (TestEnvironment.postJSON):
1298 (TestEnvironment.httpGet): Added.
1299 (sendHttpRequest): Renamed from postHttpRequest as it now takes method as an argument.
1301 * tests/admin-regenerate-manifest.js: Added with a bunch of test cases.
1303 2013-03-14 Ryosuke Niwa <rniwa@webkit.org>
1305 Unreviewed. Added more tests for api/report to ensure it creates tests, metrics, test_runs,
1306 and run_iterations. Also fixed a typo in report.php found by new tests.
1308 * public/api/report.php:
1309 (main): Fix a bug in the regular expression to wrap numbers with double quotations.
1310 * tests/api-report.js: Added more test cases.
1312 2013-03-12 Ryosuke Niwa <rniwa@webkit.org>
1314 <rdar://problem/13399038> SafariPerfMonitor: Need integration tests
1316 Reviewed by Ricky Mondello.
1318 Add a test runner script and some simple test cases.
1320 * database/config.json: Added the configuration for "testServer".
1321 * database/database-common.js:
1322 (pathToTests): Added.
1323 * run-tests.js: Added.
1326 (confirmUserWantsDatabaseToBeInitializedIfNeeded): Checks whether there are any non-empty tables,
1327 and if there are, asks the user if it’s okay to delete all of the data contained therein.
1328 (confirmUserWantsDatabaseToBeInitializedIfNeeded.findNonEmptyTable): Find a table with non-zero
1330 (confirmUserWantsDatabaseToBeInitializedIfNeeded.fetchTableNames): Fetch the list of all tables
1331 in the current database using PostgreSQL's information_schema.
1332 (askYesOrNoQuestion):
1334 (initializeDatabase): Executes init-database.sql. It drops all tables and creates them again.
1336 (TestEnvironment): The global object exposed in tests. Provides various utility functions.
1337 (TestEnvironment.assert): Exposes assert to tests.
1338 (TestEnvironment.console): Exposes console to tests.
1339 (TestEnvironment.describe): Adds a description.
1340 (TestEnvironment.it): Adds a test case.
1341 (TestEnvironment.postJSON):
1342 (TestEnvironment.queryAndFetchAll):
1343 (TestEnvironment.sha256):
1344 (TestEnvironment.notifyDone): Ends the current test case.
1348 (TestContext): An object created for each test case. Conceptually, this object is always on
1349 "stack" when a test case is running. TestEnvironment and an uncaughtException handler accesses
1350 this object via currentTestContext.
1351 (TestContext.description):
1353 (TestContext.logError):
1356 * tests/api-report.js: Added some basic tests for /api/report.php.
1358 2013-03-08 Ryosuke Niwa <rniwa@webkit.org>
1360 Unreviewed administrative page fix. Make it possible to remove all configuration from dashboard.
1362 The problem was that we were detecting whether we're updating dashboard or not by checking
1363 the existence of metric_configurations in $_POST but this key doesn't exist when we're removing
1364 all configurations. Use separate 'dashboard' action to execute the code even when
1365 metric_configurations is empty.
1367 * public/admin/tests.php:
1369 2013-03-08 Ryosuke Niwa <rniwa@webkit.org>
1371 SafariPerfMonitor: Extract a class to aggregate and store values from ReportProcessor.
1373 Reviewed by Ricky Mondello.
1375 This patch extracts TestRunsGenerator, which aggregates and compute caches of values,
1376 from ReportProcessor as a preparation to replace deprecated aggregate.js.
1378 * public/api/report.php:
1379 (ReportProcessor::exit_with_error): Moved.
1380 (ReportProcessor::process): Use the extracted TestRunsGenerator.
1381 (TestRunsGenerator): Added.
1382 (TestRunsGenerator::exit_with_error): Copied from ReportProcessor.
1383 (TestRunsGenerator::add_aggregated_metric): Moved.
1384 (TestRunsGenerator::add_values_for_aggregation): Moved. Made public.
1385 (TestRunsGenerator::aggregate): Moved. Made public.
1386 (TestRunsGenerator::aggregate_current_test_level): Moved.
1387 (TestRunsGenerator::test_value_list_to_values_by_iterations): Moved.
1388 (TestRunsGenerator::evaluate_expressions_by_node): Moved.
1389 (TestRunsGenerator::compute_caches): Moved. Made public.
1390 (TestRunsGenerator::add_values_to_commit): Moved. Made public.
1391 (TestRunsGenerator::commit): Moved. Made public. Also takes build_id and platform_id.
1392 (TestRunsGenerator::rollback_with_error): Moved.
1394 2013-03-08 Ryosuke Niwa <rniwa@webkit.org>
1396 SafariPerfMonitor: Administrative pages should update manifest JSON as needed.
1398 Reviewed by Remy Demarest.
1400 Regenerate the manifest file when updating fields or adding new items that are included in
1403 * public/admin/bug-trackers.php:
1404 * public/admin/builders.php:
1405 * public/admin/regenerate-manifest.php:
1406 * public/admin/repositories.php:
1407 * public/admin/tests.php:
1408 * public/include/admin-header.php:
1409 (regenerate_manifest): Extracted from regenerate-manifest.php.
1411 2013-03-08 Ryosuke Niwa <rniwa@webkit.org>
1413 Unreviewed build fix for memory test results.
1415 Make aggregation work in the nested cases. We start from the "leaf" tests and move our ways up,
1416 aggregating at each level.
1418 * public/api/report.php:
1419 (ReportProcessor::recursively_ensure_tests):
1420 (ReportProcessor::add_aggregated_metric): Renamed from ensure_aggregated_metric.
1421 (ReportProcessor::add_values_for_aggregation):
1422 (ReportProcessor::aggregate):
1423 (ReportProcessor::aggregate_current_test_level): Extracted from aggregate.
1425 2013-03-02 Ryosuke Niwa <rniwa@webkit.org>
1427 Build fixes. iteration_count_cache should be the total number of values in all iteration group,
1428 not the number of iteration groups. Also, don't set group number when the entire run belongs
1429 a single iteration group.
1431 * public/api/report.php:
1432 (ReportProcessor::commit):
1434 2013-03-01 Ryosuke Niwa <rniwa@webkit.org>
1436 SafariPerfMonitor: Introduce iteration groups
1438 Reviewed by Remy Demarest.
1440 In WebKit land, we're going to use multiple instances of DumpRenderTree or WebKitTestRunner to amortize
1441 the runtime environment variances to get more stable results. And it's desirable to keep track of
1442 the instance of DumpRenderTree or WebKitTestRunner used to generate each iteration value.
1444 This patch introduces "iteration groups" to keep track of this extra information.
1446 Instead of receiving a flat array of iteration values, we can now receive a two dimensional array where
1447 the outer array denotes iteration groups and each inner array contains iteration values for each group.
1450 * database/init-database.sql: Add iteration_group column.
1451 * public/api/report.php:
1452 (ReportProcessor::recursively_ensure_tests): Always use the two dimensional array internally.
1454 (ReportProcessor::aggregate): test_value_list_to_values_by_iterations now returns an associative array
1455 contains the list of values indexed by the iteration order and group sizes. Store the group size so
1456 that we can restore the iteration groups before passing it to node.js and restore them later.
1458 (ReportProcessor::test_value_list_to_values_by_iterations): Flatten iteration groups into an array
1459 of values and construct group_size array to restore the groups later in ReportProcessor::aggregate.
1461 Also check that each iteration group in each subtest are consistent with one another. To see why we need
1462 to do this, suppose we're aggregating two tests T1 and T2 with the following values. Then it's important
1463 that each iteration group in T1 and T2 have the same size:
1464 T1 = [[1, 2], [3, 4, 5]]
1465 T2 = [[6, 7], [8, 9, 10]]
1467 so that the aggregated result (the sum in this case) can have the same groups as in:
1468 T = [[7, 9], [11, 13, 15]]
1470 If some iteration groups in T1 and T2 had a different size as in:
1471 T1 = [[1, 2, 3], [4, 5]]
1472 T2 = [[6, 7], [8, 9, 10]]
1474 Then iteration groups of the aggregated T is ambiguous.
1476 (ReportProcessor::compute_caches): Flatten iteration groups to compute caches (e.g. mean, stdev, etc...)
1477 (ReportProcessor::commit): Store iteration_group values.
1479 2013-03-01 Ryosuke Niwa <rniwa@webkit.org>
1481 Unreviewed. Delete the migration tool for webkit-perf.appspot.com now that we have successfully
1482 migrated to perf.webkit.org.
1484 * database/perf-webkit-migrator.js: Removed.
1486 2013-03-01 Ryosuke Niwa <rniwa@webkit.org>
1488 Build fix. Don't forget to add metrics of the top level tests e.g. Dromaeo:Time:Arithmetic.
1490 * public/index.html:
1493 2013-03-01 Ryosuke Niwa <rniwa@webkit.org>
1495 SafariPerfMonitor: Make it possible to add charts for all subtests or all platforms.
1497 Reviewed by Ricky Mondello.
1499 It is often desirable to see charts of a given test for all platforms, or to be able to see
1500 charts of all subtests on a given platform when trying to triage perf. regressions.
1502 Support this use case by adding the ability to do so on the charts page.
1504 Also, we used to disable items on the test list based on the platform chosen. This turned out
1505 to be a bad UI because in many situations you want to be able to compare results of the same test
1506 on multiple platforms.
1508 In this new UI, we have three select elements, each of which selects the following:
1509 1. Top-level test - Test suite such as Dromaeo
1510 2. Metric - Pages and subtests under the suite such as www.webkit.org for dom-modify:Runs
1511 (where dom-modify is the name of the subtest and Runs is a metric in that subtest) for Dromaeo.
1512 3. Platform - Mountain Lion, Qt, etc...
1514 A user can select "all" for metric and platform but we disallow doing both at once since adding
1515 all metrics on all platforms tends to add way too many charts and hang the browser. I also can't
1516 think of a use case where you want to look at that many charts at once. We can support this later
1517 if valid use cases come up.
1519 * public/index.html:
1520 (.showCharts.addOption): Extracted.
1521 (.showCharts): Added "metricList" that shows the list of test and metrics (in the form of
1522 relative metrics paths such as "DOMWalk:Time") for each top-level test selected in testList.
1523 metricList has onchange handler that enables/disables items on platformList.
1525 (init): Sort tests and test metrics here instead of doing that in showCharts.
1527 2013-02-28 Ryosuke Niwa <rniwa@webkit.org>
1529 <rdar://problem/13316756> SafariPerfMonitor: tooltip should include a link to build URLs
1531 Reviewed by Remy Demarest and Ricky Mondello.
1533 Added a hyperlink to build page in tooltips. Repeating the entire build URL in each build
1534 was a bad idea because it bloats the resultant JSON file too much. So move the build URL
1535 templates to the manifest file instead. Each build now only contains the builder id.
1537 * public/api/runs.php: Removed the part of the query that joined builders table. This
1538 speeds up the query quite a bit.
1540 * public/include/manifest.php:
1541 (ManifestGenerator::generate): Generate builders field.
1542 (ManifestGenerator::builders): Added. Returns an associative array of builder ids to an
1543 associative array that contains name and its build URL template.
1545 * public/index.html:
1546 (.buildLabelWithLinks.linkifyIfNotNull): Renamed from linkifiedLabel. Take a label and url
1547 instead of a revision since this function is used for revisions and build page URLs now.
1548 (.buildLabelWithLinks): Include the linkified build number.
1550 * public/js/helper-classes.js:
1551 (TestBuild.builder): Added.
1552 (TestBuild.buildNumber): Added.
1553 (TestBuild.buildUrl): Returns the build URL. The variable name in the URL template has been
1554 changed from %s to $buildNumber to be more descriptive and consistent with other URL templates.
1556 2013-02-27 Ryosuke Niwa <rniwa@webkit.org>
1558 Tooltips interfere with user interactions
1560 Rubber-stamped by Simon Fraser.
1562 Disable tooltip on the dashboard page since graphs are too small to be useful there.
1563 Also, show graphs for only 10 days by default as opposed to 20.
1564 Finally, dismiss the hovering tooltip when mouse enters a "pinned" tooltip.
1566 * public/index.html:
1567 * public/js/helper-classes.js:
1569 2013-02-24 Ryosuke Niwa <rniwa@webkit.org>
1571 Fix some serious typo. We're supposed to be using SHA-256, not SHA-1 to hash our passwords,
1572 to be compatible with webkit-perf.appspot.com.
1574 * public/admin/builders.php:
1575 * public/api/report.php:
1577 2013-02-23 Ryosuke Niwa <rniwa@webkit.org>
1581 Add a missing constraint on builds table. For a given builder, there should be exactly
1582 one build for a given build number.
1584 Also add report_committed_at to reports table to record the time at which a given report
1585 was processed and test_runs and run_iterations rows were committed into the database.
1587 * database/config.json:
1588 * public/api/report.php:
1590 2013-02-22 Ryosuke Niwa <rniwa@webkit.org>
1592 Unreviewed. Add more checks for empty SQL query results.
1594 * public/include/manifest.php:
1596 2013-02-21 Ryosuke Niwa <rniwa@webkit.org>
1598 More build fixes on perf.webkit.org.
1600 * public/api/runs.php: Make PostgreSQL happier.
1601 * public/include/manifest.php: Don't assume we always have bug trackers.
1603 2013-02-21 Ryosuke Niwa <rniwa@webkit.org>
1605 SafariPerfMonitor: index.html duplicates the code in PerfTestRuns to determine smallerIsBetter
1606 and fix other miscellaneous UI bugs.
1608 Rubber-stamped by Simon Fraser.
1610 Removed the code to determine whether smaller value is better or not for a given test in index.html
1611 in the favor of using that of PerfTestRuns.
1613 * public/include/manifest.php: Fixed a typo.
1614 * public/index.html:
1616 (Chart.attachMainPlot): Fixed a bug to access previousPoint.left even when previousPoint is null.
1618 * public/js/helper-classes.js:
1619 (PerfTestRuns): Added EndAllocations, MaxAllocations, and MeanAllocations.
1621 (PerfTestRuns.computeScalingFactorIfNeeded): When the mean is almost 10,000 units, we may end up
1622 using 5 digits instead of 4, resulting in the use of scientific notations. Go up to the next unit
1623 at roughly 2,000 units to avoid this.
1625 (Tooltip.show): Show the tooltip even when the new content is identical to the previous content.
1626 The only thing we can avoid is innerHTML.
1628 2013-02-21 Ryosuke Niwa <rniwa@webkit.org>
1630 Another build fix. The path to node is /usr/local/bin/node, not /usr/bin/local/node
1632 * public/include/evaluator.js:
1634 2013-02-21 Ryosuke Niwa <rniwa@webkit.org>
1636 <rdar://problem/13267898> SafariPerfMonitor: Bug trackers should be configurable
1638 Reviewed by Remy Demarest.
1640 Made the list of bug trackers configurable. Namely, each bug tracker can be added in
1641 admin/bug-trackers.php and can be associated with multiple repositories.
1643 The association between bug trackers and repositories (such as WebKit, Safari, etc...) are used
1644 to determine the set of bug trackers to show for a given set of blame lists.
1645 e.g. if a test regressed due to a change in Safari, then we don't want to show WebKit Bugzilla as
1646 a place to file bugs against the regression.
1648 * database/init-database.sql: Added bug_trackers and tracker_repositories.
1649 Also drop those tables before creating them (note "DROP TABLE reports" was missing).
1651 * public/admin/bug-trackers.php: Added. The administrative interface for adding and managing
1652 bug trackers, namely associated repositories.
1654 * public/include/admin-header.php: Added a link to bug-trackers.php
1655 * public/include/manifest.php:
1656 (ManifestGenerator::generate): Include the list of bug trackers in the manifest.
1657 Also moved the code to fetch repositories table here from ManifestGenerator::repositories.
1659 (ManifestGenerator::repositories):
1661 (ManifestGenerator::bug_trackers): Added. Generates an associative array of bug trackers where
1662 keys are names of bug trackers and values are associative arrays with keys 'new_bug_url' and
1663 'repositories' where the latter contains the list of associated repository names.
1665 * public/index.html:
1666 (Chart): Takes bugTrackers as as argument.
1667 (Chart.showTooltipWithResults): Removed the hard-coded list.
1669 (init.addPlatformsToDashboard):
1670 (init.showCharts.createChartFromListPair):
1671 (init): Stores the list of bug trackers in the manifest to a local variable.
1673 2013-02-21 Ryosuke Niwa <rniwa@webkit.org>
1675 A follow up on the previous build fix. When using proc_open, we need to make evalulator.js executable.
1677 * public/include/evaluator.js:
1679 2013-02-21 Ryosuke Niwa <rniwa@webkit.org>
1681 SafariPerfMonitor: Extract the code to generate tabular view in administrative pages
1683 Reviewed by Remy Demarest.
1685 Extracted AdministrativePage to share the code to generate a tabular view of data and a form to insert
1686 new row into the database.
1688 * public/admin/aggregators.php: Use AdministrativePage.
1689 * public/admin/builders.php: Ditto.
1690 * public/admin/repositories.php: Ditto.
1691 * public/include/admin-header.php:
1692 (AdministrativePage): Added.
1693 (AdministrativePage::__construct): column_info is an associative array that maps a SQL column name
1694 to an associative array that describes the column.
1695 - editing_mode: Specifies the type of form ('text', 'url', or 'string') to show for this column.
1696 - label: Human readable name of the column.
1697 - pre_insertion: Signifies that this column exists only before the row is inserted. e.g. password
1698 column exists only before we create password_hash column at the insertion time.
1700 (AdministrativePage::name_to_titlecase): Converts an underscored lowercase name to a human readable
1701 titlecase (e.g. new_bug is converted to New Bug).
1702 (AdministrativePage::column_label): Obtains the label specified in column_info or titlecased column name.
1703 (AdministrativePage::render_form_control_for_column): "Renders" a text form control such as input and
1704 textarea for a given editing mode ('text', 'url', or 'string').
1705 (AdministrativePage::render_table): Renders a whole SQL table after sorting rows by the specified column.
1706 (AdministrativePage::render_form_to_add): Renders a form to insert new row.
1708 2013-02-20 Ryosuke Niwa <rniwa@webkit.org>
1710 Build fix. Some systems don't support r+. Use proc_open instead.
1712 * public/api/report.php:
1714 2013-02-15 Ryosuke Niwa <rniwa@webkit.org>
1716 Build fix. Use the mean data series as supposed to upper or lower confidence bounds
1717 when computing the y-axis of data points to show tooltips at.
1719 * public/index.html:
1721 2013-02-15 Ryosuke Niwa <rniwa@webkit.org>
1723 Unreviewed. Removed .htaccess in favor of directly putting directives in httpd.conf.
1726 * public/.htaccess: Removed.
1728 2013-02-14 Ryosuke Niwa <rniwa@webkit.org>
1732 * public/include/manifest.php: Build fix. db is on this.
1733 * public/js/statistics.js:
1734 (Statistics.confidenceInterval): Added. An utility function for debugging purposes.
1736 2013-02-13 Ryosuke Niwa <rniwa@webkit.org>
1738 <rdar://problem/13165667> SafariPerfMonitor doesn't work on perf.webkit.org (Part 2)
1740 Reviewed by Anders Carlsson.
1742 Rewrote and merged populate-from-report.js into report.php.
1744 * database/config.json: Added a path to node.js.
1746 * database/init-database.sql: Don't require unit to be always present since it's no longer used by the front end.
1747 Once we land this patch and update the administrative pages, we can remove this column.
1749 Also add a new reports table to store JSON reported by builders. We used to store everything in jobs table but
1750 that table is going away once we remove the node.js backend.
1752 * database/populate-from-report.js: Removed.
1753 * public/api/report.php: Added.
1755 (ReportProcessor.__construct):
1756 (ReportProcessor.process):
1758 (ReportProcessor.store_report_and_get_build_data): We store the report into the database as soon as it has been
1759 verified to be submitted by a known builder.
1761 (ReportProcessor.exit_with_error): Store the error message and details in the database if the report had been
1762 stored. If not, then notify that to the client via 'failureStored' in the JSON response.
1763 (ReportProcessor.resolve_build_id): Insert build and build_revisions rows if needed. We don't do this atomically
1764 inside a transaction because there could be multiple reports for a single build, each containing results for
1767 (ReportProcessor.recursively_ensure_tests): Parse a tree of tests and insert tests and test_metrics rows as
1768 needed. It also computes the metrics to aggregate and prepares values to commit via ensure_aggregated_metric,
1769 add_values_to_commit, and add_values_for_aggregation.
1771 (ReportProcessor.is_list_of_aggregators): When a metric is an aggregation, it contains an array of aggregator
1772 names, e.g. ["Arithmetic", "Geometric"], instead of a dictionary of configuration types to their values,
1773 e.g. {Time: {current: [1, 2, 3,]}}. This function detects the former. (Note that dictionary and list are both
1776 (ReportProcessor.ensure_aggregated_metric): Create a metric with aggregator to add it to the list of metrics
1777 to be aggregated in ReportProcessor.aggregate.
1779 (ReportProcessor.add_values_for_aggregation): Called by test metrics with aggregated parent test metrics.
1781 (ReportProcessor.aggregate): Compute results for aggregated metrics. Consider a matrix with rows representing
1782 child tests and columns representing "iterations" for a given aggregated metrics M. Initially, we have values
1783 given for each row (child metrics of M). This function extracts each column (iteration) via
1784 test_value_list_to_values_by_iterations, and feeds it into evaluate_expressions_by_node to get aggregated values
1785 for each column (iteration of M). Finally, it registers those aggregated values to be committed.
1787 Note that we don't want to start a new node.js process for each aggregation, so we accumulate all values to be
1788 aggregated in node.js in $expressions. Each entry in $expressions is a JSON string that contains code and
1789 values to be aggregated. node.js gives us back a list of JSON strings that contain aggregated values.
1791 (ReportProcessor.test_value_list_to_values_by_iterations): See above.
1792 (ReportProcessor.evaluate_expressions_by_node): See above.
1794 (ReportProcessor.compute_caches): Compute cached mean, sum, and square sums for each run we're about to add
1795 using evaluate_expressions_by_node. We can't do this before computing aggregated results since those aggregated
1796 results also need the said caches.
1798 (ReportProcessor.add_values_to_commit):
1800 (ReportProcessor.commit): Add test_runs and run_iterations atomically inside a transaction, rolling back
1801 the transaction as needed if anything goes wrong.
1803 (ReportProcessor.rollback_with_error)
1805 * public/include/db.php:
1806 (Database.prepare_params): Use $values (instead of $placeholders) to compute the current index since
1807 placeholders ($1, $2, etc...) may be split up into multiple arrays given they may not necessarily show up
1808 contiguously in a SQL statement.
1810 (Database.select_or_insert_row): Added. Selects a row if the attempt to insert the same row fails. It
1811 automatically creates a query string from a dictionary of unprefixed column names and table. It returns
1812 a column value of the choice.
1814 (Database.begin_transaction): Added.
1815 (Database.commit_transaction): Added.
1816 (Database.rollback_transaction): Added.
1818 * public/include/evaluator.js: Added.
1819 * public/include/json-header.php:
1820 (exit_with_error): Take error details and merge it with "additional details". This allows report.php to provide
1821 context under which the request failed.
1822 (successful_exit): Merge "additional details".
1823 (set_exit_detail): Added. Sets "additional details" to the JSON returned by exit_with_error or successful_exit.
1824 (merge_additional_details):
1826 2013-02-12 Ryosuke Niwa <rniwa@webkit.org>
1828 SafariPerfMonitor: Add more helper functions to db.php
1830 Reviewed by Remy Demarest.
1832 Added Database::insert_row and array_get to make common database operations easier.
1834 * public/admin/aggregators.php: Use Database::insert_row instead of
1835 execute_query_and_expect_one_row_to_be_affected.
1837 * public/admin/builders.php: Ditto.
1839 * public/admin/tests.php: Ditto; We used to run a separate SELECT query just to get the id after
1840 inserting a row. With insert_row, we don't need that.
1842 * public/include/admin-header.php: Ditto.
1844 * public/include/db.php:
1845 (array_get): Added. It returns the value of an array given a key if the key exists; otherwise
1846 return the default value (defaults to NULL) if the key doesn't exist.
1848 (Database::column_names): Added. Prefixes an array of column names and creates a comma separated
1851 (Database::prepare_params): Added. Takes an associative array of column names and their values,
1852 and builds up arrays for placeholder (e.g. $1, $2, etc...) and values, then returns an array of
1853 column names all in the same order.
1855 (Database::insert_row): Added. Inserts a new row into the specified table where column names have
1856 the given prefix. Values are given in a form of an associative array where keys are unprefixed
1857 column names and values are corresponding values. When the row is successfully inserted, it returns
1858 the specified column's value (defaults to prefix_id). If NULL is specified, it returns a boolean
1859 indicating the success of the insertion.
1861 2013-02-11 Ryosuke Niwa <rniwa@webkit.org>
1863 <rdar://problem/13165667> SafariPerfMonitor doesn't work on perf.webkit.org (Part 1)
1865 Reviewed by Conrad Shultz.
1867 Rewrote the manifest generator in PHP.
1869 * database/generate-manifest.js: Removed.
1870 * public/admin/regenerate-manifest.php: Added. Use ManifestGenerator to generate and store the manifest.
1871 * public/include/db.php:
1872 (array_ensure_item_has_array): Added.
1873 * public/include/evaluator.js: Added.
1874 * public/include/json-header.php:
1875 * public/include/manifest.php: Added.
1877 2013-02-11 Ryosuke Niwa <rniwa@webkit.org>
1879 Dates on overflow plot are overlapping
1881 Rubber-stamped by Simon Fraser.
1883 Don't show more than 5 days.
1885 * public/index.html:
1886 * public/js/helper-classes.js:
1887 (TestBuild.UTCtoPST):
1890 2013-02-07 Ryosuke Niwa <rniwa@webkit.org>
1892 Show build time as well as commit time on the dashboard and tooltips.
1894 Rubber-stamped by Simon Fraser.
1896 Include both the maximum commit time and build time in buildLabelWithLinks.
1897 Also use ISO format to save the screen real estate.
1899 * public/index.html:
1900 (buildLabelWithLinks):
1901 * public/js/helper-classes.js:
1903 (TestBuild.buildTime):
1904 (TestBuild.formattedBuildTime):
1906 2013-02-08 Ryosuke Niwa <rniwa@webkit.org>
1908 Unreviewed; Convert metric.name to metric.unit in the front end.
1910 * public/js/helper-classes.js:
1912 2013-02-07 Ryosuke Niwa <rniwa@webkit.org>
1914 <rdar://problem/13166276> SafariPerfMonitor: Need hyperlinks to file bugs
1916 Rubber-stamped by Simon Fraser.
1918 This patch adds hyperlinks to file new bugs on Radar and WebKit Bugzilla. Because we want to include information
1919 such as the degree of progression or regression and the regression ranges when filing new bugs, broke various
1920 label() functions into smaller pieces to be used in both generating tooltips and the hyperlinks.
1922 * public/index.html:
1923 (.buildLabelWithLinks): Extracted from TestBuild.label.
1924 (.showTooltipWithResults): Extracted from Tooltip.show. Also added the code to generate hyperlinks to file new bugs
1925 on Radar and WebKit Bugzilla.
1926 * public/js/helper-classes.js:
1927 (PerfTestResult.metric): Replaced test() as runs.test() no longer exists.
1928 (PerfTestResult.isBetterThan): Added.
1929 (PerfTestResult.formattedRelativeDifference): Extracted from PerfTestResult.label.
1930 (PerfTestResult.formattedProgressionOrRegression): Ditto. Also use "better" and "worse" instead of arrow symbols
1931 to indicate progressions or regressions.
1932 (PerfTestResult.label):
1933 (TestBuild.formattedTime): Added.
1934 (TestBuild.platform): Added.
1935 (TestBuild.formattedRevisions): Extracted from TestBuild.label. Merged a part of linkifyLabel.
1936 (TestBuild.smallerIsBetter): Added.
1937 (Tooltip.show): Take a raw markup instead of two results.
1939 2013-02-06 Ryosuke Niwa <rniwa@webkit.org>
1941 <rdar://problem/13151520> SafariPerfMonitor: Dashboard can cause excessive horizontal scrolling when there are many platforms
1943 Rubber-stamped by Tim Horton.
1945 Stack platforms when there are more than 3 of them since making the layout adaptive is tricky
1946 since each platform may have a different number of tests to be shown on the dashboard.
1948 * public/index.html:
1950 2013-02-05 Ryosuke Niwa <rniwa@webkit.org>
1952 Build fix. Don't prefix a SVn revision with 'r' when constructing a changeset / blame URL.
1954 * public/js/helper-classes.js:
1957 2013-02-05 Ryosuke Niwa <rniwa@webkit.org>
1959 SafariPerfMonitor: repository names or revisions are double-quoted when they contain a space
1961 Rubber-stamped by Tim Horton.
1963 The bug was in the PHP code that parsed Postgres array. Trim double quotations as needed.
1965 Also fixed a bug in TestBuild where we used to show the revision range as r1234-1250 when
1966 the revision r1234 was the revision used in the previous build.
1968 * public/api/runs.php:
1969 (parse_revisions_array): Trim double quotations around repository names and revisions.
1970 * public/js/helper-classes.js:
1973 2013-02-05 Ryosuke Niwa <rniwa@webkit.org>
1975 <rdar://problem/13151558> SafariPerfMonitor: Tooltip is unusable
1977 Rubber-stamped by Tim Horton.
1979 * public/index.html:
1980 (Chart.attachMainPlot): Disable auto highlighting (circle around a data point that shows up on hover)
1981 on the dashboard page as it's way too noisy.
1983 (Chart.hideTooltip): Added. Hides the tooltip that shows up on hover.
1985 (.toggleClickTooltip): Extracted from the code for "mouseout" bind (now replaced by "mouseleave").
1986 Pins or unpins a tooltip. When pinning a tooltip, we create a tooltip behind the scene and show that
1987 so that the tooltip for hover can be reused further.
1989 (.closestItemForPageX): Find the closest item given pageX. We iterate data points from left to right,
1990 and find the first point that lies on the right of the cursor position. We then compute the midpoint
1991 between this and the previous point and pick the closer of the two. It returns an item-like object
1992 that has all properties we need since flot doesn't provide an API to retrieve the real item object.
1994 (Chart): Call toggleClickTooltip when a (hover) tooltip is clicked.
1996 (Chart.attach): In "plothover" bind, call closestItemForPageX when item is not provided by flot on
1997 the first or "current" data points (as opposed to target or baseline data points).
1999 Also bind the code to clear crosshair and hide tooltips to "mouseleave" instead of "mouseout", and
2000 avoid triggering this code when the cursor is still within the plot's rectangle (e.g. when a cursor
2001 moves onto a tooltip) to avoid the premature dismissal of a tooltip.
2003 * public/js/helper-classes.js:
2004 (Tooltip.ensureContainer): Don't automatically close then the user clicks on tooltip. Delegate this
2005 work to the client via bindClick.
2007 (Tooltip.show): Move tooltip up by 5px. Also added a FIXME to move this offset computation to the client.
2009 (Tooltip.bindClick): Added.
2011 2013-02-03 Ryosuke Niwa <rniwa@webkit.org>
2013 Yet another build fix. metricId*s*.
2015 * public/admin/tests.php:
2017 2013-02-03 Ryosuke Niwa <rniwa@webkit.org>
2019 Another build fix. Use the new payload format for the aggregate job.
2021 * public/admin/tests.php:
2023 2013-02-03 Ryosuke Niwa <rniwa@webkit.org>
2027 * database/aggregate.js: Use variables that actually exist.
2028 * database/database-common.js:
2029 (ensureConfigurationIdFromList): Add the newly added configuration to the list so that subsequent
2030 function calls will find this configuration.
2032 2013-01-31 Ryosuke Niwa <rniwa@webkit.org>
2034 <rdar://problem/13130139> SafariPerfMonitor: Add ReadMe
2036 Reviewed by Ricky Mondello.
2038 Turned InstallManual into a proper markdown document and added ReadMe.md.
2040 * InstallManual: Removed.
2041 * InstallManual.md: Moved from InstallManual.
2044 2013-01-31 Ryosuke Niwa <rniwa@webkit.org>
2046 <rdar://problem/13109335> SafariPerfMonitor: Add baseline and target lines
2048 Reviewed by Ricky Mondello.
2050 This patch prepares the front end code to process baseline and target results properly.
2052 * public/index.html:
2053 (fetchTest.createRunAndResults): Extracted.
2054 (fetchTest): Call createRunAndResults on current, baseline, and target values of the JSON.
2055 Deleted the comment about how sorting will be unnecessary once we start results in the server side
2056 since sorting by the maximum revision commit time turned out to be non-trivial in php.
2058 2013-01-29 Ryosuke Niwa <rniwa@webkit.org>
2060 <rdar://problem/13057071> SafariPerfMonitor: Use newer version of flot that supports timezone properly
2062 Reviewed by Tim Horton.
2064 Use flot at https://github.com/flot/flot/commit/ec168da2cb8619ebf59c7e721d12c44a7960ff41.
2065 These files are "dynamically linked" to our app.
2067 * public/index.html:
2068 * public/js/jquery-1.8.2.min.js: Removed.
2069 * public/js/jquery.colorhelpers.js: Added.
2070 * public/js/jquery.flot.categories.js: Added.
2071 * public/js/jquery.flot.crosshair.js: Added.
2072 * public/js/jquery.flot.errorbars.js: Added.
2073 * public/js/jquery.flot.fillbetween.js: Added.
2074 * public/js/jquery.flot.js: Added.
2075 * public/js/jquery.flot.min.js: Removed.
2076 * public/js/jquery.flot.navigate.js: Added.
2077 * public/js/jquery.flot.resize.js: Added.
2078 * public/js/jquery.flot.selection.js: Added.
2079 * public/js/jquery.flot.stack.js: Added.
2080 * public/js/jquery.flot.symbol.js: Added.
2081 * public/js/jquery.flot.threshold.js: Added.
2082 * public/js/jquery.flot.time.js: Added.
2083 * public/js/jquery.js: Added.
2085 2013-01-29 Ryosuke Niwa <rniwa@webkit.org>
2087 Return NaN instead of throwing when there aren't enough samples.
2089 Reviewed by Sam Weinig.
2091 It's better to return NaN when we don't have enough samples so that we can treat it
2092 as if we don't have any confidence interval.
2094 * public/js/statistics.js:
2097 2013-01-28 Ryosuke Niwa <rniwa@webkit.org>
2099 Build fix. Apparently Safari sometimes appends / at the end of hash location. Remove that.
2101 * public/js/helper-classes.js:
2102 (URLState.parseIfNeeded):
2104 2013-01-28 Ryosuke Niwa <rniwa@webkit.org>
2106 <rdar://problem/13081582> SafariPerfMonitor: Always use parameterized SQL functions in php code
2108 Reviewed by Ricky Mondello.
2110 Parameterized execute_query_and_expect_one_row_to_be_affected and updated the code accordingly.
2112 * public/admin/aggregators.php: Use heredoc.
2113 * public/admin/builders.php:
2114 * public/admin/jobs.php:
2115 * public/admin/repositories.php:
2116 * public/admin/tests.php: Updated the forms to use unprefixed field names to match other pages.
2117 This allows us to use update_field when updating test's url and metric's unit. Changed the action
2118 to regenerate aggregated matrix from "update" to "add" to simplify the dependencies in if-else.
2119 Also removed a stray code to update unit and url simultaneously since it's never used.
2120 * public/include/admin-header.php:
2121 (execute_query_and_expect_one_row_to_be_affected): Added $params. Also automatically convert
2122 empty strings to NULL as it was previously done via $db->quote_string_or_null_if_empty in callers.
2123 (update_field): Moved from repositories.php.
2125 * public/include/db.php:
2126 (quote_string_or_null_if_empty): Removed now that nobody uses this function.
2128 2013-01-25 Ryosuke Niwa <rniwa@webkit.org>
2130 Build fixes. Treat mean, sum, and square sum as float, not int.
2132 Also use 95% confidence interval instead of 90% confidence interval.
2134 * public/api/runs.php:
2135 * public/js/helper-classes.js:
2136 (.this.confidenceIntervalDelta):
2138 2013-01-24 Ryosuke Niwa <rniwa@webkit.org>
2140 Add an administrative page to edit repository information.
2142 Reviewed by Ricky Mondello.
2144 * public/admin/repositories.php: Added.
2145 * public/include/admin-header.php:
2147 2013-01-23 Ryosuke Niwa <rniwa@webkit.org>
2149 <rdar://problem/13067539> SafariPerfMonitor: Automatically create aggregated metrics from builder reports
2151 Reviewed by Ricky Mondello.
2153 Auto-create aggregated matrix such as arithmetic means and geometric means as requested and add a job
2154 to aggregate results for those matrix in populate-from-report.js.
2156 * database/generate-manifest.js:
2157 (.): Include aggregator names such as Arithmetic and Geometric in the list of metrics.
2158 * database/init-database.sql: Remove an erroneous unique constraint. There could be multiple matrix that share
2159 the same test and name (e.g. Dromaeo, Time) with different aggregators (e.g. Arithmetic and Geometric).
2160 * database/populate-from-report.js:
2162 (getReport): No change even though the diff looks as if it moved.
2163 (processReport): Extracted from main. Fetch the list of aggregators, pass that to recursivelyEnsureTestsIdsAndMetricsIds
2164 to obtain the list of aggregated metrics (such as arithmetic means) that need to be passed to aggregate.js
2165 (scheduleJobs): Extracted from processReport. Add a job to aggregate results.
2166 (recursivelyEnsureTestsIdsAndMetricsIds): When a metric is a list of names, assume them as aggregator names,
2167 and add corresponding metrics for them. Note we convert those names to ids using the dictionary we obtained
2169 (ensureMetricId): Take an aggregator id as an argument.
2170 * database/process-jobs.js: Support multiple metric ids and build id. Note that aggregate.js aggregates results
2171 for all builds when the build id is not specified.
2172 * public/admin/tests.php:
2173 * public/index.html: Include the aggregator name in the full name since there could be multiple metrics
2174 of the same name with different aggregators.
2176 2013-01-22 Ryosuke Niwa <rniwa@webkit.org>
2178 Build fix. Don't pass in arguments to in the wrong order.
2180 * database/aggregate.js:
2182 2013-01-21 Ryosuke Niwa <rniwa@webkit.org>
2184 <rdar://problem/13057110> SafariPerfMonitor: x-axis is messed up
2186 Reviewed by Ricky Mondello.
2188 Since the version of flot we use doesn't support showing graphs in the current locate or
2189 in a specific timezone, convert all timestamps to PST manually (Date's constructor will still
2190 treat them as in UTC). We don't want to use the current locate because other websites on
2191 webkit.org assume PST.
2193 Also append this information to build's label.
2195 * public/js/helper-classes.js:
2199 2013-01-21 Ryosuke Niwa <rniwa@webkit.org>
2201 Store test URLs reported by builders.
2203 Reviewed by Ricky Mondello.
2205 * database/populate-from-report.js:
2206 (recursivelyEnsureTestsIdsAndMetricsIds): Pass in the test url.
2207 (ensureTestId): Store the URL.
2209 2013-01-20 Ryosuke Niwa <rniwa@webkit.org>
2211 Yet another build fix; don't blow up even if we didn't have any test configurations.
2213 * public/admin/tests.php:
2215 2013-01-21 Ryosuke Niwa <rniwa@webkit.org>
2217 Build fix; don't instantiate Date when a timestamp wasn't provided.
2219 * database/populate-from-report.js:
2221 2013-01-18 Ryosuke Niwa <rniwa@webkit.org>
2223 Rename SafariPerfDashboard to SafariPerfMonitor and add a install manual.
2225 Reviewed by Tim Horton.
2227 Added an install manual.
2229 * InstallManual: Added.
2231 2012-12-21 Ryosuke Niwa <rniwa@webkit.org>
2233 Minor build fix. Don't unset builderPassword when it's not set.
2235 * public/api/report.php:
2237 2012-12-18 Ryosuke Niwa <rniwa@webkit.org>
2239 Prettify JSON payloads and make very large payloads not explode the table in jobs.php.
2241 Reviewed by Ricky Mondello.
2243 * public/admin/admin.css: Make a very large payload scrollable.
2244 * public/admin/jobs.php: Format JSONs.
2246 2012-12-19 Ryosuke Niwa <rniwa@webkit.org>
2248 <rdar://problem/12897424> SafariPerfMonitor: Add ability to report results from bots
2250 Reviewed by Ricky Mondello.
2252 Add report.php and populate-from-report.js that process JSON files submitted by builders.
2254 * database/populate-from-report.js: Added.
2256 (getReport): Obtains the payload (the actual report) from "jobs" table.
2257 (recursivelyEnsureTestsIdsAndMetricsIds): "reports.tests" contain a tree of tests, test metrics,
2258 and their results. This function recursively traverses tests and metrics and ensure their ids.
2260 (metricToUnit): Maps a metric name to a unit. This should really be done in the client side since
2261 there is no point in storing unit given that every metric maps to exactly one unit (i.e. the mapping
2262 is a "function" in mathematical sense).
2264 (ensureRepositoryIdsForAllRevisions):
2265 (getIdOrCreateBuildWithRevisions):
2266 (ensureBuildIdAndRevisions): Obtains a build id given a builder name, a build number, and a build time
2267 if one already exists. If not, then inserts a new build and corresponding revisions information (e.g.
2268 build 123 may contain WebKit revision r456789). We don't retrieve rows for revisions since we don't use
2270 (insertRun): Insert new rows into "test_runs" and "run_iterations" tables, thereby recording the new
2271 test results all in a single transaction. This allows us to keep the database consistent in that either
2272 a build has been reported or not at least in "test_runs" and "run_iterations" tables. It'll be ideal if
2273 we could do the same for "builds" and "build_revisions" but that's not a hard requirement as far as
2274 other parts of the application are concerned.
2275 (scheduleQueriesToInsertRun):
2276 * database/process-jobs.js: Add a call to populate-from-report.js.
2277 * public/api/report.php: Added. Adds a new job named "report" to be processed by populate-from-report.js.
2278 * public/include/db.php: Support parameterized query.
2279 * public/include/json-header.php: Always include 'status' in the response so that builder submitting
2280 a test result could confirm that the submission indeed succeeded.
2282 2012-12-18 Ryosuke Niwa <rniwa@webkit.org>
2284 Rename get(Id)OrCreate*(Id) to ensure*Id as suggested by Ricky on one of his code reviews.
2286 * database/aggregate.js:
2287 * database/database-common.js:
2288 (selectColumnCreatingRowIfNeeded):
2289 (ensureRepositoryId):
2290 (ensureConfigurationIdFromList):
2291 * database/perf-webkit-migrator.js:
2294 (getOrCreateBuildId):
2296 2012-12-17 Ryosuke Niwa <rniwa@webkit.org>
2298 Extract commonly-used functions from aggregate.js and perf-webkit-migrator.js.
2300 Reviewed by Ricky Mondello.
2302 As a preparation to add report.js that processes a JSON file submitted by bots, extract various functions
2303 and classes from aggregate.js and perf-webkit-migrator.js to be shared.
2305 * database/aggregate.js: Extracted TaskQueue and SerializedTaskQueue into utility.js.
2308 (saveAggregatedResults):
2309 * database/database-common.js:
2310 (getIdOrCreatePlatform): Extracted from webkit-perf-migrator.js.
2311 (getIdOrCreateRepository): Ditto.
2312 (getConfigurationsForPlatformAndMetrics): Renamed from fetchConfigurations. Extracted from aggregator.js.
2313 (getIdFromListOrInsertConfiguration): Renamed from getOrInsertConfiguration. Extracted from aggregator.js.
2314 * database/perf-webkit-migrator.js:
2315 * database/utility.js: Added.
2316 (TaskQueue): Extracted from aggregator.js. Fixed a bug that prevented tasks added after start() is called
2317 from being executed.
2318 (TaskQueue.startTasksInQueue): Execute remaining tasks without serializing them. If the queue is empty,
2319 call the callback passed into start().
2320 (TaskQueue.taskCallback): The function each task calls back. Decrement the counter and call statTasksInQueue.
2321 (TaskQueue.addTask):
2323 (SerializedTaskQueue): Unlike TaskQueue, this class executes each task sequentially.
2324 (SerializedTaskQueue.executeNextTask):
2325 (SerializedTaskQueue.addTask):
2326 (SerializedTaskQueue.start):
2328 2012-12-18 Ryosuke Niwa <rniwa@webkit.org>
2330 Revert erroneously committed changes.
2332 * database/config.json:
2334 2012-12-18 Ryosuke Niwa <rniwa@webkit.org>
2336 aggregator.js should be able to accept multiple metric ids and a single build id.
2338 Reviewed by Ricky Mondello.
2340 Make aggregator.js accept multiple ids and generate results for single build when bots are
2341 reporting new results.
2343 * database/aggregate.js:
2344 (parseArgv): Added. Returns an object containing the parsed representation of argv,
2345 which currently contains metricIDs and buildIds.
2346 (main): Use parseArgv and processConfigurations
2347 (processPlatform): Use build ids passed in or obtain all builds for the given platform.
2348 (processPlatform.processConfigurations): Extracted.
2350 2012-12-17 Ryosuke Niwa <rniwa@webkit.org>
2352 Add an administrative page for builders.
2354 Reviewed by Ricky Mondello.
2356 We need an administrative page to add and edit builder information.
2357 Also renamed "slaves" to "builders" in order to reduce the amount of technical jargon we use.
2359 * database/init-database.sql: Renamed slaves table to builders. Drop slave_os and slave_spec
2360 since we don't have plans to use those columns in near future. Also make builder_name unique
2361 as required by the rest of the app.
2362 * public/admin/builders.php: Added.
2363 * public/api/runs.php: Updated per the table rename.
2364 * public/include/admin-header.php: Added a link to builders.php.
2366 2012-12-14 Ryosuke Niwa <rniwa@webkit.org>
2368 Build fixes for r46982.
2370 * database/aggregate.js:
2371 (fetchConfigurations): Bind i so that it's not always metricIds.length.
2372 (fetchBuildsForPlatform): Return run_build as build_id since that's what caller expects.
2373 (processBuild): Don't print "." until we've committed transactions. It's misleading.
2375 2012-12-13 Ryosuke Niwa <rniwa@webkit.org>
2377 Unreviewed. Move some php files to public/include as suggested by Mark on a code review.
2379 * public/admin/aggregators.php:
2380 * public/admin/footer.php: Removed.
2381 * public/admin/header.php: Removed.
2382 * public/admin/index.php:
2383 * public/admin/jobs.php:
2384 * public/admin/tests.php:
2385 * public/api/json-header.php: Removed.
2386 * public/api/runs.php:
2387 * public/db.php: Removed.
2388 * public/include: Added.
2389 * public/include/admin-footer.php: Copied from public/admin/footer.php.
2390 * public/include/admin-header.php: Copied from public/admin/header.php.
2391 * public/include/db.php: Copied from public/db.php.
2392 * public/include/json-header.php: Copied from public/api/json-header.php.
2394 2012-12-13 Ryosuke Niwa <rniwa@webkit.org>
2396 <rdar://problem/12822613> SafariPerfMonitor: implement naive value aggregation mechanism
2398 Reviewed by Ricky Mondello.
2400 Added the initial implementation of value aggregation.
2401 Also added abilities to configure the dashboard page in tests.php.
2403 * database/aggregate.js: Added.
2404 (TaskQueue): Added. Execute all tasks at once and waits for those tasks to complete.
2405 (TaskQueue.addTask):
2407 (SerializedTaskQueue): Added. Execute tasks sequentially after one another until all of them are completed.
2408 (SerializedTaskQueue.addTask):
2409 (SerializedTaskQueue.start):
2412 (fetchConfigurations):
2413 (fetchBuildsForPlatform):
2415 (testsWithDifferentIterationCounts):
2416 (aggregateIterationsForMetric): Retrieve run_iterations and aggregate results in memory.
2417 (saveAggregatedResults): Insert into test_runs and test_config in transactions.
2418 (getOrInsertConfiguration):
2420 * database/database-common.js:
2421 (fetchTable): Log an error as an error.
2422 (getOrCreateId): Extracted from perf-webkit-migrator.
2423 (statistics): Added.
2424 * database/perf-webkit-migrator.js:
2425 (migrateTestConfig): Converted units to respective metric names. Also removed the code to add jobs to update
2426 runs JSON since runs JSONs are generated on demand now.
2428 (getOrCreatePlatformId):
2429 (getOrCreateTestId):
2430 (getOrCreateConfigurationId):
2431 (getOrCreateRevisionId):
2432 (getOrCreateRepositoryId):
2433 (getOrCreateBuildId):
2434 * database/process-jobs.js:
2435 (processJob): Handle 'aggregate' type.
2437 2012-12-11 Ryosuke Niwa <rniwa@webkit.org>
2439 Fix the dashboard after adding test_metrics.
2441 Reviewed by Ricky Mondello.
2443 Rename test to metrics in various functions and sort tests on the charts page.
2444 Also representing whether a test appears or not by setting a flag on dashboard
2445 was bogus because test objects are shared by multiple platforms. Instead, store
2446 dashboard platform list as intended by the manifest JSON.
2448 * public/index.html:
2449 (PerfTestRuns): Renamed test to metric.
2451 (showCharts): Ditto; also sort metrics' full names before adding them to the select element.
2452 (fullName): Moved so that it appears above where it's called.
2453 * public/js/helper-classes.js:
2455 2012-12-10 Ryosuke Niwa <rniwa@webkit.org>
2457 Update tests.php to reflect recent changes in the database schema.
2459 Reviewed by Conrad Shultz.
2461 Made the following changes to tests.php:
2462 1. Disallow adding metrics to tests without subtests.
2463 2. Made dashboard configurable by adding checkboxes for each platform on each metric.
2464 3. Linkified tests with subtests instead of showing all them at once.
2466 * public/admin/admin.css:
2467 (.action-field, .notice):
2469 * public/admin/header.php: Specify paths by absolute paths so that tests.php can use PATH_INFO.
2470 (execute_query_and_expect_one_row_to_be_affected): Return a boolean. Used in tests.php while adding test_metrics.
2471 (add_job): Extracted.
2472 * public/admin/tests.php: See above.
2473 (array_item_set_default): Added.
2474 (array_item_or_default): Renamed from get_value_with_default.
2475 (compute_full_name): Extracted.
2476 (sort_tests): Ditto.
2477 (map_metrics_to_tests): Ditto.
2479 2012-12-06 Ryosuke Niwa <rniwa@webkit.org>
2481 <rdar://problem/12832324> SafariPerfMonitor: Linkify test names
2483 Reviewed by Simon Fraser.
2485 Linkify the headers using metric.test.url when it's provided.
2487 * public/index.html:
2489 2012-12-03 Ryosuke Niwa <rniwa@webkit.org>
2491 Use parameterized pg_query_params in query_and_fetch_all
2493 Reviewed by Conrad Shultz.
2495 Address a review comment by Mark by using pg_query_params instead of pg_query in query_and_fetch_all.
2497 * public/api/runs.php:
2499 (ctype_alnum_underscore): Added.
2501 2012-12-04 Ryosuke Niwa <rniwa@webkit.org>
2503 Update the migration tool to support test_metrics.
2505 Reviewed by Mark Rowe.
2507 Updated the migration tool from webkit-perf.appspot.com to support test_metrics.
2508 Also import run_iteration rows as runs JSON files now include individual values.
2510 * database/database-common.js:
2511 (addJob): Extracted.
2512 * database/perf-webkit-migrator.js:
2513 (migrateTestConfig): Interchange the order in which we fetch runs and add configurations
2514 so that we can pass in the metric name and unit to getOrCreateConfigurationId.
2515 (getOrCreateConfigurationId): Updated to add both test configuration and test metric.
2518 2012-12-03 Ryosuke Niwa <rniwa@webkit.org>
2520 Build fix. Suppress "Undefined index" warning.
2522 * public/admin/tests.php:
2524 2012-12-03 Ryosuke Niwa <rniwa@webkit.org>
2526 Fix a commit error in r46756. api/ should obviously be added under public/
2529 * api/json-header.php: Removed.
2530 * api/runs.php: Removed.
2531 * public/api: Copied from api.
2533 2012-12-03 Ryosuke Niwa <rniwa@webkit.org>
2535 SafariPerfMonitor: Linkify revisions and revisions range
2536 <rdar://problem/12801010>
2538 Reviewed by Mark Rowe.
2540 Linkify revisions in TestBuild.label. Pass in manifest.repositories to TestBuild's constructor
2541 since it needs to know "url" and "blameUrl".
2543 Also tweaked the appearance of graphs on charts page to better align graphs when unit names are long.
2545 * public/index.html:
2546 * public/js/helper-classes.js:
2548 (TestBuild.revision): Renamed from webkitRevision. Now returns an arbitrary revision number.
2549 (TestBuild.label): Add labels for all revisions.
2553 2012-12-03 Ryosuke Niwa <rniwa@webkit.org>
2555 Make the generation of "runs" JSON dynamic and support test_metrics.
2557 Reviewed by Mark Rowe.
2559 It turned out that we can fetch all runs for a given configuration in roughly 100-200ms.
2561 Since there could be hundreds, if not thousands, of tests for each configuration and users
2562 aren't necessarily interested in looking at all test results, it's much more efficient to
2563 generate runs JSON dynamically (i.e. polling) upon a request instead of generating all of them
2564 when bots report new results (i.e. pushing).
2566 Rewrote the script to generate runs JSON in php and also supported test_metrics table.
2569 * api/json-header.php: Added. Sets Content-Type and cache policies (10 minutes by default).
2570 (exit_with_error): Added.
2571 (successful_exit): Added.
2572 * api/runs.php: Added. Ported database/database-common.js. It's much shorter in php!
2573 * database/generate-runs.js: Removed.
2574 * database/process-jobs.js: No longer supports "runs".
2575 * public/.htaccess: Added. Always add MultiView so that api/runs can receive a path info.
2576 * public/db.php: Print "Nothing to see here." when it's accessed directly.
2578 * public/index.html: Fetch runs JSONs from /api/runs/ instead of data/.
2580 2012-12-03 Ryosuke Niwa <rniwa@webkit.org>
2582 Update tests.php and sample-data.sql per addition of test_metrics.
2584 Rubber-stamped by Timothy Hatcher.
2586 Remove a useless code from tests.php that used to update the unit and the url of a test
2587 since it's no longer used, and add the UI and the ability to add a new aggregator to a test.
2589 Also update the sample data to reflect the addition of test_metrics.
2591 * database/sample-data.sql:
2592 * public/admin/tests.php:
2594 2012-11-30 Ryosuke Niwa <rniwa@webkit.org>
2596 Share more code between admin pages.
2598 Reviewed by Timothy Hatcher.
2600 Added notice and execute_query_and_expect_one_row_to_be_affected helper functions to share more code
2601 between admin pages.
2603 Also moved the code to connect to the database into header.php to be shared. Admin pages just need
2604 to check the nullity of global $db now.
2606 * public/admin/aggregators.php:
2607 * public/admin/header.php:
2609 (execute_query_and_expect_one_row_to_be_affected): Added.
2610 * public/admin/index.php:
2611 * public/admin/jobs.php:
2612 * public/admin/tests.php:
2614 2012-11-29 Ryosuke Niwa <rniwa@webkit.org>
2616 SafariPerfMonitor: Add admin page to edit aggregators
2617 <rdar://problem/12782687>
2619 Reviewed by Mark Rowe.
2621 Add aggregators.php. It's very simple. We should probably share more code between various admin pages.
2623 * public/admin/aggregators.php: Added.
2624 * public/admin/header.php:
2625 * public/admin/jobs.php: Removed an erroneous hidden input element.
2627 2012-11-28 Ryosuke Niwa <rniwa@webkit.org>
2629 Fix a syntax error in init-database.sql and add the missing drop table at the beginning.
2631 * database/init-database.sql:
2633 2012-11-28 Ryosuke Niwa <rniwa@webkit.org>
2635 SafariPerfMonitor: Allow multiple metrics per test
2636 <rdar://problem/12773506>
2638 Rubber-stamped by Mark Rowe.
2640 Introduce a new table test_metrics. This table represents metrics each test can have
2641 such as time, memory allocation, frame rate as well as aggregation such as arithmetic mean
2644 Updated admin/tests.php and index.html accordingly.
2646 Also create few indexes based on postgres' "explain analysis" as suggested by Mark.
2648 * database/generate-manifest.js:
2649 (buildPlatformMapIfPossible):
2650 * database/generate-runs.js:
2652 * database/init-database.sql:
2653 * database/schema.graffle:
2654 * public/admin/admin.css:
2657 * public/admin/tests.php:
2658 * public/index.html:
2660 2012-11-27 Ryosuke Niwa <rniwa@webkit.org>
2662 SafariPerfMonitor: Improve the webkit-perf migration tool
2663 <rdar://problem/12760882>
2665 Reviewed by Mark Rowe.
2667 Make the migrator tool skip runs when fetching runs failed since webkit-perf.appspot.com is unreliable
2668 and we don't want to pause the whole importation process until the user comes back to decide whether
2671 Also place form controls next to each test in tests.php so that users don't have to scroll all the way
2672 down to make modifications.
2674 Finally, add unique constraint to (run_config, run_build) in test_runs table in order to optimize a query
2675 of the form: "SELECT run_id FROM test_runs WHERE run_config = $1 AND run_build = $2",
2677 * database/init-database.sql:
2678 * database/perf-webkit-migrator.js:
2679 (migrateTestConfig):
2680 * database/schema.graffle:
2681 * public/admin/admin.css:
2683 * public/admin/tests.php:
2685 2012-11-16 Ryosuke Niwa <rniwa@webkit.org>
2687 Create a new performance dashboard
2688 <rdar://problem/12625582>
2690 Rubber-stamped by Mark Rowe.
2692 Add the initial implementation of the perf dashboard.
2695 * database/config.json: Added.
2696 * database/database-common.js: Added.
2701 (pathToLocalScript):
2703 * database/generate-manifest.js: Added.
2706 (buildPlatformMapIfPossible):
2707 (generateFileIfPossible):
2708 * database/perf-webkit-migrator.js: Added.
2709 * database/process-jobs.js: Added.
2710 * database/sample-data.sql: Added.
2711 * database/schema.graffle: Added.
2713 * public/admin: Added.
2714 * public/admin/README: Added.
2715 * public/admin/admin.css: Added.
2716 * public/admin/footer.php: Added.
2717 * public/admin/header.php: Added.
2718 * public/admin/index.php: Added.
2719 * public/admin/jobs.php: Added.
2720 * public/admin/tests.php: Added.
2721 * public/common.css: Added.
2722 * public/data: Added.
2723 * public/db.php: Added.
2724 * public/index.html: Added.
2726 * public/js/helper-classes.js: Added.
2727 * public/js/jquery-1.8.2.min.js: Added.
2728 * public/js/jquery.flot.min.js: Added.
2729 * public/js/jquery.flot.plugins.js: Added.
2730 * public/js/shared.js: Added.
2731 (fileNameFromPlatformAndTest):
2732 * public/js/statistics.js: Added.