1 2015-05-22 Ryosuke Niwa <rniwa@webkit.org>
3 Show results and status before revisions for A/B testing results
4 https://bugs.webkit.org/show_bug.cgi?id=145327
6 Reviewed by Chris Dumez.
8 Place the results and the status columns before the columns for revisions.
9 Also show the absolute difference as well as the relative difference between the averages of A and B.
12 (App.TestGroupPane._populate):
13 (App.TestGroupPane._computeStatisticalSignificance):
14 * public/v2/index.html:
16 2015-05-20 Ryosuke Niwa <rniwa@webkit.org>
18 Build fix after r184591.
20 * public/v2/manifest.js:
22 2015-05-20 Ryosuke Niwa <rniwa@webkit.org>
24 Build fix. Use POSIX timestamp instead of human readable string for the commit time.
26 * public/include/build-requests-fetcher.php:
28 2015-05-20 Ryosuke Niwa <rniwa@webkit.org>
30 UI to associate bugs with an analysis task is crappy
31 https://bugs.webkit.org/show_bug.cgi?id=145198
33 Reviewed by Andreas Kling.
35 Make the UI less crappy by linkifying bug numbers and adding an explicit button to disassociate
36 a bug and a separate select view with a text field to associate a new bug instead of implicitly
37 updating or deleting the existing record based on what the user had typed.
39 * init-database.sql: Removed the constraint that each bug tracker should appear exactly once for
40 a given analysis task since it's perfectly reasonable for a given task to be associated with
43 * public/privileged-api/associate-bug.php:
44 (main): Only remove the bug specified by newly added bugToDelete instead of implicitly deleting
45 one that matches the analysis task and the bug tracker when the bug number is falsey.
47 * public/v2/analysis.js:
49 (App.BugAdapter.deleteRecord): Added. Uses the privileged API to delete the record.
54 (App.AnalysisTaskController.actions.addBug): Added.
55 (App.AnalysisTaskController.actions.deleteBug): Added.
56 (App.AnalysisTaskController.associateBug): Deleted.
58 * public/v2/index.html: Updated the templates.
60 * public/v2/manifest.js:
61 (App.BugTracker.urlFromBugNumber): Added.
63 2015-05-20 Ryosuke Niwa <rniwa@webkit.org>
65 A/B testing rootSets should provide commit times as well as revisions
66 https://bugs.webkit.org/show_bug.cgi?id=145207
68 Reviewed by Andreas Kling.
70 Some continuous build systems need the commit time as well as the revision number / hash so provide one
71 in the root sets but maintain the backwards compatibility with buildbots that use revision number directly.
73 * public/include/build-requests-fetcher.php:
74 (BuildRequestsFetcher::fetch_roots_for_set): Made the revision info an associative array that contains
75 the revision number as well as the commit time.
76 * tools/sync-with-buildbot.py:
77 (schedule_request): Removed "replacement" which was a superfluous copy of "roots". Use "revision" values
78 when the JSON configuration refers to "root". This is necessary in buildbot instances that require WebKit
79 revision to be specified on its own field instead of it being a JSON that contains "revision" and "time".
81 2015-05-19 Ryosuke Niwa <rniwa@webkit.org>
83 Build fix. Don't fall into an infinite loop when value (renamed from bytes) is zero.
85 * public/v2/manifest.js:
86 (App.Manifest.Ember.Controller.extend.):
87 (App.Manifest.Ember.Controller.extend):
89 2015-05-19 Ryosuke Niwa <rniwa@webkit.org>
91 Don't show unit (bytes) separaetly from SI suffixes (K, M, etc...)
92 https://bugs.webkit.org/show_bug.cgi?id=145181
94 Rubber-stamped by Chris Dumez.
96 Show 'MB' in each y-axis label instead of showing 'bytes' separately and suffixing each label with just 'M'
97 for clarity. This change also reduces the code complexity.
101 (App.AnalysisTaskController._chartDataChanged):
102 (App.TestGroupPane._createConfigurationSummary):
104 (RunsData.unitFromMetricName): Use 'B' instead of 'bytes' as the unit.
106 * public/v2/interactive-chart.js: Removed the support for showing units separately.
107 (App.InteractiveChartComponent._constructGraphIfPossible):
108 (App.InteractiveChartComponent._relayoutDataAndAxes)
110 * public/v2/manifest.js:
111 (App.Manifest._makeFormatter): Renamed from _formatBytes. Support more SI suffixes such as micro and mili.
112 Now takes the unit as the first argument. Adjust the base unit if it's 'ms'.
113 (App.Manifest._formatFetchedData): Removed unit and formatWithUnit now that all all formatters would
114 automatically include unit.
116 2015-05-18 Ryosuke Niwa <rniwa@webkit.org>
118 REGRESSION: v2 UI reports a higher memory usage
119 https://bugs.webkit.org/show_bug.cgi?id=145151
121 Reviewed by Chris Dumez.
123 The bug was caused by v2 UI using 1000 to divide the number of bytes instead of by 1024 as done in v1.
124 Fixed the bug by manually implementing the formatter as done in v1.
126 * public/v2/manifest.js:
127 (App.Manfiest._formatBytes): Added.
128 (App.Manifest._formatFetchedData): Use _formatByte instead of format('s').
130 2015-05-11 Ryosuke Niwa <rniwa@webkit.org>
132 Unreviewed build fix. Add "Duration" as a time metric.
134 * public/js/helper-classes.js:
136 (RunsData.unitFromMetricName):
138 2015-05-06 Ryosuke Niwa <rniwa@webkit.org>
140 Perf dashboard treats Speedometer and JetStream as smaller is better
141 https://bugs.webkit.org/show_bug.cgi?id=144711
143 Reviewed by Chris Dumez.
145 Added the support for "Score" metric.
147 * public/js/helper-classes.js:
150 (RunsData.unitFromMetricName):
151 (RunsData.isSmallerBetter):
153 2015-04-23 Ryosuke Niwa <rniwa@webkit.org>
155 Build fix after r183232.
157 * public/include/json-header.php:
159 2015-04-23 Ryosuke Niwa <rniwa@webkit.org>
161 Perf dashboard should automatically detect regressions
162 https://bugs.webkit.org/show_bug.cgi?id=141443
164 Reviewed by Anders Carlsson.
166 Added a node.js script detect-changes.js to detect potential regressions and progressions
167 on the graphs tracked on v2 dashboards.
169 * init-database.sql: Added analysis_strategies table and task_segmentation and task_test_range
170 columns to analysis_tasks to keep the segmentation and test range selection strategies used
171 to create an analysis task.
173 * public/api/analysis-tasks.php:
174 (format_task): Include task_segmentation and analysis_tasks in the results.
176 * public/include/json-header.php:
177 (remote_user_name): Returns null when the privileged API is authenticated as a slave instead
178 of a CSRF prevention token.
179 (should_authenticate_as_slave): Added.
180 (ensure_privileged_api_data_and_token_or_slave): Added. Authenticate as a slave if slaveName
181 and slavePassword are specified. Since detect-changes.js and other slaves are not susceptible
182 to a CSRF attack, we don't need to check a CSRF token.
184 * public/privileged-api/create-analysis-task.php:
185 (main): Use ensure_privileged_api_data_and_token_or_slave to let detect-changes.js create new
186 analysis task. Also add or find segmentation and test range selection strategies if specified.
188 * public/privileged-api/create-test-group.php:
189 (main): Use ensure_privileged_api_data_and_token_or_slave.
191 * public/privileged-api/generate-csrf-token.php:
194 (App.Pane._computeMovingAverageAndOutliers): _executeStrategy has been moved to Statistics.
196 * public/v2/data.js: Export Measurement, RunsData, TimeSeries. Used in detect-changes.js.
197 (Array.prototype.find): Added a polyfill to be used in node.js.
198 (RunsData.fetchRuns):
199 (RunsData.pathForFetchingRuns): Extracted from fetchRuns. Used in detect-changes.js.
200 (RunsData.createRunsDataInResponse): Extracted from App.Manifest._formatFetchedData to use it
201 in detect-changes.js.
202 (RunsData.unitFromMetricName): Ditto.
203 (RunsData.isSmallerBetter): Ditto.
204 (RunsData.prototype._timeSeriesByTimeInternal): Added secondaryTime to sort points when commit
206 (TimeSeries): When commit times are identical, order points based on build time. This is needed
207 for when we trigger two builds at two different OS versions with the same WebKit revision since
208 OS versions don't change the commit times.
209 (TimeSeries.prototype.findPointByIndex): Added.
210 (TimeSeries.prototype.rawValues): Added.
212 * public/v2/js/statistics.js:
213 (Statistics.TestRangeSelectionStrategies.[0]): Use the 99% two-sided probability as claimed in the
214 description of this strategy instead of the default probability. Also fixed a bug that debugging
215 code was referring to non-existent variables.
216 (Statistics.executeStrategy): Moved from App.Pane (app.js).
218 * public/v2/manifest.js:
219 (App.Manifest._formatFetchedData): Various code has been extracted into RunsData in data.js to be
220 used in detect-changes.js.
222 * tools/detect-changes.js: Added. The script fetches the manifest JSON, analyzes each graph in
223 the v2 dashboards, and creates an analysis task for the latest regression or progression detected.
224 It also schedules an A/B testing if possible and notifies another server; e.g. to send an email.
225 (main): Loads the settings JSON specified in the argument.
226 (fetchManifestAndAnalyzeData): The main loop that periodically wakes up to do the analysis.
227 (mapInOrder): Executes callback sequentially (i.e. blocking) on each item in the array.
228 (configurationsForTesting): Finds every (platform, metric) pair to analyze in the v2 dashbaords,
229 and computes various values for when statistically significant changes are detected later.
230 (analyzeConfiguration): Finds potential regressions and progression in the last X days where X
231 is the specified maximum number of days using the specified strategies. Sort the resultant ranges
232 in chronological order and create a new analysis task for the very last change we detected. We'll
233 eventually create an analysis task for all detected changes since we're repeating the analysis in
234 fetchManifestAndAnalyzeData after some time.
235 (computeRangesForTesting): Fetch measured values and compute ranges to test using the specified
236 segmentation and test range selection strategies. Once ranges are found, find overlapping analysis
237 tasks as they need to be filtered out in analyzeConfiguration to avoid creating multiple analysis
238 tasks for the same range (e.g. humans may create one before the script gets to do it).
239 (createAnalysisTaskAndNotify): Create a new analysis task for the specified range, trigger an A/B
240 testing if available, and notify another server with a HTML message as specified.
241 (findStrategyByLabel):
242 (changeTypeForRange): A change is a regression if values are getting larger in a smaller-is-better
243 test or values are getting smaller in a larger-is-better test and vice versa.
244 (summarizeRange): Create a human readable string that summarizes the change detected. e.g.
245 "Potential 3.2% regression detected between 2015-04-20 12:00 and 17:00".
249 (postNotification): Recursively replaces $title and $massage in the specified JSON template.
250 (instantiateNotificationTemplate):
253 2015-04-20 Ryosuke Niwa <rniwa@webkit.org>
255 Perf dashboard should have UI to set status on analysis tasks
256 https://bugs.webkit.org/show_bug.cgi?id=143977
258 Reviewed by Chris Dumez.
260 Added the UI to set the result of an analysis task to 'progression', 'regression', 'unchanged', and 'inconclusive'
261 as well as a boolean indicating whether creating the analysis task was the right thing to do or not.
262 The latter will be a useful metric once we start automatically creating analysis tasks.
264 * init-database.sql: Added two columns to analysis_tasks table.
265 * public/api/analysis-tasks.php: Include the added columns in the JSON.
266 * public/include/db.php:
267 (Database::to_database_boolean): Added.
268 * public/include/json-header.php:
269 (require_match_one_of_values): Added.
270 * public/privileged-api/update-analysis-task.php: Added. Updates 'result' and 'needed' values of an analysis task.
272 * public/v2/analysis.js:
273 (App.AnalysisTask.result): Added.
274 (App.AnalysisTask.needed): Added. We don't use DS.attr('boolean') here since that would coerce null into false
275 and we want to differentiate null from false in order to differentiate the null-ness of the value.
276 (App.AnalysisTask.saveStatus): Added.
277 (App.AnalysisTask.statusLabel): Use 'result' as the label if it's set and all build requests have been processed.
280 (App.AnalysisTaskController.analysisResultOptions): Added.
281 (App.AnalysisTaskController.shouldNotHaveBeenCreated): Added.
282 (App.AnalysisTaskController.needsFeedback): Added. Show the checkbox to indicate the analysis task should not have
283 been created if 'no change' is selected.
284 (App.AnalysisTaskController._updateChosenAnalysisResult): Added.
285 (App.AnalysisTaskController.actions.saveStatus): Added.
286 * public/v2/index.html: Extracted a partial template for updating the bug numbers. Also added the UI to update
287 'result' and 'needed' values of the analysis task.
289 2015-04-10 Ryosuke Niwa <rniwa@webkit.org>
291 Unreviewed build fix. Updated config.json after recent changes.
295 2015-04-10 Ryosuke Niwa <rniwa@webkit.org>
297 Make the analysis page more useful
298 https://bugs.webkit.org/show_bug.cgi?id=143617
300 Reviewed by Chris Dumez.
302 * public/api/analysis-tasks.php:
303 (fetch_and_push_bugs_to_tasks): Added total and finished numbers of build requests associated
304 with the fetched analysis tasks as buildRequestCount and finishedBuildRequestCount respectively.
305 * public/v2/analysis.js:
306 (App.AnalysisTask.formattedCreatedAt): Added.
307 (App.AnalysisTask._addLeadingZero): Added.
308 (App.AnalysisTask.buildRequestCount): Added.
309 (App.AnalysisTask.finishedBuildRequestCount): Added.
310 (App.AnalysisTask.statusLabel): Added. Status total and finished numbers of build requests.
311 (App.AnalysisTask.testGroups):
312 (App.AnalysisTask.triggerable):
313 (App.AnalysisTask.label):
315 * public/v2/app.css: Tweaked style rules for the analysis page.
318 (App.buildPopup): Sort the list of platforms by name.
319 (App.AnalysisRoute.model): Sort the list of analysis tasks by the order they are created.
320 (App.AnalysisTaskController._fetchedManifest): Added elementId to associate bug tracker names
321 such as "Bugzilla" with the corresponding text field.
323 * public/v2/index.html: Added a bunch of columns to the analysis page and also wrapped the table
324 showing A/B testing results in a div with overflow: scroll so that it always leaves enough space
325 for the accompanying graph.
327 2015-04-09 Ryosuke Niwa <rniwa@webkit.org>
329 Perf dashboard should automatically select ranges for A/B testing
330 https://bugs.webkit.org/show_bug.cgi?id=143580
332 Reviewed by Chris Dumez.
334 Added a new statistics option for picking a A/B test range selection strategy.
335 The selected ranges are shown in the graph using the same UI to show analysis tasks.
338 (App.DashboardPaneProxyForPicker._platformOrMetricIdChanged): Updated the query parameters for
339 charts page used by the dashboard since we've added a new parameter at the end.
340 (App.Pane.ranges): Added. Merges ranges created for analysis tasks and A/B testing.
341 (App.Pane.updateStatisticsTools): Clone and set the test range selection strategies.
342 (App.Pane._cloneStrategy): Copy isSegmentation.
343 (App.Pane._updateMovingAverageAndEnvelope): Set testRangeCandidates.
344 (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Update the charts when a new text range
345 selection strategy is picked by the user.
346 (App.Pane._computeMovingAverageAndOutliers): Compute the test ranges using the chosen strategy.
347 Avoid going through isAnomalyArray when no anomaly detection strategy is enabled. Also changed
348 the return value from the moving average time series to a dictionary that contains the moving
349 average time series, a dictionary of anomalies, and an array of test ranges.
350 (App.ChartsController._parsePaneList): Parse the test range selection strategy configuration.
351 (App.ChartsController._serializePaneList): Ditto for serialization.
352 (App.ChartsController._scheduleQueryStringUpdate): Update the URL hash when the user picks a new
353 test range selection strategy.
355 * public/v2/chart-pane.css: Fixed a typo as well as added a CSS rule for test ranges markers.
357 * public/v2/index.html: Added UI for selecting a test range selection strategy.
359 * public/v2/interactive-chart.js:
360 (App.InteractiveChartComponent._rangesChanged): Pass down "status" to be used as a class name.
362 * public/v2/js/statistics.js:
363 (Statistics.MovingAverageStrategies): Added isSegmentation to segmentation strategies.
364 (Statistics.TestRangeSelectionStrategies): Added.
366 2015-04-08 Ryosuke Niwa <rniwa@webkit.org>
368 The results of A/B testing should state statistical significance
369 https://bugs.webkit.org/show_bug.cgi?id=143552
371 Reviewed by Chris Dumez.
373 Added statistical comparisons between results for each configuration on analysis task page using
374 Welch's t-test. The probability as well as t-statistics and the degrees of freedoms are reported.
377 (App.TestGroupPane._populate): Report the list of statistical comparison between every pair of
378 root configurations in the results. e.g. if we've got A, B, C configurations then compare A/B, A/C
380 (App.TestGroupPane._computeStatisticalSignificance): Compute the statistical significance using
381 Welch's t-test. Report the probability by which two samples do not come from the same distribution.
382 (App.TestGroupPane._createConfigurationSummary): Include the array of results for this configuration.
383 Also renamed "items" to "requests" for clarity.
385 * public/v2/index.html: Added the template for showing statistical comparisons.
387 * public/v2/js/statistics.js: Renamed tDistributionQuantiles to tDistributionByOneSidedProbability
388 for clarity. Also factored out the functions to convert from one-sided probability to two-sided
389 probability and vice versa.
390 (Statistics.supportedConfidenceIntervalProbabilities):
391 (Statistics.confidenceIntervalDelta):
392 (Statistics.probabilityRangeForWelchsT): Added. Computes the lower bound and the upper bound for
393 the probability that two values are sampled from distinct distributions using Welch's t-test.
394 (Statistics.computeWelchsT): This function now takes two-sided probability like all other functions.
395 (.tDistributionByOneSidedProbability): Renamed from tDistributionQuantiles.
396 (.oneSidedToTwoSidedProbability): Extracted.
397 (.twoSidedToOneSidedProbability): Extracted.
398 (Statistics.MovingAverageStrategies): Converted the one-sided probability to the two-sided probability
399 now that computeWelchsT takes two-sided probability.
401 2015-04-08 Ryosuke Niwa <rniwa@webkit.org>
403 Unreviewed fix after r182496 for when the cached runs JSON doesn't exist.
407 (App.Pane.refetchRuns):
409 2015-04-07 Ryosuke Niwa <rniwa@webkit.org>
411 Perf dashboard should have a way of marking outliers
412 https://bugs.webkit.org/show_bug.cgi?id=143466
414 Reviewed by Chris Dumez.
416 Address kling's in-person comment to notify users when the new run status is saved in the database.
419 (App.PaneController._selectedItemIsMarkedOutlierDidChange)
420 * public/v2/chart-pane.css: Fixed a typo.
422 2015-04-07 Ryosuke Niwa <rniwa@webkit.org>
424 Perf dashboard should have a way of marking outliers
425 https://bugs.webkit.org/show_bug.cgi?id=143466
427 Reviewed by Chris Dumez.
429 Added UI to mark a data point as an outlier as well as a button to toggle the visibility of outliers.
430 Added a new privileged API /privileged-api/update-run-status to store this boolean flag.
432 * init-database.sql: Added run_marked_outlier column to test_runs table.
434 * public/admin/tests.php:
436 * public/api/runs.php:
437 (main): Only emit Cache-Control and Expires headers in v1 UI.
438 (RunsGenerator::format_run): Emit markedOutlier.
440 * public/include/admin-header.php:
442 * public/include/db.php:
443 (Database::is_true): Made it static.
445 * public/include/manifest.php:
446 (Manifest::platforms):
448 * public/index.html: Call into /api/runs/ with ?cache=true.
450 * public/privileged-api/update-run-status.php: Added.
451 (main): Updates the newly added column in test_runs table.
455 (App.Pane.refetchRuns): Extracted from App.Pane._fetch.
456 (App.Pane._didFetchRuns): Renamed from _updateChartData.
457 (App.Pane._setNewChartData): Added. Pick the right time series based based on the value of showOutlier.
458 Cloning chartData is necessary when toggling the outlier visibility or using statistics tools because
459 the interactive chart component only observes changes to chartData and not individual properties of it.
460 (App.Pane._highlightPointsMarkedAsOutlier): Added. Highlight points marked as outliers.
461 (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Call to _setNewChartData replaced the code to
462 clone chartData here.
464 (App.PaneController.actions.toggleShowOutlier): Toggle the visibility of points marked as outliers by
465 invoking App.Pane._setNewChartData.
466 (App.PaneController._detailsChanged): Don't hide the analysis pane when details changed since keep
467 opening the pane for marking points as outliers would be annoying.
468 (App.PaneController._updateCanAnalyze): Update 'cannotMarkOutlier' as well as 'cannotAnalyze'.
469 (App.PaneController.selectedMeasurement): Added.
470 (App.PaneController.showOutlierTitle): Added.
471 (App.PaneController._selectedItemIsMarkedOutlierDidChange): Added. Call out to setMarkedOutlier to
472 mark the selected point as an outlier via the newly added privileged API.
474 * public/v2/chart-pane.css: Updated styles.
477 (PrivilegedAPI._post): Report the semantic errors.
478 (Measurement.prototype.markedOutlier): Added.
479 (Measurement.prototype.setMarkedOutlier): Added. Uses PrivilegedAPI to update the database.
480 (RunsData.prototype.timeSeriesByCommitTime): Added a new argument, includeOutliers, to indicate
481 whether the time series should include measurements marked as outliers or not.
482 (RunsData.prototype.timeSeriesByBuildTime): Ditto.
483 (RunsData.prototype._timeSeriesByTimeInternal): Extracted from timeSeriesByCommitTime and
484 timeSeriesByBuildTime to share code. Now ignores measurements marked as outliers if needed.
486 * public/v2/index.html: Added an icon for showing and hiding outliers. Also added a checkbox to
487 mark individual points as outliers.
489 * public/v2/interactive-chart.js:
490 (App.InteractiveChartComponent._selectClosestPointToMouseAsCurrentItem): Re-enable the distance
491 heuristics that takes vertical closeness into account. This heuristics is more useful when marking
492 some points as outliers. This heuristics was disabled because the behavior was unpredictable but
493 with the arrow key navigation support, this is no longer an issue.
495 * public/v2/manifest.js:
496 (App.Manifest._formatFetchedData): Added showOutlier to the chart data. This function dynamically
497 updates the time series in this chart data in order to include or exclude outliers.
499 2015-04-03 Ryosuke Niwa <rniwa@webkit.org>
501 Perf dashboard should be able to trigger A/B testing jobs for iOS
502 https://bugs.webkit.org/show_bug.cgi?id=143398
504 Reviewed by Chris Dumez.
506 Fix various bugs in the perf dashboard so that it can schedule A/B testing jobs for iOS.
508 Also generalized sync-with-buildbot.py slightly to meet the requirements of iOS builders.
510 * public/api/triggerables.php:
511 (main): Avoid spitting a warning when $id_to_triggerable doesn't contain the triggerable.
512 * public/v2/analysis.js:
513 (App.AnalysisTask.triggerable): Log an error when failed to fetch triggerables for debugging purposes.
515 (App.AnalysisTaskController.updateRootConfigurations): Show 'None' when a revision is missing from
516 some of the data points. This will happen when we modify the list of projects we build for iOS.
517 (App.AnalysisTaskController.actions.createTestGroup): Gracefully fail by showing alerts when an user
518 attempts to create an invalid test group; when there is already another test group of the same or when
519 only either configuration specifies the revision for some repository.
520 (App.AnalysisTaskController._updateRootsBySelectedPoints): Fixed a typo: sets[i] -> set.
521 * public/v2/index.html: Don't show the form to create a new test group if it's not available.
522 * tools/sync-with-buildbot.py:
523 (find_request_updates):
524 (schedule_request): iOS builders take a JSON that contains the list of roots. Generate this JSON when
525 a dictionary of the form {rootsExcluding: ["WebKit"]} is specified. Also replaced the way we refer to
526 a revision from $-based text replacements to an explicit dictionary of the form {root: "WebKit"}.
527 (request_id_from_build): Don't hard code the parameter name here. Retrieve the name from the config.
529 2015-04-03 Ryosuke Niwa <rniwa@webkit.org>
531 Add time series segmentation algorithms as moving averages
532 https://bugs.webkit.org/show_bug.cgi?id=143362
534 Reviewed by Chris Dumez.
536 This patch implements two preliminary time series segmentation algorithms as moving averages.
538 Recursive t-test: Compute Welch's t-statistic at each point in a given segment of the time series.
539 If Welch's t-test implicates a statistically significance difference, then split the segment into two
540 sub segments with the maximum t-statistic (i.e. the point at which if split would yield the highest
541 probability that two segments do not share the same "underlying" mean in classical / frequentist sense).
542 We repeat this process recursively. See [1] for the evaluation of this particular algorithm.
544 Schwarz criterion: Use Schwarz or Bayesian information criterion to heuristically find the optimal
545 segmentation. Intuitively, the problem of finding the best segmentation comes down to minimizing the
546 residual sum of squares in each segment as in linear regressions. That is, for a given segment with
547 values y_1 through y_n with mean y_avg, we want to minimize the sum of (y_i - y_avg)^2 over i = 1
548 through i = n. However, we also don't want to split every data point into a separate segment so we need
549 to account the "cost" of introducing new segments. We use a cost function that's loosely based on two
550 models discussed in [2] for simplicity. We will tune this cost function further in the future.
552 The problem of finding the best segmentation then reduces to a search problem. Unfortunately, our problem
553 space is exponential with respect to the size of the time series since we could split at each data point.
554 We workaround this problem by first splitting the time series into a manageable smaller grids, and only
555 considering segmentation of a fixed size (i.e. the number of segments is constant). Since time series
556 tend to contain a lot more data points than segments, this strategy finds the optimal solution without
557 exploring much of the problem space.
559 Finding the optimal segmentation of a fixed size is, itself, another search problem that is equivalent to
560 finding the shortest path of a fixed length in DAG. Here, we use dynamic programming with a matrix of size
561 n by n where n is the length of the time series (grid). Each entry in this matrix at (i, k) stores
562 the minimum cost of segmenting data points 1 through i using k segments. We start our search at i = 1.
563 Clearly C(1, 0) = 0 (note the actual code uses 0-based index). In i-th iteration, we compute the cost
564 S(i, j) of each segment starting at i and ending at another point j after i and update C(j, k + 1) by
565 min( C(j, k + 1), C(i, k) + S(i, j) ) for all values of j above i.
567 [1] Kensuke Fukuda, H. Eugene Stanley, and Luis A. Nunes Amaral, "Heuristic segmentation of
568 a nonstationary time series", Physical Review E 69, 021108 (2004)
570 [2] Marc Lavielle, Gilles Teyssi`ere, "Detection of Multiple Change–Points in Multivariate Time Series"
571 Lithuanian Mathematical Journal, vol 46, 2006
573 * public/v2/index.html: Show the optional description for the chosen moving average strategy.
574 * public/v2/js/statistics.js:
575 (Statistics.testWelchsT):
576 (Statistics.computeWelchsT): Extracted from testWelchsT. Generalized to take the offset and the length
577 of each value array between which Welch's t-statistic is computed. This generalization helps the
578 Schwarz criterion segmentation algorithm avoid splitting values array O(n^2) times.
579 (.sampleMeanAndVarianceForValues): Ditto for the generalization.
580 (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Added. Implements recursive t-test.
581 (.splitIntoSegmentsUntilGoodEnough): Added. Implements Schwarz criterion.
582 (.findOptimalSegmentation): Added. Implements the algorithm to find the optimal segmentation of a fixed
584 (.SampleVarianceUpperTriangularMatrix): Added. Stores S(i, j) used by findOptimalSegmentation.
585 (.SampleVarianceUpperTriangularMatrix.prototype.costBetween): Added.
587 2015-04-03 Ryosuke Niwa <rniwa@webkit.org>
589 REGRESSION: Perf dashboard sometimes fails to update zooming level
590 https://bugs.webkit.org/show_bug.cgi?id=143359
592 Reviewed by Darin Adler.
594 The bug was caused by various bugs that ended up in an exception.
597 (App.Pane._handleFetchErrors): Removed superfluous console.log.
598 (App.Pane.computeStatus): Fixed the bug in r182185 that previousPoint could be null.
599 (App.PaneController.actions.zoomed): Update the overview when the main chart triggered a zoom.
600 * public/v2/index.html: Replaced all instances of href="#" by href="javascript:false" to avoid navigating
601 to # when Ember.js fails to attach event listeners on time.
602 * public/v2/interactive-chart.js:
603 (App.InteractiveChartComponent._updateDimensionsIfNeeded): Avoid using a negative width or height when
604 the containing element's size is 0.
605 (App.InteractiveChartComponent._updateBrush): Ditto.
607 2015-04-02 Ryosuke Niwa <rniwa@webkit.org>
609 Perf dashboard should have UI to test out anomaly detection strategies
610 https://bugs.webkit.org/show_bug.cgi?id=143290
612 Reviewed by Benjamin Poulain.
614 Added the UI to select anomaly detection strategies. The detected anomalies are highlighted in the graph.
616 Implemented the Western Electric Rules 1 through 4 in http://en.wikipedia.org/wiki/Western_Electric_rules
617 as well as Welch's t-test that compares the last five points to the prior twenty points.
619 The latter is what Mozilla uses (or at least did in the past) to detect performance regressions on their
620 performance tests although they compare medians instead of means.
622 All of these strategies don't quite work for us since our data points are too noisy but this is a good start.
625 (App.Pane.updateStatisticsTools): Clone anomaly detection strategies.
626 (App.Pane._updateMovingAverageAndEnvelope): Highlight anomalies detected by the enabled strategies.
627 (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Observe changes to anomaly detection strategies.
628 (App.Pane._computeMovingAverageAndOutliers): Detect anomalies by each strategy and aggregate results.
629 Only report the first data point when multiple consecutive data points are detected as anomalies.
630 * public/v2/chart-pane.css: Updated styles.
631 * public/v2/index.html: Added the pane for selecting anomaly detection strategies.
632 * public/v2/js/statistics.js:
633 (Statistics.testWelchsT): Added. Implements Welch's t-test.
634 (.sampleMeanAndVarianceForValues): Added.
635 (.createWesternElectricRule): Added.
636 (.countValuesOnSameSide): Added.
637 (Statistics.AnomalyDetectionStrategy): Added.
639 2015-03-31 Ryosuke Niwa <rniwa@webkit.org>
641 REGRESSION: Searching commits can highlight wrong data points
642 https://bugs.webkit.org/show_bug.cgi?id=143272
644 Reviewed by Antti Koivisto.
646 The bug was caused by /api/commits returning commit times with millisecond precision whereas /api/runs
647 return commit times with only second precision. This resulted in the frontend code to match a commit
648 with the data point that included the next commit when the millisecond component of commit's timestamp
649 wasn't identically 0.
651 This discrepancy was caused by the fact PHP's strtotime only ignores milliseconds and /api/commits
652 was returning timestamp as string instead of parsing via Database::to_js_time as done in /api/runs
653 so miliseconds component was only preserved in /api/commits.
655 Fixed the bug by always using Database::to_js_time to return commit time. Also fixed to_js_time so that
656 it returns time in milisecond precision.
658 * public/api/commits.php:
659 (fetch_commits_between): Use Database::to_js_time for format commit times.
660 (format_commit): Ditto.
661 * public/include/db.php:
662 (Database::to_js_time): Parse and append millisecond component. Ignore sub-milliseconds for simplicity.
664 (CommitLogs.fetchForTimeRange): The commit time is now an integer so don't call "replace" on it.
666 2015-03-31 Ryosuke Niwa <rniwa@webkit.org>
668 Perf dashboard should show relative change in values
669 https://bugs.webkit.org/show_bug.cgi?id=143252
671 Reviewed by Antti Koivisto.
673 When a range of values are selected, show the percentage difference between the start and the end
674 in addition to the absolute value difference. When a single point is selected, show the relative
675 difference with respect to the previous point. Use two significant figures and always show plus sign
676 when the difference is positive.
678 * public/v2/app.js: Compute and format the relative difference.
679 * public/v2/chart-pane.css: Don't let commits view shrink itself when they're all collapsed.
680 * public/v2/index.html: Show the relative difference.
682 2015-03-31 Ryosuke Niwa <rniwa@webkit.org>
684 REGRESSION(r180000): Changing moving average or enveloping strategy doesn't update the graph
685 https://bugs.webkit.org/show_bug.cgi?id=143254
687 Reviewed by Antti Koivisto.
689 The bug was caused by App.Pane no longer replacing 'chartData' property when updating the moving average
690 or the enveloping values. Fixed the bug by creating a new chartData object when the strategy is changed
691 so that the interactive chart component will observe a change to 'chartData'.
694 (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Added.
696 2015-03-19 Ryosuke Niwa <rniwa@webkit.org>
698 Unreviewed build fixes.
700 * public/include/manifest.php:
701 (Manifest::generate): These should be {} instead of [] when they're empty.
703 (Measurement.prototype.formattedRevisions): Don't assume previousRevisions[repositoryId] exits.
704 * public/v2/manifest.js:
705 (App.Metric.fullName): Fixed the typo.
706 * tests/admin-regenerate-manifest.js: Fixed the test.
708 2015-02-20 Ryosuke Niwa <rniwa@webkit.org>
710 Commit the erroneously reverted change.
712 * public/api/runs.php:
713 (RunsGenerator::results):
715 2015-02-20 Ryosuke Niwa <rniwa@webkit.org>
717 Loading the perf dashboard takes multiple seconds
718 https://bugs.webkit.org/show_bug.cgi?id=141860
720 Reviewed by Andreas Kling.
722 This patch introduces the caches of JSON files returned by /api/ in /data/ directory. It also records
723 the last time test_runs rows associated with the requested platforms and metrics are inserted, updated,
724 or removed in the caches as well as the manifest JSON files ("last modified time"). Because the manifest
725 is regenerated each time a new test result is reported, the front end can compare last modified time in
726 the manifest file with that in a /api/runs JSON cache to detect the stale-ness.
728 More concretely, the front end first optimistically fetches the JSON in /data/. If the cache doesn't exit
729 or the last modified time in the cache doesn't match with that in the manifest file, it would fetch it
730 again via /api/runs. In the case the cache did exist, we render the charts based on the cache meanwhile.
731 This dramatically reduces the perceived latency for the page load since charts are drawn immediately using
732 the cache and we would only re-render the charts as new up-to-date JSON comes in.
734 This patch also changes the format of runs JSONs by pushing the exiting properties into 'configurations'
735 and adding 'lastModified' and 'elapsedTime' at the top level.
737 * init-database.sql: Added config_runs_last_modified to test_configurations table as well as a trigger to
738 auto-update this column upon changes to test_runs table.
740 * public/admin/test-configurations.php:
741 (add_run): Regenerate the manifest file to invalidate the /api/runs JSON cache.
744 * public/api/runs.php:
745 (main): Fetch all columns of test_configurations table including config_runs_last_modified. Also generate
746 the cache in /data/ directory.
747 (RunsGenerator::__construct): Compute the last modified time for this (platform, metric) pair.
748 (RunsGenerator::results): Put the old content in 'configurations' property and include 'lastModified' and
749 'elapsedTime' properties. 'elapsedTime' is added for debugging purposes.
750 (RunsGenerator::add_runs):
751 (RunsGenerator::parse_revisions_array):
753 * public/include/db.php:
755 (generate_data_file): Added based on ManifestGenerator::store.
756 (Database::to_js_time): Extracted from RunsGenerator::add_runs to share code.
758 * public/include/json-header.php:
759 (echo_success): Renamed from success_json. Return the serialized JSON instead of echo'ing it so that we can
760 generate caches in /api/runs/.
763 * public/include/manifest.php:
764 (ManifestGenerator::generate): Added 'elapsedTime' property for the time taken to generate the manifest.
765 It seems like we're generating it in 200-300ms for now so that's good.
766 (ManifestGenerator::store): Uses generate_data_file.
767 (ManifestGenerator::platforms): Added 'lastModified' array to each platform entry. This array contains the
768 last modified time for each (platform, metric) pair.
771 (fetchTest): Updated per the format change in runs JSON.
774 (App.Pane._fetch): Fetch the cached JSON first. Refetch the uncached version if instructed as such.
775 (App.Pane._updateChartData): Extracted from App.Pane._fetch.
776 (App.Pane._handleFetchErrors): Ditto.
779 (RunsData.fetchRuns): Takes the fourth argument indicating whether we should fetch the cached version or not.
780 The cached JSON is located in /data/ with the same filename. When fetching a cached JSON results in 404,
781 fulfill the promise with null as the result instead of rejecting it. The only client of this function which
782 sets useCache to true is App.Manifest.fetchRunsWithPlatformAndMetric, and it handles this special case.
784 * public/v2/manifest.js:
785 (App.DateArrayTransform): Added. Handles the array of last modified dates in platform objects.
786 (App.Platform.lastModifiedTimeForMetric): Added. Returns the last modified date in the manifest JSON.
787 (App.Manifest.fetchRunsWithPlatformAndMetric): Takes "useCache" like RunsData.fetchRuns. Set shouldRefetch
788 to true if response is null (the cache didn't exit) or the cache is out-of-date.
789 (App.Manifest._formatFetchedData): Extracted from App.Manifest.fetchRunsWithPlatformAndMetric.
792 (initializeDatabase): Avoid splitting function definitions in the middle.
794 * tests/api-report.js: Added tests to verify that reporting new test results updates the last modified time
795 in test_configurations.
797 2015-02-20 Ryosuke Niwa <rniwa@webkit.org>
799 REGRESSION(r180333): Analysis tasks can't be associated with bugs
800 https://bugs.webkit.org/show_bug.cgi?id=141858
802 Reviewed by Andreas Kling.
804 Added back the erroneously removed table to associate bugs. Also moved "details-table-container" div outside
805 of the chart-details partial template as it needs to wrap associate bugs in analysis task pages.
807 * public/v2/chart-pane.css:
808 * public/v2/index.html:
810 2015-02-20 Ryosuke Niwa <rniwa@webkit.org>
812 Selecting revisions for A/B testing is hard
813 https://bugs.webkit.org/show_bug.cgi?id=141824
815 Reviewed by Andreas Kling.
817 Update the revisions used in A/B testing based on the selection in the overview chart. This allows users to
818 intuitively select revisions based on points shown in the chart. Removed the old select elements used to
819 select A/B testing points manually.
821 Also renamed 'testSets' to 'configurations', 'roots' to 'rootConfigurations', and 'revisions' in each root's
822 sets to 'options' for clarity.
824 * public/v2/app.css: Reorganized style rules.
827 (App.AnalysisTaskController):
828 (App.AnalysisTaskController._taskUpdated): Merged updateTestGroupPanes.
829 (App.AnalysisTaskController._chartDataChanged): Renamed from paneDomain. It's now an observer instead of
830 a property, which sets 'overviewDomain' property as well as other properties.
831 (App.AnalysisTaskController.updateRootConfigurations): Renamed from updateRoots.
832 (App.AnalysisTaskController._updateRootsBySelectedPoints): Added. Select roots based on the selected points
833 in the overview chart.
835 * public/v2/chart-pane.css: Added arrows next to the configuration names (e.g. 'A') to indicate whether
836 individual build requests / test results are shown or not.
838 * public/v2/index.html: Removed the select element per configuration column. Also moved the select element
839 for the number of runs as it doesn't belong in the same table as the one that lists repositories and roots.
841 2015-02-20 Ryosuke Niwa <rniwa@webkit.org>
843 Unreviewed test fixes after r179037, r179591, and r179763.
845 * tests/admin-regenerate-manifest.js:
846 * tests/admin-reprocess-report.js:
848 2015-02-19 Ryosuke Niwa <rniwa@webkit.org>
850 Relationship between A/B testing results are unclear
851 https://bugs.webkit.org/show_bug.cgi?id=141810
853 Reviewed by Andreas Kling.
855 Show a "reference chart" indicating which two points have been tested in each test group pane.
857 Now the chart shown at the top of an analysis task page is called the "overview pane", and we use the pane
858 and the domain used in this chart to show charts in each test group.
860 Also renamed an array of revisions used in the A/B test results tables from 'revisions' to 'revisionList'.
862 * public/v2/analysis.js:
863 (App.TestGroup._fetchTestResults): Renamed from _fetchChartData. Set 'testResults' instead of 'chartData'
864 since this is the results of A/B testing results, not the data for charts shown next to them.
866 * public/v2/app.css: Added CSS rules for reference charts.
869 (App.AnalysisTaskController.paneDomain): Set 'overviewPane' and 'overviewDomain' on each test group pane.
870 (App.TestGroupPane._populate): Updated per 'chartData' to 'testResults' rename.
871 (App.TestGroupPane._updateReferenceChart): Get the chart data via the overview pane and find points that
872 identically matches root sets. If one of configuration used a set of revisions for which no measurement
873 was made in the original chart, don't show the reference chart as that would be misleading / confusing.
874 (App.TestGroupPane._computeRepositoryList): Updated per 'chartData' to 'testResults' rename.
875 (App.TestGroupPane._createConfigurationSummary): Ditto. Also renamed 'revisions' to 'revisionList'.
876 In addition, renamed 'buildNumber' to 'buildLabel' and prefixed it with "Build ".
879 (Measurement.prototype.revisionForRepository): Added.
880 (Measurement.prototype.commitTimeForRepository): Cleanup.
881 (TimeSeries.prototype.findPointByRevisions): Added. Finds a point based on a set of revisions.
883 * public/v2/index.html: Added the reference chart. Streamlined the status label for each build request
884 by including the build number in the title attribute instead of in the markup.
886 * public/v2/interactive-chart.js:
887 (App.InteractiveChartComponent._updateDomain): Fixed a typo introduced as a consequence of r179913.
888 (App.InteractiveChartComponent._computeYAxisDomain): Expand the y-axis to show the highlighted points.
889 (App.InteractiveChartComponent._highlightedItemsChanged): Adjust the y-axis as needed.
891 2015-02-18 Ryosuke Niwa <rniwa@webkit.org>
893 Analysis task pages are unusable
894 https://bugs.webkit.org/show_bug.cgi?id=141786
896 Reviewed by Andreas Kling.
898 This patch makes following improvements to analysis task pages:
899 1. Making the main chart interactive. This change required the use of App.Pane as well as moving the code to
900 compute the data for the details pane from PaneController.
901 2. Moving the form to add a new test group to the top of test groups instead of the bottom of them.
902 3. Grouping the build requests in each test group by root sets instead of the order by which they were ran.
903 This change required the creation of App.TestGroupPane as well as its methods.
904 4. Show a box plot for each root set configuration as well as each build request. This change required
905 App.BoxPlotComponent.
906 5. Show revisions of each repository (e.g. WebKit) for each root set and build request.
908 * public/api/build-requests.php:
909 (main): Update per the rename of BuildRequestsFetcher::root_sets to BuildRequestsFetcher::root_sets_by_id.
911 * public/api/test-groups.php:
912 (main): Include root sets and roots in the response.
915 * public/include/build-requests-fetcher.php:
916 (BuildRequestsFetcher::root_sets_by_id): Renamed from root_sets.
917 (BuildRequestsFetcher::root_sets): Added.
918 (BuildRequestsFetcher::roots): Added.
919 (BuildRequestsFetcher::fetch_roots_for_set): Takes a boolean argument $resolve_ids. This flag is only set to
920 true in /api/build-requests/ (as done prior to this patch) to use repository names as identifiers since
921 tools/sync-with-buildbot.py can't convert repository names to their ids.
923 * public/v2/analysis.js:
925 (App.RootSet): Added.
926 (App.RootSet.revisionForRepository): Added.
927 (App.TestGroup.rootSets): Deleted the code to compute root set ids from build requests now that the JSON
928 response at /api/test-groups will include them.
929 (App.BuildRequest): Ditto. Also deleted 'configLetter' property, which has been moved to a proxy created by
930 _createConfigurationSummary.
931 (App.BuildRequest.statusLabel): Use 'Completed' as the human readable label for 'completed' status.
932 (App.BuildRequest.aggregateStatuses): Added. Generates a human readable status for a set of build requests.
934 * public/v2/app.css: Updated style rules for analysis task pages.
937 (App.Pane): This class is now used in analysis task pages to make the main chart interactive.
938 (App.Pane._updateDetails): Moved from App.PaneController.
940 (App.PaneController._updateCanAnalyze): Updated the code per the move of selectedPoints.
942 (App.AnalysisTaskController): Added 'details'.
943 (App.AnalysisTaskController._taskUpdated):
944 (App.AnalysisTaskController.paneDomain):Renamed from _fetchedRuns.
945 (App.AnalysisTaskController.updateTestGroupPanes): Added. Creates App.TestGroupPane for each test group.
946 (App.AnalysisTaskController.actions.toggleShowRequestList): Added.
948 (App.TestGroupPane): Added.
949 (App.TestGroupPane._populate): Added. Group build requests by root sets and create a summary for each group.
950 (App.TestGroupPane._computeRepositoryList): Added. Returns a sorted list of repositories which is the union
951 of all repositories appearing in root sets and builds associated with A/B testing results.
952 (App.TestGroupPane._groupRequestsByConfigurations): Added. Groups build requests by root sets.
953 (App.TestGroupPane._createConfigurationSummary): Added. Creates a summary for a group of build requests that
954 use the same root set. We start by wrapping "raw" build requests in a proxy with formatted values,
955 build numbers, etc... obtained from the fetched chart data. The list of revisions shown in the group summary
956 is a union of revisions in the root set and the first build request in the group. We null-out revision info
957 for a build request if it is identical to the one in the summary. The range of values is expanded as needed
958 by the values in the group as well as 95% percentile confidence interval.
960 (App.BoxPlotComponent): Added. Controls a box plot shown for each test group summary and build request.
961 (App.BoxPlotComponent.didInsertElement): Added. Inserts a SVG element as well as two indicator rects to show
962 the mean and the confidence interval.
963 (App.BoxPlotComponent._updateBars): Added. Updates the dimensions of the indicator rects.
964 (App.BoxPlotComponent.valueChanged): Added. Computes the relative dimensions of the indicator rects and
965 calls _updateBars to update the rects.
967 * public/v2/chart-pane.css: Added some style rules to be used in the details pane in analysis task pages.
970 (Measurement.prototype.formattedRevisions):
971 (Measurement.formatRevisionRange): Renamed from Measurement.prototype._formatRevisionRange so that it can be
972 called in _createConfigurationSummary.
974 * public/v2/index.html: Updated the templates for analysis task pages. Moved the form to create a new test
975 group above all test groups, and replaced the list of data points by "details" pane used in the charts page.
976 Also made the fetching of chartData no longer block showing of test groups.
978 * public/v2/interactive-chart.js:
979 (App.InteractiveChartComponent._updateDomain): Added an early exit to fix a newly revealed race condition.
980 (App.InteractiveChartComponent._domainChanged): Ditto.
981 (App.InteractiveChartComponent._updateSelectionToolbar): Made it respect 'zoomable' boolean property.
983 * public/v2/js/statistics.js:
984 (Statistics.min): Added.
985 (Statistics.max): Added.
987 * public/v2/manifest.js:
988 (App.Manifest.fetchRunsWithPlatformAndMetric): Added formatWithDeltaAndUnit to be used in _createConfigurationSummary.
990 2015-02-14 Ryosuke Niwa <rniwa@webkit.org>
992 Build URL on new perf dashboard doesn't resolve $builderName
993 https://bugs.webkit.org/show_bug.cgi?id=141583
995 Reviewed by Darin Adler.
997 Support $builderName in the build URL template.
999 * public/js/helper-classes.js:
1000 (TestBuild.buildUrl): Replaced $builderName with the builder name.
1002 * public/v2/manifest.js:
1003 (App.Metric.fullName): Fixed the typo. We need &ni, not &in.
1004 (App.BuilderurlFromBuildNumber): Replaced $builderName with the builder name.
1006 2015-02-13 Ryosuke Niwa <rniwa@webkit.org>
1008 Unreviewed build fix after r179591.
1010 * public/api/commits.php:
1012 2015-02-13 Ryosuke Niwa <rniwa@webkit.org>
1014 The status of a A/B testing request always eventually becomes "Failed"
1015 https://bugs.webkit.org/show_bug.cgi?id=141523
1017 Reviewed by Andreas Kling.
1019 The bug was caused by /api/build-requests always setting the status of a build request to 'failed' when
1020 'failedIfNotCompleted' was sent by the buildbot sync'er.
1022 Fixed the bug by only setting the status to 'failed' if it wasn't set to 'completed'.
1024 * public/api/build-requests.php:
1027 2015-02-13 Csaba Osztrogonác <ossy@webkit.org>
1029 Unreviewed, remove empty directories.
1031 * public/data: Removed.
1033 2015-02-12 Ryosuke Niwa <rniwa@webkit.org>
1035 Perf dashboard should show the results of A/B testing
1036 https://bugs.webkit.org/show_bug.cgi?id=141500
1038 Reviewed by Chris Dumez.
1040 Added the support for fetching test_runs for a specific test group in /api/runs/, and used it in the
1041 analysis task page to fetch results for each test group.
1043 Merged App.createChartData into App.Manifest.fetchRunsWithPlatformAndMetric so that App.BuildRequest
1044 can use the formatter.
1046 * public/api/runs.php:
1047 (fetch_runs_for_config_and_test_group): Added.
1048 (fetch_runs_for_config): Just return the fetched rows since main will format them with RunsGenerator.
1049 (main): Use fetch_runs_for_config_and_test_group to fetch rows when a test group id is specified. Also
1050 use RunsGenerator to format results.
1051 (RunsGenerator): Added.
1052 (RunsGenerator::__construct): Added.
1053 (RunsGenerator::add_runs): Added.
1054 (RunsGenerator::format_run): Moved.
1055 (RunsGenerator::parse_revisions_array): Moved.
1057 * public/v2/analysis.js:
1058 (App.TestGroup): Fixed a typo. The property on a test group that refers to an analysis task is "task".
1059 (App.TestGroup._fetchChartData): Added. Fetches all A/B testing results for this group.
1060 (App.BuildRequest.configLetter): Renamed from config since this returns a letter that identifies the
1061 configuration associated with this build request such as "A" and "B".
1062 (App.BuildRequest.statusLabel): Added the missing label for failed build requests.
1063 (App.BuildRequest.url): Added. Returns the URL associated with this build request.
1064 (App.BuildRequest._meanFetched): Added. Retrieve the mean and the build number for this request via
1068 (App.Pane._fetch): Set chartData directly here.
1069 (App.Pane._updateMovingAverageAndEnvelope): Renamed from _computeChartData. No longer sets chartData
1070 now that it's done in App.Pane._fetch.
1071 (App.AnalysisTaskController._fetchedRuns): Updated per createChartData merge.
1073 * public/v2/data.js:
1074 (Measurement.prototype.buildId): Added.
1075 (TimeSeries.prototype.findPointByBuild): Added.
1077 * public/v2/index.html: Fixed a bug that build status URL was broken. We can't use link-to helper since
1078 url is not an Ember routed path.
1080 * public/v2/manifest.js:
1081 (App.Manifest.fetchRunsWithPlatformAndMetric): Takes testGroupId as the third argument. Merged
1082 App.createChartData here so that App.BuildRequest can use the formatter
1084 2015-02-12 Ryosuke Niwa <rniwa@webkit.org>
1086 v2 UI should adjust the number of ticks on dashboards based on screen size
1087 https://bugs.webkit.org/show_bug.cgi?id=141502
1089 Reviewed by Chris Dumez.
1091 * public/v2/interactive-chart.js:
1092 (App.InteractiveChartComponent._updateDimensionsIfNeeded): Compute the number of ticks based on the
1095 2015-02-11 Ryosuke Niwa <rniwa@webkit.org>
1097 New perf dashboard shows too much space around interesting data points
1098 https://bugs.webkit.org/show_bug.cgi?id=141487
1100 Reviewed by Chris Dumez.
1102 Revise the y-axis range adjustment algorithm in r179913. Instead of showing the entire moving average,
1103 show the current time series excluding points in the series outside the moving average envelope.
1106 (App.Pane._computeChartData): Don't deal with missing moving average or enveloping strategy here.
1107 (App.Pane._computeMovingAverageAndOutliers): Set isOutliner to true on all data points in the current
1108 time series if the point lies outside the moving average envelope. Don't expose the moving average or
1109 the envelope computed for this purpose if they're not set by the user.
1111 * public/v2/data.js:
1112 (TimeSeries.prototype.minMaxForTimeRange): Takes a boolean argument, ignoreOutlier. When the flag is set
1113 to true, min/max computation will ignore any point in the series with non-falsy "isOutliner" property.
1115 * public/v2/interactive-chart.js:
1116 (App.InteractiveChartComponent._constructGraphIfPossible): Unsupport hideMovingAverage and hideEnvelope.
1117 (App.InteractiveChartComponent._computeYAxisDomain): Removed the commented out code. Also moved the code
1118 to deal with showFullYAxis here.
1119 (App.InteractiveChartComponent._minMaxForAllTimeSeries): Rewrote the code. Takes ignoreOutliners as an
1120 argument instead of directly inspecting showFullYAxis.
1122 2015-02-10 Ryosuke Niwa <rniwa@webkit.org>
1124 New perf dashboard shouldn't always show outliners
1125 https://bugs.webkit.org/show_bug.cgi?id=141445
1127 Reviewed by Chris Dumez.
1129 Use the simple moving average with an average difference envelope to compute the y-axis range to show
1130 to avoid expanding it spuriously to show one off outlier.
1133 (App.Pane): Don't show the full y-axis range by default.
1134 (App.Pane._computeChartData): Use the first strategies for the moving average and the enveloping if
1135 one is not specified by the user but without showing them in the charts.
1136 (App.Pane._computeMovingAverage): Takes moving average and enveloping strategies as arguments instead
1137 of retrieving via chosenMovingAverageStrategy and chosenEnvelopingStrategy.
1139 (App.ChartsController._parsePaneList): Added showFullYAxis as a query string argument to each pane.
1140 (App.ChartsController._serializePaneList): Ditto.
1142 * public/v2/chart-pane.css: Added a CSS rule for when y-axis is clickable.
1144 * public/v2/index.html: Pass in showFullYAxis as an argument to the main interactive chart.
1146 * public/v2/interactive-chart.js:
1147 (App.InteractiveChartComponent._constructGraphIfPossible): Add an event listener on y-axis labels when
1148 the chart is interactive so that toggle showFullYAxis. Also hide the moving average and/or the envelope
1149 if they are not specified by the user (i.e. only used to adjust y-axis range).
1150 (App.InteractiveChartComponent._updateDomain): Don't exit early if y-axis domains are different even if
1151 x-axis domain remained the same. Without this change, the charts would never redraw.
1152 (App.InteractiveChartComponent._minMaxForAllTimeSeries): Use the moving average instead of the current
1153 time series to compute the y-axis range if showFullYAxis is false. When showFullYAxis is true, expand
1154 y-axis all the way down to 0 or the minimum value in the current time series whichever is smaller.
1156 * public/v2/js/statistics.js:
1157 (Statistics.MovingAverageStrategies): Use a wider window in Simple Moving Average by default.
1159 2015-02-10 Ryosuke Niwa <rniwa@webkit.org>
1161 Unreviewed build fix.
1164 (set get App.Pane.Ember.Object.extend):
1166 2015-02-10 Ryosuke Niwa <rniwa@webkit.org>
1168 New perf dashboard should have the ability to overlay moving average with an envelope
1169 https://bugs.webkit.org/show_bug.cgi?id=141438
1171 Reviewed by Andreas Kling.
1173 This patch adds three kinds of moving average strategies and two kinds of enveloping strategies:
1175 Simple Moving Average - The moving average x̄_i of x_i is computed as the arithmetic mean of values
1176 from x_(i - n) though x_(i + m) where n is a non-negative integer and m is a positive integer. It takes
1177 n, backward window size, and m, forward window size, as an argument.
1179 Cumulative Moving Average - x̄_i is computed as the arithmetic mean of all values x_0 though x_i.
1180 That is, x̄_1 = x_1 and x̄_i = ((i - 1) * M_(i - 1) + x_i) / i for all i > 1.
1182 Exponential Moving Average - x̄_i is computed as the weighted average of x_i and x̄_(i - 1) with α as
1183 an argument specifying x_i's weight. To be precise, x̄_1 = x_1 and x̄_i = α * x_i + (α - 1) x̄_(i-1).
1186 Average Difference - The enveloping delta d is computed as the arithmetic mean of the difference
1187 between each x_i and x̄_i.
1189 Moving Average Standard Deviation - d is computed like the standard deviation except the deviation
1190 for each term is measured from the moving average instead of the sample arithmetic mean. i.e. it uses
1191 the average of (x_i - x̄_i)^2 as the "sample variance" instead of the conventional (x_i - x̄)^2 where
1192 x̄ is the sample mean of all x_i's. This change was necessary since our time series is non-stationary.
1195 Each strategy is cloned for an App.Pane instance so that its parameterList can be configured per pane.
1196 The configuration of the currently chosen strategies is saved in the query string for convenience.
1198 Also added the "stat pane" to choose a moving average strategy and a enveloping strategy in each pane.
1200 * public/v2/app.css: Specify the fill color for all SVG groups in the pane toolbar icons.
1203 (App.Pane._fetch): Delegate the creation of 'chartData' to _computeChartData.
1204 (App.Pane.updateStatisticsTools): Added. Clones moving average and enveloping strategies for this pane.
1205 (App.Pane._cloneStrategy): Added. Clones a strategy for a new pane.
1206 (App.Pane._configureStrategy): Added. Finds and configures a strategy from the configuration retrieved
1207 from the query string via ChartsController.
1208 (App.Pane._computeChartData): Added. Creates chartData from fetchedData.
1209 (App.Pane._computeMovingAverage): Added. Computes the moving average and the envelope.
1210 (App.Pane._executeStrategy): Added.
1211 (App.Pane._updateStrategyConfigIfNeeded): Pushes the strategy configurations to the query string via
1213 (App.ChartsController._parsePaneList): Merged the query string arguments for the range and point
1214 selections, and added two new arguments for the moving average and the enveloping configurations.
1215 (App.ChartsController._serializePaneList): Ditto.
1216 (App.ChartsController._scheduleQueryStringUpdate): Observes strategy configurations.
1217 (App.PaneController.actions.toggleBugsPane): Hides the stat pane.
1218 (App.PaneController.actions.toggleSearchPane): Hides the stat pane.
1219 (App.PaneController.actions.toggleStatPane): Added.
1221 * public/v2/chart-pane.css: Added CSS rules for the new stat pane. Also added .foreground class for the
1222 current (as opposed to baseline and target) time series for when it's the most foreground graph without
1223 moving average and its envelope overlapping on top of it.
1225 * public/v2/index.html: Added the templates for the stat pane and the corresponding icon (Σ).
1227 * public/v2/interactive-chart.js:
1228 (App.InteractiveChartComponent.chartDataDidChange): Unset _totalWidth and _totalHeight to avoid exiting
1229 early inside _updateDimensionsIfNeeded when chartData changes after the initial layout.
1230 (App.InteractiveChartComponent.didInsertElement): Attach event listeners here instead of inside
1231 _constructGraphIfPossible since that could be called multiple times on the same SVG element.
1232 (App.InteractiveChartComponent._constructGraphIfPossible): Clear down the old SVG element we created
1233 but don't bother removing individual paths and circles. Added the code to show the moving average time
1234 series when there is one. Also add "foreground" class on SVG elements for the current time series when
1235 we're not showing the moving average. chart-pane.css has been updated to "dim down" the current time
1236 series when "foreground" is not set.
1237 (App.InteractiveChartComponent._minMaxForAllTimeSeries): Take the moving average time series into
1238 account when computing the y-axis range.
1239 (App.InteractiveChartComponent._brushChanged): Removed 'selectionIsLocked' argument as it's useless.
1241 * public/v2/js/statistics.js:
1242 (Statistics.MovingAverageStrategies): Added.
1243 (Statistics.EnvelopingStrategies): Added.
1245 2015-02-06 Ryosuke Niwa <rniwa@webkit.org>
1247 The delta value in the chart pane sometimes doens't show '+' for a positive delta
1248 https://bugs.webkit.org/show_bug.cgi?id=141340
1250 Reviewed by Andreas Kling.
1252 The bug was caused by computeStatus prefixing the value delta with '+' if it's greater than 0 after
1253 it had already been formatted. Fixed the bug by using a formatter that always emits a sign symbol.
1256 (App.Pane.computeStatus):
1257 (App.createChartData):
1259 2015-02-06 Ryosuke Niwa <rniwa@webkit.org>
1261 Unreviewed build fix. currentPoint wasn't defined when selectedPoints was used to find points.
1264 (App.PaneController._updateDetails):
1266 2015-02-06 Ryosuke Niwa <rniwa@webkit.org>
1268 Unreviewed. Commit the forgotten change.
1270 * public/include/manifest.php:
1272 2015-02-06 Ryosuke Niwa <rniwa@webkit.org>
1274 New perf dashboard should have multiple dashboard pages
1275 https://bugs.webkit.org/show_bug.cgi?id=141339
1277 Reviewed by Chris Dumez.
1279 Added the support for multiple dashboard pages. Also added the status of the latest data point.
1280 e.g. "5% better than target"
1282 * public/v2/app.css: Tweaked the styles to work around the fact Ember.js creates empty script elements.
1283 Also hid the border lines around charts on the dashboard page for a cleaner look.
1286 (App.IndexRoute): Added. Navigate to /dashboard/<defaultDashboardName> once the manifest.json is loaded.
1287 (App.IndexRoute.beforeModel): Added.
1288 (App.DashboardRoute): Added.
1289 (App.DashboardRoute.model): Added. Return the dashboard specified by the name.
1290 (App.CustomDashboardRoute): Added. This route is used for a customized dashboard specified by "grid".
1291 (App.CustomDashboardRoute.model): Create a dashboard model from "grid" query parameter.
1292 (App.CustomDashboardRoute.renderTemplate): Use the dashboard template.
1293 (App.DashboardController): Renamed from App.IndexController.
1294 (App.DashboardController.modelChanged): Renamed from gridChanged. Removed the code to deal with "grid"
1295 and "defaultDashboard" as these are taken care of by newly added routers.
1296 (App.DashboardController.computeGrid): Renamed from updateGrid. No longer updates "grid" since this is
1297 now done in actions.toggleEditMode.
1298 (App.DashboardController.actions.toggleEditMode): Navigate to CustomDashboardRoute when start editing
1299 an existing dashboard.
1301 (App.Pane.computeStatus): Moved from App.PaneController so that to be called in App.Pane.latestStatus.
1302 Also moved the code to compute the delta with respect to the previous data point from _updateDetails.
1303 (App.Pane._relativeDifferentToLaterPointInTimeSeries): Ditto.
1304 (App.Pane.latestStatus): Added. Used by the dashboard template to show the status of the latest result.
1306 (App.createChartData): Added deltaFormatter to show less significant digits for differences.
1308 (App.PaneController._updateDetails): Updated per changes to computeStatus.
1310 * public/v2/chart-pane.css: Added style rules for the status labels on the dashboard.
1312 * public/v2/data.js:
1313 (TimeSeries.prototype.lastPoint): Added.
1315 * public/v2/index.html: Prefetch manifest.json as soon as possible, show the latest data points' status
1316 on the dashboard, and enumerate all predefined dashboards.
1318 * public/v2/interactive-chart.js:
1319 (App.InteractiveChartComponent._relayoutDataAndAxes): Slightly adjust the offset at which we show unit
1320 for the dashboard page.
1322 * public/v2/manifest.js:
1323 (App.Dashboard): Inherit from App.NameLabelModel now that each predefined dashboard has a name.
1324 (App.MetricSerializer.normalizePayload): Parse all predefined dashboards instead of a single dashboard.
1325 IDs are generated for each dashboard for forward compatibility.
1327 (App.Manifest.dashboardByName): Added.
1328 (App.Manifest.defaultDashboardName): Added.
1329 (App.Manifest._fetchedManifest): Create dashboard model objects for all predefined ones.
1331 2015-02-05 Ryosuke Niwa <rniwa@webkit.org>
1333 Move commits viewer to the end of details view
1334 https://bugs.webkit.org/show_bug.cgi?id=141315
1336 Rubber-stamped by Andreas Kling.
1338 Show the difference instead of the old value per kling's request.
1341 (App.PaneController._updateDetails):
1342 * public/v2/index.html:
1344 2015-02-05 Ryosuke Niwa <rniwa@webkit.org>
1346 Move commits viewer to the end of details view
1347 https://bugs.webkit.org/show_bug.cgi?id=141315
1349 Reviewed by Andreas Kling.
1351 Improved the way list of commits are shown per kling's request.
1354 (App.PaneController._updateDetails): Always show the old value even when a single point is selected.
1356 * public/v2/chart-pane.css: Updated the style for the commits viewer.
1358 * public/v2/commits-viewer.js:
1359 (App.CommitsViewerComponent): Added "visible" property to hide the list of commits.
1360 (App.CommitsViewerComponent.actions.toggleVisibility): Added. Toggles "visible" property.
1362 * public/v2/index.html: Updated the template for commits viewer to support "visible" property. Also
1363 moved the commits viewers out of the details tables so that they don't interleave revision data.
1365 2015-02-05 Ryosuke Niwa <rniwa@webkit.org>
1367 New perf dashboard should compare results to baseline and target
1368 https://bugs.webkit.org/show_bug.cgi?id=141286
1370 Reviewed by Chris Dumez.
1372 Compare the selected value against baseline and target values as done in v1. e.g. "5% below target"
1373 Also use d3.format to format the selected value to show four significant figures.
1376 (App.Pane.searchCommit):
1377 (App.Pane._fetch): Create time series here via createChartData so that _computeStatus can use them
1378 to compute the status text without having to recreate them.
1379 (App.createChartData): Added.
1380 (App.PaneController._updateDetails): Use 3d.format on current and old values.
1381 (App.PaneController._computeStatus): Added. Computes the status text.
1382 (App.PaneController._relativeDifferentToLaterPointInTimeSeries): Added.
1383 (App.AnalysisTaskController._fetchedManifest): Use createChartData as done in App.Pane._fetch. Also
1384 format the values using chartData.formatter.
1386 * public/v2/chart-pane.css: Enlarge the status text. Show the status text in red if it's worse than
1387 the baseline and in blue if it's better than the target.
1389 * public/v2/data.js:
1390 (TimeSeries.prototype.findPointAfterTime): Added.
1392 * public/v2/index.html: Added a new tbody for the status text and the selected value. Also fixed
1393 the bug that we were not showing the old value's unit.
1395 * public/v2/interactive-chart.js:
1396 (App.InteractiveChartComponent._constructGraphIfPossible): Use chartData.formatter. Also cleaned up
1397 the code to show the baseline and the target lines.
1399 * public/v2/manifest.js:
1400 (App.Manifest.fetchRunsWithPlatformAndMetric): Added smallerIsBetter.
1402 2015-02-05 Ryosuke Niwa <rniwa@webkit.org>
1404 Unreviewed build fix.
1407 (App.IndexController.gridChanged): Use store.createRecord to create a custom dashboard as required by Ember.js
1409 2015-02-04 Ryosuke Niwa <rniwa@webkit.org>
1411 New perf dashboard doesn't preserve the number of days when clicking on a dashboard chart
1412 https://bugs.webkit.org/show_bug.cgi?id=141280
1414 Reviewed by Chris Dumez.
1416 Fixed the bug by passing in "since" as a query parameter to the charts page.
1418 Also fixed the styling issue that manifests when a JSON fetching fails on "Dashboard" page.
1420 * public/v2/app.css: Fixed CSS rules for error messages shown in the place of charts.
1422 (App.IndexController): Changed the default number of days from one month to one week.
1423 (App.IndexController._sharedDomainChanged): Set "since" property on the controller.
1424 * public/v2/index.html: Pass in "since" property on the controller as a query parameter.
1426 2015-02-04 Ryosuke Niwa <rniwa@webkit.org>
1428 New perf dashboard erroneously clears zoom when poping history items
1429 https://bugs.webkit.org/show_bug.cgi?id=141278
1431 Reviewed by Chris Dumez.
1433 The bug was caused by _sharedZoomChanged updating overviewSelection without updating mainPlotDomain.
1435 Updating overviewSelection resulted in _overviewSelectionChanged, which observes changes to overviewSelection,
1436 to schedule a call to propagateZoom, which in turn overrode "sharedZoom" we just parsed from the query string.
1439 (App.PaneController._overviewSelectionChanged): Don't schedule propagateZoom if the selected domain is already
1440 shown in the main plot.
1441 (App.PaneController._sharedZoomChanged): Set both overviewSelection and mainPlotDomain to avoid overriding
1442 "sharedZoom" via propagateZoom inside _overviewSelectionChanged.
1444 2015-02-04 Ryosuke Niwa <rniwa@webkit.org>
1446 New perf dashboard shows null as the aggregator name if no aggregation is done
1447 https://bugs.webkit.org/show_bug.cgi?id=141256
1449 Reviewed by Chris Dumez.
1451 Don't show the aggregator name if there isn't one.
1453 * public/v2/manifest.js:
1456 2015-02-04 Ryosuke Niwa <rniwa@webkit.org>
1458 Unreviewed build fix after r179611.
1460 * public/v2/interactive-chart.js:
1462 2015-02-04 Ryosuke Niwa <rniwa@webkit.org>
1464 Perf dashboard doesn’t show the right unit for Safari UI tests
1465 https://bugs.webkit.org/show_bug.cgi?id=141238
1467 Reviewed by Darin Adler.
1469 Safari UI tests use custom metrics that end with "Time". This patch teaches the perf dashboard how to
1470 get the unit for a given metric based on the suffix of the metric name instead of hard-coding the mapping
1471 between metrics and their units.
1473 * public/js/helper-classes.js:
1474 (PerfTestRuns): Use the suffix of the metric name to compute the unit.
1475 * public/v2/manifest.js:
1476 (App.Manifest.fetchRunsWithPlatformAndMetric): Ditto. Also set "useSI" property iff for "bytes".
1477 * public/v2/interactive-chart.js:
1478 (App.InteractiveChartComponent._constructGraphIfPossible): Respect useSI. Use toPrecision(3) otherwise.
1479 (App.InteractiveChartComponent._relayoutDataAndAxes): Place the unit vertically on the left of ticks.
1481 2015-02-04 Ryosuke Niwa <rniwa@webkit.org>
1483 Interactive chart component provides two duplicate API for highlighting points
1484 https://bugs.webkit.org/show_bug.cgi?id=141234
1486 Reviewed by Chris Dumez.
1488 Prior to this patch, the interactive chart component supported highlightedItems for finding commits
1489 on the main charts page and markedPoints to show the two end points in the analysis task page.
1491 This patch merges markedPoints into highlightedItems.
1494 (App.AnalysisTaskController._fetchedRuns): Use highlightedItems.
1495 * public/v2/chart-pane.css:
1496 * public/v2/index.html: Ditto.
1497 * public/v2/interactive-chart.js:
1498 (App.InteractiveChartComponent._constructGraphIfPossible): Make this._highlights an array instead of
1499 array of arrays. Also call _highlightedItemsChanged at the end to fix the bug that we never highlight
1500 items if highlightedItems was set before the initial layout.
1501 (App.InteractiveChartComponent._relayoutDataAndAxes):
1502 (App.InteractiveChartComponent._updateHighlightPositions): Now that highlights are circles instead of
1503 vertical lines, just set cx and cy as done for other "dots".
1504 (App.InteractiveChartComponent._highlightedItemsChanged): Exit early only if _clippedContainer wasn't
1505 already set; i.e. _constructGraphIfPossible hasn't been called. Also updated the logic to accommodate
1506 the fact this._highlights is an array of elements instead of an array of arrays of elements. Finally,
1507 set the radius of highlight circles here.
1509 2015-02-03 Ryosuke Niwa <rniwa@webkit.org>
1511 Don’t use repository names as id’s.
1512 https://bugs.webkit.org/show_bug.cgi?id=141226
1514 Reviewed by Chris Dumez.
1516 Not using repository names as their id's reduces the need to fetch the entire repositories table.
1517 Since names of repositories are available in manifest.json, we can resolve their names in the front end.
1519 * Websites/perf.webkit.org/public/api/runs.php:
1520 (parse_revisions_array): No longer uses $repository_id_to_name.
1521 (main): No longer populates $repository_id_to_name.
1523 * Websites/perf.webkit.org/public/api/triggerables.php:
1524 (main): Don't resolve repository names.
1526 * Websites/perf.webkit.org/public/include/manifest.php:
1527 (ManifestGenerator::repositories): Use repositories ids as keys in the result and include their names.
1528 (ManifestGenerator::bug_trackers): Don't resolve repository names.
1530 * Websites/perf.webkit.org/public/js/helper-classes.js:
1531 (TestBuild): Renamed repositoryName to repositoryId.
1532 (TestBuild.revision): Ditto.
1533 (TestBuild.formattedRevisions): Ditto. Continue to use the repository name in the formatted result
1534 since this is the text shown to human.
1536 * Websites/perf.webkit.org/public/v2/app.js:
1537 (App.pane.searchCommit): Renamed repositoryName to repositoryId.
1538 (App.PaneController._updateDetails): Ditto.
1539 (App.AnalysisTaskController.updateRoots): Ditto.
1541 * Websites/perf.webkit.org/public/v2/data.js:
1542 (Measurement): Ditto.
1543 (Measurement.prototype.commitTimeForRepository): Ditto.
1544 (Measurement.prototype.formattedRevisions): Ditto.
1546 * Websites/perf.webkit.org/public/v2/index.html: Use the repository name and the repository id as
1547 select element's label and value respectively.
1549 2015-02-03 Ryosuke Niwa <rniwa@webkit.org>
1551 Unreviewed build fix. Declare $repository_id_to_name in the global scope.
1553 * public/api/runs.php:
1555 2015-02-03 Ryosuke Niwa <rniwa@webkit.org>
1557 /api/runs.php should have main function
1558 https://bugs.webkit.org/show_bug.cgi?id=141220
1560 Reviewed by Benjamin Poulain.
1562 Wrapped the code inside main function for clarity.
1564 * public/api/runs.php:
1566 2015-01-27 Ryosuke Niwa <rniwa@webkit.org>
1568 Unreviewed build fix. "eta" isn't set on a in-progress build on a newly added builder.
1570 * tools/sync-with-buildbot.py:
1571 (find_request_updates):
1573 2015-01-23 Ryosuke Niwa <rniwa@webkit.org>
1575 Perf dashboard always assigns the result of A/B testing with build request 1
1576 https://bugs.webkit.org/show_bug.cgi?id=140382
1578 Reviewed by Darin Adler.
1580 The bug was caused by the expression array_get($report, 'jobId') or array_get($report, 'buildRequest')
1581 which always evaluated to 1 when the report contained jobId. Fixed the bug by cascading array_get instead.
1583 Also fixed a typo as well as a bug that reports were never associated with builds.
1585 * public/include/report-processor.php:
1586 (ReportProcessor::process): Don't use "or" to find the non-null value since that always evaluates to 1
1587 instead of the first non-null value.
1588 (ReportProcessor::resolve_build_id): Fixed the typo by adding the missing "$this->".
1589 (ReportProcessor::commit): Associate the report with the corresponding build as intended.
1591 2015-01-23 Ryosuke Niwa <rniwa@webkit.org>
1593 Unreviewed typo fix. The prefix in triggerable_configurations is "trigconfig", not "trigrepo".
1595 * public/admin/tests.php:
1597 2015-01-10 Ryosuke Niwa <rniwa@webkit.org>
1599 Unreviewed build fix. Removed the stale code.
1601 * public/admin/triggerables.php:
1603 2015-01-09 Ryosuke Niwa <rniwa@webkit.org>
1605 Perf dashboard should have the ability to post A/B testing builds
1606 https://bugs.webkit.org/show_bug.cgi?id=140317
1608 Rubber-stamped by Simon Fraser.
1610 This patch adds the support for triggering A/B testing from the perf dashboard.
1612 We add a few new tables to the database. "build_triggerables", which represents a set of builders
1613 that accept A/B testing. "triggerable_repositories" associates each "triggerable" with a fixed set
1614 of repositories for which an arbitrary revision can be specified for A/B testing.
1615 "triggerable_configurations" specifies a triggerable available on a given test on a given platform.
1616 "roots" table which specifies the revision used in a given root set in each repository.
1618 * init-database.sql: Added "build_triggerables", "triggerable_repositories",
1619 "triggerable_configurations", and "roots" tables. Added references to "build_triggerables",
1620 "platforms", and "tests" tables as well as columns to store status, status url, and creation time
1621 to build_requests table. Also made each test group's name unique in a given analysis task as it
1622 would be confusing to have multiple test groups of the same name.
1624 * public/admin/tests.php: Added the UI and the code to associate a test with a triggerable.
1626 * public/admin/triggerables.php: Added. Manages the list of triggerables as well as repositories
1627 for which a specific revision can be set in an A/B testing on a given triggerable.
1629 * public/api/build-requests.php: Added. Returns the list of open build requests on a specified
1630 triggerable. Also updates the status' and the status urls of specified build requests when
1631 buildRequestUpdates is provided in the raw POST data.
1634 * public/api/runs.php:
1635 (fetch_runs_for_config): Don't include results associated with a build request, meaning they are
1636 results of an A/B testing.
1638 * public/api/test-groups.php:
1639 (main): Use the newly added BuildRequestsFetcher. Also merged fetch_test_groups_for_task back.
1641 * public/api/triggerables.php: Added.
1642 (main): Returns a list of triggerables or a triggerable associated with a given analysis task.
1644 * public/include/admin-header.php:
1646 * public/include/build-requests-fetcher.php: Added. Extracted from public/api/test-groups.php.
1647 (BuildRequestsFetcher): This class abstracts the process of fetching a list of builds requests
1648 and root sets used in those requests.D
1649 (BuildRequestsFetcher::__construct):
1650 (BuildRequestsFetcher::fetch_for_task):
1651 (BuildRequestsFetcher::fetch_for_group):
1652 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable):
1653 (BuildRequestsFetcher::has_results):
1654 (BuildRequestsFetcher::results):
1655 (BuildRequestsFetcher::results_with_resolved_ids):
1656 (BuildRequestsFetcher::results_internal):
1657 (BuildRequestsFetcher::root_sets):
1658 (BuildRequestsFetcher::fetch_roots_for_set):
1660 * public/include/db.php:
1661 (Database::prefixed_column_names): Don't return "$prefix_" when there are no columns.
1662 (Database::insert_row): Support taking an empty array for values. This is useful in "root_sets"
1663 table since it only has the primary key, id, column.
1664 (Database::select_or_insert_row):
1665 (Database::update_or_insert_row):
1666 (Database::update_row): Added.
1667 (Database::_select_update_or_insert_row): Takes an extra argument specifying whether a new row
1668 should be inserted when no row matches the specified criteria. This is used while updating
1669 build_requests' status and url in public/api/build-requests.php since we shouldn't be inserting
1670 new build requests in that API.
1671 (Database::select_rows): Also use "1 == 1" in the select query when the query criteria is empty.
1672 This is used in public/api/triggerables.php when no analysis task is specified.
1674 * public/include/json-header.php:
1675 (find_triggerable_for_task): Added. Finds a triggerable available on a given test. We return the
1676 triggerable associated with the closest ancestor of the test. Since issuing a new query for each
1677 ancestor test is expensive, we retrieve triggerable for all ancestor tests at once and manually
1678 find the closest ancestor with a triggerable.
1680 * public/include/report-processor.php:
1681 (ReportProcessor::process):
1682 (ReportProcessor::resolve_build_id): Associate a build request with the newly created build
1683 if jobId or buildRequest is specified.
1685 * public/include/test-name-resolver.php:
1686 (TestNameResolver::map_metrics_to_tests): Store the entire metric row instead of its name so that
1687 test_exists_on_platform can use it. The last diff in public/admin/tests.php adopts this change.
1688 (TestNameResolver::test_exists_on_platform): Added. Returns true iff the test has ever run on
1691 * public/include/test-path-resolver.php: Added.
1692 (TestPathResolver): This class abstracts the ancestor chains of a test. It retrieves the entire
1693 "tests" table to do this since there could be arbitrary number of ancestors for a given test.
1694 This class is a lot more lightweight than TestNameResolver, which retrieves a whole bunch of tables
1695 in order to compute full test metric names.
1696 (TestPathResolver::__construct):
1697 (TestPathResolver::ancestors_for_test): Returns the ordered list of ancestors from the closest to
1698 the highest (a test without a parent).
1699 (TestPathResolver::path_for_test): Returns a test "path", the ordered list of test names from
1700 the highest ancestor to the test itself.
1701 (TestPathResolver::ensure_id_to_test_map): Fetches "tests" table to construct id_to_test_map.
1703 * public/privileged-api/create-test-group.php: Added. An API to create A/B testing groups.
1705 (commit_sets_from_root_sets): Given a dictionary of repository names to a pair of revisions
1706 for sets A and B respectively, returns a pair of arrays, each of which contains the corresponding
1707 set of "commits" for sets A and B respectively. e.g. {"WebKit": [1, 2], "Safari": [3, 4]} will
1708 result in [[WebKit commit at r1, Safari commit at r3], [WebKit commit at r2, Safari commit at r4]].
1710 * public/v2/analysis.js:
1711 (App.AnalysisTask.testGroups): Takes arguments so that set('testGroups') will invalidate the cache.
1712 (App.AnalysisTask.triggerable): Added. Retrieves the triggerable associated with the task lazily.
1713 (App.TestGroup.rootSets): Added. Returns the list of root set ids used in this A/B testing group.
1714 (App.TestGroup.create): Added. Creates a new A/B testing group.
1715 (App.Triggerable): Added.
1716 (App.TriggerableAdapter): Added.
1717 (App.TriggerableAdapter.buildURL): Added.
1718 (App.BuildRequest.testGroup): Renamed from group.
1719 (App.BuildRequest.orderLabel): Added. One-based index to be used in labels.
1720 (App.BuildRequest.config): Added. Returns either 'A' or 'B' depending on the configuration used
1721 in this build request.
1722 (App.BuildRequest.status): Added.
1723 (App.BuildRequest.statusLabel): Added. Returns a human friendly label for the current status.
1724 (App.BuildRequest): Removed buildNumber, buildBuilder, as well as buildTime as they're unused.
1727 (App.AnalysisTaskController.testGroups): Added.
1728 (App.AnalysisTaskController.possibleRepetitionCounts): Added.
1729 (App.AnalysisTaskController.updateRoots): Renamed from roots. This is also no longer a property
1730 but an observer that updates "roots" property. Filter out the repositories that are not accepted
1731 by the associated triggerable as they will be ignored.
1732 (App.AnalysisTaskController.actions.createTestGroup): Added.
1734 * public/v2/index.html: Updated the UI, and added a form element to trigger createTestGroup action.
1736 * tools/sync-with-buildbot.py: Added. This scripts posts new builds on buildbot and reports back
1737 the status of those builds to the perf dashboard. A similar script can be written to support
1738 other continuous builds systems.
1739 (main): Fetches the list of pending builds as well as currently running or completed builds from
1740 a buildbot, and report new statuses of builds requests to the perf dashboard. It will then schedule
1741 a single new build on each builder with no pending builds, and marks the set of open build requests
1742 that have been scheduled to run on the buildbot but not found in the first step as stale.
1743 (load_config): Loads a JSON that contains the configurations for each builder. e.g.
1746 "platform": "mac-mavericks",
1747 "test": ["Parser", "html5-full-render.html"],
1748 "builder": "Trunk Syrah Production Perf AB Tests",
1750 "forcescheduler": "force-mac-mavericks-release-perf",
1751 "webkit_revision": "$WebKit",
1752 "jobid": "$buildRequest"
1757 (find_request_updates): Return a list of build request status updates to make based on the pending
1758 builds as well as in-progress and completed builds on each builder on the buildbot. When a build is
1759 completed, we use the special status "failedIfNotCompleted" which results in "failed" status only
1760 if the build request had not been completed. This is necessary because a failed build will not
1761 report its failed-ness back to the perf dashboard in some cases; e.g. lost slave or svn up failure.
1762 (update_and_fetch_build_requests): Submit the build request status updates and retrieve the list
1763 of open requests the perf dashboard has.
1764 (find_stale_request_updates): Compute the list of build requests that have been scheduled on the
1765 buildbot but not found in find_request_updates. These build requests are lost. e.g. a master reboot
1766 or human canceling a build may trigger such a state.
1767 (schedule_request): Schedules a build with the arguments specified in the configuration JSON after
1768 replacing repository names with their revisions and buildRequest with the build request id.
1769 (config_for_request): Finds a builder for the test and the platform of a build request.
1770 (fetch_json): Fetches a JSON from the specified URL, optionally with BasicAuth.
1771 (property_value_from_build): Returns the value of a specific property in a buildbot build.
1772 (request_id_from_build): Returns the build request id of a given buildbot build if there is one.
1774 2015-01-09 Ryosuke Niwa <rniwa@webkit.org>
1776 Cache-control should be set only on api/runs
1777 https://bugs.webkit.org/show_bug.cgi?id=140312
1779 Reviewed by Andreas Kling.
1781 Some JSON APIs such as api/analysis-tasks can't be cached even for a short period of time (e.g. a few minutes)
1782 since they can be modified by the user on demand. Since only api/runs.php takes a long time to generate JSONs,
1783 just set cache-control there instead of json-header.php which is used by other JSON APIs.
1785 Also set date_default_timezone_set in db.php since we never use non-UTC timezone in our scripts.
1787 * public/api/analysis-tasks.php:
1788 * public/api/runs.php: Set the cache control headers.
1789 * public/api/test-groups.php:
1790 * public/include/db.php: Set the default timezone to UTC.
1791 * public/include/json-header.php: Don't set the cache control headers.
1793 2015-01-09 Ryosuke Niwa <rniwa@webkit.org>
1795 api/report-commit should authenticate with a slave name and password
1796 https://bugs.webkit.org/show_bug.cgi?id=140308
1798 Reviewed by Benjamin Poulain.
1800 Use a slave name and a password to authenticate new commit reports.
1802 * public/api/report-commits.php:
1804 * public/include/json-header.php:
1805 (verify_slave): Renamed and repurposed from verify_builder in report-commits.php. Now authenticates with
1806 a slave name and a password instead of a builder name and a password.
1807 * tests/api-report-commits.js: Updated tests.
1808 * tools/pull-svn.py:
1809 (main): Renamed variables.
1810 (submit_commits): Submits slaveName and slavePassword instead of builderName and builderPassword.
1812 2014-12-19 Ryosuke Niwa <rniwa@webkit.org>
1814 Perf dashboard should support authentication via a slave password
1815 https://bugs.webkit.org/show_bug.cgi?id=139837
1817 Reviewed by Andreas Kling.
1819 For historical reasons, perf dashboard conflated builders and build slaves. As a result we ended up
1820 having to add multiple builders with the same password when a single build slave is shared among them.
1822 This patch introduces the concept of build_slave into the perf dashboard to end this madness.
1824 * init-database.sql: Added build_slave table as well as references to it in builds and reports.
1826 * public/admin/build-slaves.php: Added.
1828 * public/admin/builders.php: Added the support for updating passwords.
1830 * public/include/admin-header.php:
1831 (update_field): Takes an extra argument when a new value needs to be supplied by the caller instead of
1832 being retrieved from $_POST.
1833 (AdministrativePage::render_table): Use array_get to retrieve a value out of the database row since
1834 the raw may not exist (e.g. new_password).
1835 (AdministrativePage::render_form_to_add): Added the support for post_insertion. Don't render the form
1836 control here when this flag evaluates to TRUE.
1838 * public/include/report-processor.php:
1839 (ReportProcessor::process): Added the logic to authenticate with slaveName and slavePassword if those
1840 values are present in the report. In addition, try authenticating builderName with slavePassword if
1841 builderPassword is not specified. When neither password is specified, exit with BuilderNotFound.
1842 Also insert the slave or the builder whichever is missing after we've successfully authenticated.
1843 (ReportProcessor::construct_build_data): Takes a builder ID and an optional slave ID instead of
1845 (ReportProcessor::store_report): Store the slave ID with the report.
1846 (ReportProcessor::resolve_build_id): Exit with MismatchingBuildSlave when the slave associated with
1847 the matching build is different from what's being reported.
1849 * tests/api-report.js: Added a bunch of tests to test the new features of /api/report.
1852 2014-12-18 Ryosuke Niwa <rniwa@webkit.org>
1854 New perf dashboard should not duplicate author information in each commit
1855 https://bugs.webkit.org/show_bug.cgi?id=139756
1857 Reviewed by Darin Adler.
1859 Instead of each commit having author name and email, make it reference a newly added committers table.
1860 Also replace "email" by "account" since some repositories don't use emails as account names.
1862 This improves the keyword search performance in commits.php since LIKE now runs on committers table,
1863 which only contains as many rows as there are accounts in each repository, instead of commits table
1864 which contains every commit ever happened in each repository.
1866 To migrate an existing database into match the new schema, run:
1870 INSERT INTO committers (committer_repository, committer_name, committer_email)
1871 (SELECT DISTINCT commit_repository, commit_author_name, commit_author_email
1872 FROM commits WHERE commit_author_email IS NOT NULL);
1874 ALTER TABLE commits ADD COLUMN commit_committer integer REFERENCES committers ON DELETE CASCADE;
1876 UPDATE commits SET commit_committer = committer_id FROM committers
1877 WHERE commit_repository = committer_repository AND commit_author_email = committer_email;
1879 ALTER TABLE commits DROP COLUMN commit_author_name CASCADE;
1880 ALTER TABLE commits DROP COLUMN commit_author_email CASCADE;
1884 * init-database.sql: Added committers table, and replaced author columns in commits table by a foreign
1885 reference to committers. Also added the missing drop table statements.
1887 * public/api/commits.php:
1888 (main): Fetch the corresponding committers row for a single commit. Also wrap a single commit by
1889 an array here instead of doing it in format_commit.
1890 (fetch_commits_between): Updated queries to JOIN commits with committers.
1891 (format_commit): Takes both commit and committers rows. Also don't wrap the result in an array as that
1892 is now done in main.
1894 * public/api/report-commits.php:
1895 (main): Store the reported committer information or update the existing entry if there is one.
1897 * tests/admin-regenerate-manifest.js: Fixed tests.
1899 * tests/api-report-commits.js: Ditto. Also added a test for updating an existing committer entry.
1901 * tools/pull-svn.py: Renamed email to account.
1903 (fetch_commit_and_resolve_author):
1905 (resolve_author_name_from_account):
1906 (resolve_author_name_from_email): Deleted.
1908 2014-12-17 Ryosuke Niwa <rniwa@webkit.org>
1910 Unreviewed build fix.
1912 * public/v2/index.html: Include js files we extracted in r177424.
1914 2014-12-16 Ryosuke Niwa <rniwa@webkit.org>
1916 Unreviewed. Adding the forgotten svnprop.
1918 * tools/pull-svn.py: Added property svn:executable.
1920 2014-12-16 Ryosuke Niwa <rniwa@webkit.org>
1922 Split InteractiveChartComponent and CommitsViewerComponent into separate files
1923 https://bugs.webkit.org/show_bug.cgi?id=139716
1925 Rubber-stamped by Benjamin Poulain.
1927 Refactored InteractiveChartComponent and CommitsViewerComponent out of app.js into commits-viewer.js
1928 and interactive-chart.js respectively since app.js has gotten really large.
1931 * public/v2/commits-viewer.js: Added.
1932 * public/v2/interactive-chart.js: Added.
1934 2014-12-02 Ryosuke Niwa <rniwa@webkit.org>
1936 New perf dashboard's chart UI is buggy
1937 https://bugs.webkit.org/show_bug.cgi?id=139214
1939 Reviewed by Chris Dumez.
1941 The bugginess was caused by weird interactions between charts and panes. Rewrote the code to fix it.
1943 Superfluous selectionChanged and domainChanged "event" actions were removed from the interactive chart
1944 component. This is not how Ember.js components should interact to begin with. The component now exposes
1945 selectedPoints and always updates selection instead of sharedSelection.
1948 (App.ChartsController.present): Added. We can't call Date.now() in various points in our code as that
1949 would lead to infinite mutual recursions since X-axis domain values wouldn't match up.
1950 (App.ChartsController.updateSharedDomain): This function was completely useless. The overview's start
1951 and end time should be completely determined by "since" and the present time.
1952 (App.ChartsController._startTimeChanged): Ditto.
1953 (App.ChartsController._scheduleQueryStringUpdate):
1954 (App.ChartsController._updateQueryString): Set "zoom" only if it's different from the shared domain.
1956 (App.domainsAreEqual): Moved from InteractiveChartComponent._xDomainsAreSame.
1958 (App.PaneController.actions.createAnalysisTask): Use selectedPoints property set by the chart.
1959 (App.PaneController.actions.overviewDomainChanged): Removed; only needed to call updateSharedDomain.
1960 (App.PaneController.actions.rangeChanged): Removed. _showDetails (renamed to _updateDetails) directly
1961 observes the changes to selectedPoints property as it gets updated by the main chart.
1962 (App.PaneController._overviewSelectionChanged): This was previously a dead code. Now it's used again
1963 with a bug fix. When the overview selection is cleared, we use the same domain in the main chart and
1965 (App.PaneController._sharedDomainChanged): Fixed a but that it erroneously updates the overview domain
1966 when domain arrays aren't identical. This was causing a subtle race with other logic.
1967 (App.PaneController._sharedZoomChanged): Ditto. Also don't set mainPlotDomain here as any changes to
1968 overviewSelection will automatically propagate to the main plot's domain as they're aliased.
1969 (App.PaneController._currentItemChanged): Merged into _updateDetails (renamed from _showDetails).
1970 (App.PaneController._updateDetails): Previously, this function took points and inspected _hasRange to
1971 see if those two points correspond to a range or a single data point. Rewrote all that logic by
1972 directly observing selectedPoints and currentItem properties instead of taking points and relying on
1973 an instance variable, which was a terrible API.
1974 (App.PaneController._updateCanAnalyze): Use selectedPoints property. Since this property is only set
1975 when the main plot has a selected range, we don't have to check this._hasRange anymore.
1977 (App.InteractiveChartComponent._updateDomain): No longer sends domainChanged "event" action.
1978 (App.InteractiveChartComponent._sharedSelectionChanged): Removed. This is a dead code.
1979 (App.InteractiveChartComponent._updateSelection):
1980 (App.InteractiveChartComponent._xDomainsAreSame): Moved to App.domainsAreEqual.
1981 (App.InteractiveChartComponent._setCurrentSelection): Update the selection only if needed. Also set
1982 selectedPoints property.
1984 (App.AnalysisTaskController._fetchedRuns):
1985 (App.AnalysisTaskController._rootChangedForTestSet):
1987 * public/v2/index.html:
1988 Removed non-functional sharedSelection and superfluous selectionChanged and domainChanged actions.
1990 2014-11-21 Ryosuke Niwa <rniwa@webkit.org>
1992 Unreviewed. Fixed syntax errors.
1994 * init-database.sql:
1995 * public/api/commits.php:
1997 2014-11-21 Ryosuke Niwa <rniwa@webkit.org>
1999 The dashboard on new perf monitor should be configurable
2000 https://bugs.webkit.org/show_bug.cgi?id=138994
2002 Reviewed by Benjamin Poulain.
2004 For now, make it configurable via config.json. We should eventually make it configurable via
2005 an administrative page but this will do for now.
2007 * config.json: Added the empty dashboard configuration.
2009 * public/include/manifest.php: Include the dashboard configuration in the manifest file.
2012 (App.IndexController): Removed defaultTable since this is now dynamically obtained via App.Manifest.
2013 (App.IndexController.gridChanged): Use App.Dashboard to parse the dashboard configuration.
2014 Also obtain the default configuration from App.Manifest.
2015 (App.IndexController._normalizeTable): Moved to App.Dashboard.
2017 * public/v2/manifest.js:
2018 (App.Repository.urlForRevision): Fixed the position of the open curly bracket.
2019 (App.Repository.urlForRevisionRange): Ditto.
2020 (App.Dashboard): Added.
2021 (App.Dashboard.table): Extracted from App.IndexController.gridChanged.
2022 (App.Dashboard.rows): Ditto.
2023 (App.Dashboard.headerColumns): Ditto.
2024 (App.Dashboard._normalizeTable): Moved from App.IndexController._normalizeTable.
2025 (App.MetricSerializer.normalizePayload): Synthesize a dashboard record from the configuration.
2026 Since there is exactly one dashboard object per app, it's okay to hard code an id here.
2027 (App.Manifest._fetchedManifest): Set defaultDashboard to the one and only one dashboard we have.
2029 2014-11-21 Ryosuke Niwa <rniwa@webkit.org>
2031 There should be a way to associate bugs with analysis tasks
2032 https://bugs.webkit.org/show_bug.cgi?id=138977
2034 Reviewed by Benjamin Poulain.
2036 Updated associate-bug.php to match the new database schema.
2038 * public/include/json-header.php:
2039 (require_format): Removed the call to camel_case_words_separated_by_underscore since the name is
2040 already camel-cased in require_existence_of. This makes the function usable elsewhere.
2042 * public/privileged-api/associate-bug.php:
2043 (main): Changed the API to take run, bugTracker, and number to match the new database schema.
2044 Also verify that those values are integers using require_format.
2046 * public/v2/analysis.js:
2047 (App.AnalysisTask.label): Added. Concatenates the task's name with the bug numbers.
2048 (App.Bug.label): Added.
2049 (App.BugAdapter): Added.
2050 (App.BugAdapter.createRecord): Use PrivilegedAPI instead of the builtin ajax call.
2051 (App.BuildRequest): Inherit from newly added App.Model, which is set to DS.Model right now.
2053 * public/v2/app.css: Renamed .test-groups to .analysis-group. Also added new rules for the table
2054 containing the bug information.
2057 (App.InteractiveChartComponent._rangesChanged): Added label to range bar objects.
2058 (App.AnalysisTaskRoute):
2059 (App.AnalysisTaskController): Replaced the functionality of App.AnalysisTaskViewModel.
2060 (App.AnalysisTaskController._fetchedManifest): Added.
2061 (App.AnalysisTaskController.actions.associateBug): Added.
2063 * public/v2/chart-pane.css: Renamed .bugs-pane to .analysis-pane.
2065 * public/v2/data.js:
2066 (Measurement.prototype.associateBug): Deleted.
2068 * public/v2/index.html: Renamed .bugs-pane to .analysis-pane and .test-groups to .analysis-group.
2069 Added a table show the bug information. Also hide the chart until chartData is available.
2071 * public/v2/manifest.js:
2074 2014-11-20 Ryosuke Niwa <rniwa@webkit.org>
2076 Fix misc bugs and typos in app.js
2077 https://bugs.webkit.org/show_bug.cgi?id=138946
2079 Reviewed by Benjamin Poulain.
2082 (App.DashboardPaneProxyForPicker._platformOrMetricIdChanged):
2083 (App.ChartsController.init):
2084 (App.buildPopup): Renamed from App.BuildPopup.
2085 (App.InteractiveChartComponent._constructGraphIfPossible): Fixed the bug that we were calling
2086 remove() on the wrong object (an array as opposed to elements in the array).
2087 (App.InteractiveChartComponent._highlightedItemsChanged): Check the length of _highlights as
2088 _highlights is always an array and evalutes to true.
2090 2014-11-20 Ryosuke Niwa <rniwa@webkit.org>
2092 New perf dashboard should provide UI to create a new analysis task
2093 https://bugs.webkit.org/show_bug.cgi?id=138910
2095 Reviewed by Benjamin Poulain.
2097 This patch reverts some parts of r175006 and re-introduces bugs associated with analysis tasks.
2098 I'll add UI to show and edit bug numbers associated with an analysis task in a follow up patch.
2100 With this patch, we can create a new analysis task by selection a range of points and opening
2101 "analysis pane" (renamed from "bugs pane"). Each analysis task created is represented by a yellow bar
2102 in the chart hyperlinked to the analysis task.
2104 * init-database.sql: Redefined the bugs to be associated with an analysis task instead of a test run.
2106 * public/api/analysis-tasks.php: Added the support for querying analysis tasks for a specific metric
2107 on a specific platform. Also retrieve and return all bugs associated with analysis tasks.
2109 (fetch_and_push_bugs_to_tasks): Added. Fetches all bugs associated with an array of analysis tasks
2110 and adds the associated bugs to each task in the array.
2113 * public/api/runs.php: Reverted changes made in r175006.
2114 (fetch_runs_for_config):
2117 * public/api/test-groups.php:
2118 (fetch_test_groups_for_task): Use the newly added Database::select_rows.
2120 * public/include/db.php:
2121 (Database::select_first_or_last_row):
2122 (Database::select_rows): Extracted from select_first_or_last_row.
2124 * public/v2/analysis.js:
2125 (App.AnalysisTask): Added "bugs" property.
2126 (App.Bug): Added now that bugs are regular data store objects.
2129 (App.Pane._fetch): Calls this.fetchAnalyticRanges to fetch analysis tasks as well as test runs.
2130 (App.Pane.fetchAnalyticRanges): Added. Fetches analysis tasks for the current metric on the current
2131 platform that are associated with a specific range of runs.
2132 (App.PaneController.actions.toggleBugsPane): Updated per showingBugsPane to showingAnalysisPane rename.
2133 (App.PaneController.actions.associateBug): Deleted.
2134 (App.PaneController.actions.createAnalysisTask): Replaced the pre-condition checks with assertions as
2135 this action should never be triggered when the pre-condition is not met. Also re-fetch analysis tasks
2136 once we've created one.
2137 (App.PaneController.toggleSearchPane): Updated per showingBugsPane to showingAnalysisPane rename.
2138 (App.PaneController._detailsChanged): Ditto. Removed selectedSinglePoint since it's no longer used.
2139 (App.PaneController._showDetails): Call _updateCanAnalyze to update the status of "Analyze" button.
2140 (App.PaneController._updateBugs): Deleted.
2141 (App.PaneController._updateMarkedPoints): Deleted.
2142 (App.PaneController._updateCanAnalyze): Added. Disables the button to create an analysis task when
2143 the name is missing or when at most one point is selected.
2145 (App.InteractiveChartComponent._constructGraphIfPossible): Update the locations of range rects.
2146 (App.InteractiveChartComponent._relayoutDataAndAxes): Ditto.
2147 (App.InteractiveChartComponent._mousePointInGraph): Don't return a point unless the mouse cursor is
2148 on our svg element to avoid locking the current item when a bar shown for an analysis task is clicked.
2149 (App.InteractiveChartComponent._rangesChanged): Added. Creates an array of objects representing
2150 clickable bars for analysis tasks.
2151 (App.InteractiveChartComponent._updateRangeBarRects): Computes the inline style used by each clickable
2152 bar for analysis tasks to place them at the right location.
2153 (App.InteractiveChartComponent.actions.openRange): Added. Forwards the action to the parent controller.
2155 * public/v2/chart-pane.css:
2156 (.chart .extent): Use the same color as the vertical indicator in the highlight behind the selection.
2157 (.chart .rangeBar): Added.
2159 * public/v2/data.js:
2160 (TimeSeries.prototype.nextPoint): Added. Used by _rangesChanged.
2162 * public/v2/index.html: Renamed "bugs pane" to "analysis pane" and removed the UI to associate bugs.
2163 This ability will be reinstated in a follow up patch. Also added a container div and spans for analysis
2164 task bars in the interactive chart component.
2166 2014-11-19 Ryosuke Niwa <rniwa@webkit.org>
2168 Fix typos in r176203.
2171 (App.ChartsController.actions.addPaneByMetricAndPlatform):
2172 (App.AnalysisTaskRoute):
2174 2014-11-18 Ryosuke Niwa <rniwa@webkit.org>
2176 Unreviewed. Updated the install instruction.
2180 2014-11-17 Ryosuke Niwa <rniwa@webkit.org>
2182 App.Manifest shouldn't use App.__container__.lookup
2183 https://bugs.webkit.org/show_bug.cgi?id=138768
2185 Reviewed by Andreas Kling.
2187 Removed the hack to find the store object via App.__container__.lookup.
2188 Pass around the store object instead.
2191 (App.DashboardRow._createPane): Add "store" property to the pane.
2192 (App.DashboardPaneProxyForPicker._platformOrMetricIdChanged): Ditto.
2193 (App.IndexController.gridChanged): Ditto.
2194 (App.IndexController.actions.addRow): Ditto.
2195 (App.IndexController.init): Ditto.
2196 (App.Pane._fetch): Ditto.
2197 (App.ChartsController._parsePaneList): Ditto.
2198 (App.ChartsController._updateQueryString): Ditto.
2199 (App.ChartsController.actions.addPaneByMetricAndPlatform): Ditto.
2200 (App.BuildPopup): Ditto.
2201 (App.AnalysisTaskRoute.model): Ditto.
2202 (App.AnalysisTaskViewModel._taskUpdated): Ditto.
2204 * public/v2/manifest.js:
2205 (App.Manifest.fetch): Removed the code to find the store object.
2207 2014-11-08 Ryosuke Niwa <rniwa@webkit.org>
2209 Fix Ember.js warnings the new perf dashboard
2210 https://bugs.webkit.org/show_bug.cgi?id=138531
2212 Reviewed by Darin Adler.
2214 Fixed various warnings.
2217 (App.InteractiveChartComponent._relayoutDataAndAxes): We can't use "rem". Use this._rem as done for x.
2218 * public/v2/data.js:
2219 (PrivilegedAPI._post): Removed the superfluous console.log.
2220 (CommitLogs.fetchForTimeRange): Ditto.
2221 * public/v2/index.html: Added tbody as required by the HTML specification.
2223 2014-11-07 Ryosuke Niwa <rniwa@webkit.org>
2225 Fix typos in r175768.
2228 (App.AnalysisTaskViewModel.roots):
2230 2014-11-07 Ryosuke Niwa <rniwa@webkit.org>
2232 Introduce the concept of analysis task to perf dashboard
2233 https://bugs.webkit.org/show_bug.cgi?id=138517
2235 Reviewed by Andreas Kling.
2237 Introduced the concept of an analysis task, which is created for a range of measurements for a given metric on
2238 a single platform and used to bisect regressions in the range.
2240 Added a new page to see the list of active analysis tasks and a page to view the contents of an analysis task.
2242 * init-database.sql: Added a bunch of tables to store information about analysis tasks.
2243 analysis_tasks - Represents each analysis task. Associated with a platform and a metric and possibly with two
2244 test runs. Analysis tasks not associated with test runs are used for try new patches.
2245 analysis_test_groups - A test group in an analysis task represents a bunch of related A/B testing results.
2246 root_sets - A root set represents a set of roots (or packages) installed in each A/B testing.
2247 build_requests - A build request represents a single pending build for A/B testing.
2249 * public/api/analysis-tasks.php: Added. Returns the specified analysis task or all analysis tasks in an array.
2253 * public/api/test-groups.php: Added. Returns analysis task groups for the specified analysis task or returns
2254 the specified analysis task group as well as build requests associated with them.
2256 (fetch_test_groups_for_task):
2257 (fetch_build_requests_for_task):
2258 (fetch_build_requests_for_group):
2259 (format_test_group):
2260 (format_build_request):
2262 * public/include/json-header.php:
2263 (remote_user_name): Extracted from compute_token so that we can use it in create-analysis-task.php.
2266 * public/privileged-api/associate-bug.php:
2267 (main): Fixed a typo.
2269 * public/privileged-api/create-analysis-task.php: Added. Creates a new analysis task for a given test run range.
2272 (ensure_config_from_runs):
2274 * public/privileged-api/generate-csrf-token.php: Use remote_user_name.
2276 * public/v2/analysis.js: Added. Various Ember data store models to represent analysis tasks and related objects.
2278 (App.AnalysisTask.create):
2280 (App.TestGroupAdapter):
2281 (App.AnalysisTaskSerializer):
2282 (App.TestGroupSerializer):
2285 * public/v2/app.css: Added style rules for the analysis page.
2288 (App.Pane._fetch): Use fetchRunsWithPlatformAndMetric, which has been refactored into App.Manifest.
2290 (App.PaneController.actions.toggleBugsPane): Show bugs pane even when there are no bug trackers or there is not
2291 exactly one selected point as we can still create an analysis task.
2292 (App.PaneController.actions.associateBug): Renamed singlySelectedPoint to selectedSinglePoint to be more
2293 grammatical and also alert'ed the error message when there is one.
2294 (App.PaneController.actions.createAnalysisTask): Added. Creates a new analysis task and opens it in a new tab.
2295 Since window.open only works during the click, we open the new "window" preemptively and navigates or closes it
2296 once XHR request has completed.
2297 (App.PaneController._detailsChanged): Changes due to singlySelectedPoint to selectedSinglePoint rename.
2298 (App.PaneController._updateBugs): Fixed a bug that we were showing bugs in the previous point when a single point
2299 is selected in the details pane.
2301 (App.AnalysisRoute): Added.
2302 (App.AnalysisTaskRoute): Added.
2303 (App.AnalysisTaskViewModel): Added.
2304 (App.AnalysisTaskViewModel._taskUpdated): Fetch runs for the associated platform and metric.
2305 (App.AnalysisTaskViewModel._fetchedRuns): Setup the chart data to show.
2306 (App.AnalysisTaskViewModel.testSets): The computed property used to update roots for all repositories/projects.
2307 (App.AnalysisTaskViewModel._rootChangedForTestSet): Updates root selections for all repositories/projects when
2308 the user selects an option for all roots in A or B configuration.
2309 (App.AnalysisTaskViewModel.roots): The computed property used to show root choices for each repository/project.
2311 * public/v2/chart-pane.css: Added style rules for details view in the analysis task page.
2313 * public/v2/data.js:
2314 (Measurement.prototype._formatRevisionRange): Don't prefix a revision number with "At " when there is no previous
2315 point so that we can use it in App.AnalysisTaskViewModel.roots.
2316 (TimeSeries.prototype.findPointByMeasurementId): Added.
2317 (TimeSeries.prototype.seriesBetweenPoints): Added.
2319 * public/v2/index.html: Use Metric.fullName since the same value is needed in the analysis task page. Also added
2320 a button to create an analysis task, and made bugs pane button always enabled since we can an analysis task even
2321 when multiple points are selected. Finally, added a new template for the analysis task page.
2323 * public/v2/manifest.js:
2324 (App.Metric.fullName): Added to share code between the charts page and the analysis task page.
2325 (App.Manifest.fetchRunsWithPlatformAndMetric): Extracted from App.Pane._fetch to be reused in
2326 App.AnalysisTaskViewModel._taskUpdated.
2328 2014-10-28 Ryosuke Niwa <rniwa@webkit.org>
2330 Remove App.PaneController.bugsChangeCount in the new perf dashboard
2331 https://bugs.webkit.org/show_bug.cgi?id=138111
2333 Reviewed by Darin Adler.
2336 (App.PaneController.bugsChangeCount): Removed.
2337 (App.PaneController.actions.associateBug): Call _updateMarkedPoints instead of incrementing bugsChangeCount.
2338 (App.PaneController._updateMarkedPoints): Extracted from App.InteractiveChartComponent._updateDotsWithBugs.
2339 Finds the list of current run's points that are associated with bugs.
2340 (App.InteractiveChartComponent._updateMarkedDots): Renamed from _updateDotsWithBugs.
2341 * public/v2/chart-pane.css:
2342 (.chart .marked): Renamed from .hasBugs.
2343 * public/v2/index.html: Specify chartPointRadius and markedPoints.
2345 2014-10-27 Ryosuke Niwa <rniwa@webkit.org>
2347 REGRESSION: commit logs are not shown sometimes on the new dashboard UI
2348 https://bugs.webkit.org/show_bug.cgi?id=138099
2350 Reviewed by Benjamin Poulain.
2352 The bug was caused by _currentItemChanged not passing the previous point in the list of points and also
2353 _showDetails inverting the order of the current and old measurements.
2356 (App.PaneController._currentItemChanged): Pass in the previous point to _showDetails when there is one.
2357 (App.PaneController._showDetails): Since points are ordered chronologically, the last point is the
2358 current (latest) measurement and the first point is the oldest measurement.
2359 (App.CommitsViewerComponent.commitsChanged): Don't show a single measurement as a range for clarity.
2361 2014-10-18 Ryosuke Niwa <rniwa@webkit.org>
2363 Perf dashboard should provide a way to associate bugs with a test run
2364 https://bugs.webkit.org/show_bug.cgi?id=137857
2366 Reviewed by Andreas Kling.
2368 Added a "privileged" API, /privileged-api/associate-bug, to associate a bug with a test run.
2369 /privileged-api/ is to be protected by an authentication mechanism such as DigestAuth over https by
2370 the Apache configuration.
2373 The Cross Site Request (CSRF) Forgery prevention for privileged APIs work as follows. When a user is
2374 about to make a privileged API access, the front end code obtains a CSRF token generated by POST'ing
2375 to privileged-api/generate-csrf-token; the page sets a randomly generated salt and an expiration time
2376 via the cookie and returns a token computed from those two values as well as the remote username.
2378 The font end code then POST's the request along with the returned token. The server side code verifies
2379 that the specified token can be generated from the salt and the expiration time set in the cookie, and
2380 the token hasn't expired.
2383 * init-database.sql: Added bug_url to bug_trackers table, and added bugs table. Each bug tracker will
2384 have zero or exactly one bug associated with a test run.
2386 * public/admin/bug-trackers.php: Added the support for editing bug_url.
2387 * public/api/runs.php:
2388 (fetch_runs_for_config): Modified the query to fetch bugs associated with test_runs.
2389 (parse_bugs_array): Added. Parses the aggregated bugs and creates a dictionary that maps a tracker id to
2390 an associated bug if there is one.
2391 (format_run): Calls parse_bugs_array.
2393 * public/include/json-header.php: Added helper functions to deal for CSRF prevention.
2394 (ensure_privileged_api_data): Added. Dies immediately if the request's method is not POST or doesn't
2395 have a valid JSON payload.
2396 (ensure_privileged_api_data_and_token): Ditto. Also checks that the CSRF prevention token is valid.
2397 (compute_token): Computes a CSRF token using the REMOTE_USER (e.g. set via BasicAuth), the salt, and
2398 the expiration time stored in the cookie.
2399 (verify_token): Returns true iff the specified token matches what compute_token returns from the cookie.
2401 * public/include/manifest.php:
2402 (ManifestGenerator::bug_trackers): Include bug_url as bugUrl in the manifest. Also use tracker_id instead
2403 of tracker_name as the key in the manifest. This requires changes to both v1 and v2 front end.
2405 * public/index.html:
2406 (Chart..showTooltipWithResults): Updated for the manifest format changed mentioned above.
2408 * public/privileged-api/associate-bug.php: Added.
2409 (main): Added. Associates or dissociates a bug with a test run inside a transaction. It prevent a CSRF
2410 attack via ensure_privileged_api_data_and_token, which calls verify_token.
2412 * public/privileged-api/generate-csrf-token.php: Added. Generates a CSRF token valid for one hour.
2414 * public/v2/app.css:
2415 (.disabled .icon-button:hover g): Used by the "bugs" icon when a range of points or no points are
2416 selected in a chart.
2419 (App.PaneController.actions.toggleBugsPane): Added. Toggles the visibility of the bugs pane when exactly
2420 one point is selected in the chart. Also hides the search pane when making the bugs pane visible since
2421 they would overlap on each other if both of them are shown.
2422 (App.PaneController.actions.associateBug): Makes a privileged API request to associate the specified bug
2423 with the currently selected point (test run). Updates the bug information in "details" and colors of dots
2424 in the charts to reflect new states. Because chart data objects aren't real Ember objects for performance
2425 reasons, we have to use a dirty hack of modifying a dummy counter bugsChangeCount.
2426 (App.PaneController.actions.toggleSearchPane): Renamed from toggleSearch. Also hides the bugs pane when
2427 showing the search pane.
2428 (App.PaneController.actions.rangeChanged): Takes all selected points as the second argument instead of
2429 taking start and end points as the second and the third arguments so that _showDetails can enumerate all
2430 bugs in the selected range.
2432 (App.PaneController._detailsChanged): Added. Hide the bugs pane whenever a new point is selected.
2433 Also update singlySelectedPoint, which is used by toggleBugsPane and associateBug.
2434 (App.PaneController._currentItemChanged): Updated for the _showDetails change.
2435 (App.PaneController._showDetails): Takes an array of selected points in place of old arguments.
2436 Simplified the code to compute the revision information. Calls _updateBugs to format the associated bugs.
2437 (App.PaneController._updateBugs): Sets details.bugTrackers to a dictionary that maps a bug tracker id to
2438 a bug tracker proxy with an array of (bugNumber, bugUrl) pairs and also editedBugNumber, which is used by
2439 the bugs pane to associate or dissociate a bug number, if exactly one point is selected.
2441 (App.InteractiveChartComponent._updateDotsWithBugs): Added. Sets hasBugs class on dots as needed.
2442 (App.InteractiveChartComponent._setCurrentSelection): Finds and passes all points in the selected range
2443 to selectionChanged action instead of just finding the first and the last points.
2445 * public/v2/chart-pane.css: Updated the style.
2447 * public/v2/data.js:
2448 (PrivilegedAPI): Added. A wrapper for privileged APIs' CSRF tokens.
2449 (PrivilegedAPI.sendRequest): Makes a privileged API call. Fetches a new CSRF token if needed.
2450 (PrivilegedAPI._generateTokenInServerIfNeeded): Makes a request to privileged-api/generate-csrf-token if
2451 we haven't already obtained a CSRF token or if the token has already been expired.
2452 (PrivilegedAPI._post): Makes a single POST request to /privileged-api/* with a JSON payload.
2454 (Measurement.prototype.bugs): Added.
2455 (Measurement.prototype.hasBugs): Returns true iff bugs has more than one bug number.
2456 (Measurement.prototype.associateBug): Associates a bug with a test run via privileged-api/associate-bug.
2458 * public/v2/index.html: Added the bugs pane. Also added a list of bugs associated with the current run in
2461 * public/v2/manifest.js:
2462 (App.BugTracker.bugUrl):
2463 (App.BugTracker.newBugUrl): Added.
2464 (App.BugTracker.repositories): Added. This was a missing back reference to repositories.
2465 (App.MetricSerializer.normalizePayload): Now parses/loads the list of bug trackers from the manifest.
2466 (App.Manifest.repositoriesWithReportedCommits): Now initialized to an empty array instead of null.
2467 (App.Manifest.bugTrackers): Added.
2468 (App.Manifest._fetchedManifest): Sets App.Manifest.bugTrackers. Also sorts the list of repositories by
2469 their respective ids to make the ordering stable.
2471 2014-10-14 Ryosuke Niwa <rniwa@webkit.org>
2473 Remove unused jobs table
2474 https://bugs.webkit.org/show_bug.cgi?id=137724
2476 Reviewed by Daniel Bates.
2478 Removed jobs table in the database as well as related code.
2480 * init-database.sql:
2481 * public/admin/jobs.php: Removed.
2482 * public/admin/tests.php:
2483 * public/include/admin-header.php:
2485 2014-10-13 Ryosuke Niwa <rniwa@webkit.org>
2487 New perf dashboard should have an ability to search commits by a keyword
2488 https://bugs.webkit.org/show_bug.cgi?id=137675
2490 Reviewed by Geoffrey Garen.
2492 /api/commits/ now accepts query parameters to search a commit by a keyword. Its output format changed to
2493 include "authorEmail" and "authorName" directly as columns instead of including an "author" object.
2494 This API change allows fetch_commits_between to generate results without processing Postgres query results.
2496 In the front end side, we've added a search pane in pane controller, and the interactive chart component
2497 now has a concept of highlighted items which is used to indicate commits found by the search pane.
2499 * public/api/commits.php:
2500 (main): Extract query parameters: keyword, from, and to and use that to fetch appropriate commits.
2501 (fetch_commits_between): Moved some code from main. Now takes a search term as the third argument.
2502 We look for a commit if its author name or email contains the keyword or if its revision matches the keyword.
2503 (format_commit): Renamed from format_commits. Now only formats one commit.
2505 * public/include/db.php:
2506 (Database::query_and_fetch_all): Now returns array() when the query results is empty (instead of false).
2508 * public/v2/app.css: Renamed .close-button to .icon-button since it's used by a search button as well.
2511 (App.Pane.searchCommit): Added. Finds the commits by a search term and assigns 'highlightedItems',
2512 which is a hash table that contains highlighted items' measurements' ids as keys.
2513 (App.PaneController.actions.toggleSearch): Toggles the visibility of the search pane. Also sets
2514 the default commit repository.
2515 (App.PaneController.actions.searchCommit): Delegates the work to App.Pane.searchCommit.
2516 (App.InteractiveChartComponent._constructGraphIfPossible): Fixed a bug that we weren't removing old this._dots.
2517 Added the code to initialize this._highlights.
2518 (App.InteractiveChartComponent._updateDimensionsIfNeeded): Updates dimensions of highlight lines.
2519 (App.InteractiveChartComponent._updateHighlightPositions): Added. Ditto.
2520 (App.InteractiveChartComponent._highlightedItemsChanged): Adds vertical lines for highlighted items and deletes
2521 the existing lines for the old highlighted items.
2522 (App.CommitsViewerComponent.commitsChanged): Updated the code per JSON API change mentioned above.
2523 Also fixed a bug that the code tries to update the commits viewer even if the viewer had already been destroyed.
2525 * public/v2/chart-pane.css: Added style for the search pane and the search button.
2527 * public/v2/data.js: Turned FetchCommitsForTimeRange into a class: CommitLogs.
2528 (CommitLogs): Added.
2529 (CommitLogs.fetchForTimeRange): Renamed from FetchCommitsForTimeRange. Takes a search term as an argument.
2530 (CommitLogs._cachedCommitsBetween): Extracted from FetchCommitsForTimeRange.
2531 (CommitLogs._cacheConsecutiveCommits): Ditto.
2532 (FetchCommitsForTimeRange._cachedCommitsByRepository): Deleted.
2533 (Measurement.prototype.commitTimeForRepository): Extracted from formattedRevisions.
2534 (Measurement.prototype.formattedRevisions): Uses formattedRevisions. Deleted the unused code for commitTime.
2536 * public/v2/index.html: Added the search pane and the search button. Also removed the unused attribute binding
2537 for showingDetails since this property is no longer used.
2539 * public/v2/manifest.js:
2540 (App.Manifest.repositories): Added.
2541 (App.Manifest.repositoriesWithReportedCommits): Ditto. Used by App.PaneController.actions.toggleSearch to find
2542 the default repository to search.
2543 (App.Manifest._fetchedManifest): Populates repositories and repositoriesWithReportedCommits.
2545 2014-10-13 Ryosuke Niwa <rniwa@webkit.org>
2547 Unreviewed build fix after r174555.
2549 * public/include/manifest.php:
2550 (ManifestGenerator::generate): Assign an empty array to $repositories_with_commit when there are no commits.
2551 * tests/admin-regenerate-manifest.js: Fixed the test case.
2553 2014-10-09 Ryosuke Niwa <rniwa@webkit.org>
2555 New perf dashboard UI tries to fetch commits all the time
2556 https://bugs.webkit.org/show_bug.cgi?id=137592
2558 Reviewed by Andreas Kling.
2560 Added hasReportedCommits boolean to repository meta data in manifest.json, and used that in
2561 the front end to avoid issuing HTTP requests to fetch commit logs for repositories with
2562 no reported commits as they are all going to fail.
2564 Also added an internal cache to FetchCommitsForTimeRange in the front end to avoid fetching
2565 the same commit logs repeatedly. There are two data structures we cache: commitsByRevision
2566 which maps a given commit revision/hash to a commit object; and commitsByTime which is an array
2567 of commits sorted chronologically by time.
2569 * public/include/manifest.php:
2572 (App.CommitsViewerComponent.commitsChanged):
2574 * public/v2/data.js:
2575 (FetchCommitsForTimeRange):
2576 (FetchCommitsForTimeRange._cachedCommitsByRepository):
2578 * public/v2/manifest.js:
2581 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
2583 Another unreviewed build fix after r174477.
2585 Don't try to insert a duplicated row into build_commits as it results in a database constraint error.
2587 This has been caught by a test in /api/report. I don't know why I thought all tests were passing.
2589 * public/include/report-processor.php:
2591 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
2593 Unreviewed build fix after r174477.
2595 * init-database.sql: Removed build_commits_index since it's redundant with build_commit's primary key.
2596 Also fixed a syntax error that we were missing "," after line that declared build_commit column.
2598 * public/api/runs.php: Fixed the query so that test_runs without commits data will be retrieved.
2599 This is necessary for baseline and target values manually added via admin pages.
2601 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
2603 Add v2 UI for the perf dashboard
2604 https://bugs.webkit.org/show_bug.cgi?id=137537
2606 Rubber-stamped by Andreas Kling.
2609 * public/v2/app.css: Added.
2610 * public/v2/app.js: Added.
2611 * public/v2/chart-pane.css: Added.
2612 * public/v2/data.js: Added.
2613 * public/v2/index.html: Added.
2614 * public/v2/js: Added.
2615 * public/v2/js/d3: Added.
2616 * public/v2/js/d3/LICENSE: Added.
2617 * public/v2/js/d3/d3.js: Added.
2618 * public/v2/js/d3/d3.min.js: Added.
2619 * public/v2/js/ember-data.js: Added.
2620 * public/v2/js/ember.js: Added.
2621 * public/v2/js/handlebars.js: Added.
2622 * public/v2/js/jquery.min.js: Added.
2623 * public/v2/js/statistics.js: Added.
2624 * public/v2/manifest.js: Added.
2625 * public/v2/popup.js: Added.
2627 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
2629 Remove superfluously duplicated code in public/api/report-commits.php.
2631 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
2633 Perf dashboard should store commit logs
2634 https://bugs.webkit.org/show_bug.cgi?id=137510
2636 Reviewed by Darin Adler.
2638 For the v2 version of the perf dashboard, we would like to be able to see commit logs in the dashboard itself.
2640 This patch replaces "build_revisions" table with "commits" and "build_commits" relations to store commit logs,
2641 and add JSON APIs to report and retrieve them. It also adds a tools/pull-svn.py to pull commit logs from
2642 a subversion directory. The git version of this script will be added in a follow up patch.
2645 In the new database schema, each revision in each repository is represented by exactly one row in "commits"
2646 instead of one row for each build in "build_revisions". "commits" and "builds" now have a proper many-to-many
2647 relationship via "build_commits" relations.
2649 In order to migrate an existing instance of this application, run the following SQL commands:
2653 INSERT INTO commits (commit_repository, commit_revision, commit_time)
2654 (SELECT DISTINCT ON (revision_repository, revision_value)
2655 revision_repository, revision_value, revision_time FROM build_revisions);
2657 INSERT INTO build_commits (commit_build, build_commit) SELECT revision_build, commit_id
2658 FROM commits, build_revisions
2659 WHERE commit_repository = revision_repository AND commit_revision = revision_value;
2661 DROP TABLE build_revisions;
2666 The helper script to submit commit logs can be used as follows:
2668 python ./tools/pull-svn.py "WebKit" https://svn.webkit.org/repository/webkit/ https://perf.webkit.org
2669 feeder-slave feeder-slave-password 60 "webkit-patch find-users"
2671 The above command will pull the subversion server at https://svn.webkit.org/repository/webkit/ every 60 seconds
2672 to retrieve at most 10 commits, and submits the results to https://perf.webkit.org using "feeder-slave" and
2673 "feeder-slave-password" as the builder name and the builder password respectively.
2675 The last, optional, argument is the shell command to convert a subversion account to the corresponding username.
2676 e.g. "webkit-patch find-users rniwa@webkit.org" yields "Ryosuke Niwa" <rniwa@webkit.org> in the stdout.
2679 * init-database.sql: Replaced "build_revisions" relation with "commits" and "build_commits" relations.
2681 * public/api/commits.php: Added. Retrieves a list of commits based on arguments in its path of the form
2682 /api/commits/<repository-name>/<filter>. The behavior of this API depends on <filter> as follows:
2684 - Not specified - It returns every single commit for a given repository.
2685 - Matches "oldest" - It returns the commit with the oldest timestamp.
2686 - Matches "latest" - It returns the commit with the latest timestamp.
2687 - Matches "last-reported" - It returns the commit with the latest timestamp added via report-commits.php.
2688 - Is entirely alphanumeric - It returns the commit whose revision matches the filter.
2689 - Is of the form <alphanumeric>:<alphanumeric> or <alphanumeric>-<alphanumeric> - It retrieves the list
2690 of commits added via report-commits.php between two timestamps retrieved from commits whose revisions
2691 match the two alphanumeric values specified. Because it retrieves commits based on their timestamps,
2692 the list may contain commits that do not appear as neither hash's ancestor in git/mercurial.
2694 (commit_from_revision):
2695 (fetch_commits_between):
2698 * public/api/report-commits.php: Added. A JSON API to report new subversion, git, or mercurial commits.
2699 See tests/api-report-commits.js for examples on how to use this API.
2701 * public/api/runs.php: Updated the query to use "commit_builds" and "commits" relations instead of
2702 "build_revisions". Regrettably, the new query is 20% slower but I'm going to wait until the new UI is ready
2703 to optimize this and other JSON APIs.
2705 * public/include/db.php:
2706 (Database::select_or_insert_row):
2707 (Database::update_or_insert_row): Added.
2708 (Database::_select_update_or_insert_row): Extracted from select_or_insert_row. Try to update first and then
2709 insert if the update fails for update_or_insert_row. Preserves the old behavior when $should_update is false.
2711 (Database::select_first_row):
2712 (Database::select_last_row): Added.
2713 (Database::select_first_or_last_row): Extracted from select_first_row. Fixed a bug that we were asserting
2714 $order_by to be not alphanumeric/underscore. Retrieve the last row instead of the first if $descending_order.
2716 * public/include/report-processor.php:
2717 (ReportProcessor::resolve_build_id): Store commits instead of build_revisions. We don't worry about the race
2718 condition for adding "build_commits" rows since we shouldn't have a single tester submitting the same result
2719 concurrently. Even if it happened, it will only result in a PHP error and the database will stay consistent.
2722 (pathToTests): Don't call path.resolve with "undefined" testName; It throws an exception in the latest node.js.
2724 * tests/api-report-commits.js: Added.
2725 * tests/api-report.js: Fixed a test per build_revisions to build_commits/commits replacement.
2728 * tools/pull-svn.py: Added. See above for how to use this script.
2730 (determine_first_revision_to_fetch):
2731 (fetch_revision_from_dasbhoard):
2732 (fetch_commit_and_resolve_author):
2735 (resolve_author_name_from_email):
2738 2014-09-30 Ryosuke Niwa <rniwa@webkit.org>
2740 Update Install.md for Mavericks and fix typos
2741 https://bugs.webkit.org/show_bug.cgi?id=137276
2743 Reviewed by Benjamin Poulain.
2745 Add the instruction to copy php.ini to enable the Postgres extension in PHP.
2747 Also use perf.webkit.org as the directory name instead of WebKitPerfMonitor.
2749 Finally, init-database.sql is no longer located inside database directory.
2753 2014-08-11 Ryosuke Niwa <rniwa@webkit.org>
2755 Report run id's in api/runs.php for the new dashboard UI
2756 https://bugs.webkit.org/show_bug.cgi?id=135813
2758 Reviewed by Andreas Kling.
2760 Include run_id in the generated JSON.
2762 * public/api/runs.php:
2763 (fetch_runs_for_config): Don't sort results by time since that has been done in the front end for ages now.
2766 2014-08-11 Ryosuke Niwa <rniwa@webkit.org>
2768 Merging platforms mixes baselines and targets into reported data
2769 https://bugs.webkit.org/show_bug.cgi?id=135260
2771 Reviewed by Andreas Kling.
2773 When merging two platforms, move test configurations of a different type (baseline, target)
2774 as well as of different metric (Time, Runs).
2776 Also avoid fetching the entire table of runs just to see if there are no remaining runs.
2777 It's sufficient to detect one such test_runs object.
2779 * public/admin/platforms.php:
2782 2014-07-30 Ryosuke Niwa <rniwa@webkit.org>
2784 Merging platforms mixes baselines and targets into reported data
2785 https://bugs.webkit.org/show_bug.cgi?id=135260
2787 Reviewed by Geoffrey Garen.
2789 Make sure two test configurations we're merging are of the same type (e.g. baseline, target, current).
2790 Otherwise, we'll erroneously mix up runs for baseline, target, and current (reported values).
2792 * public/admin/platforms.php:
2794 2014-07-23 Ryosuke Niwa <rniwa@webkit.org>
2796 Build fix after r171361.
2798 * public/js/helper-classes.js:
2799 (.this.formattedBuildTime):
2801 2014-07-22 Ryosuke Niwa <rniwa@webkit.org>
2803 Perf dashboard spends 2s processing JSON data during the page loads
2804 https://bugs.webkit.org/show_bug.cgi?id=135152
2806 Reviewed by Andreas Kling.
2808 In the Apple internal dashboard, we were spending as much as 2 seconds
2809 converting raw JSON data into proper JS objects while loading the dashboard.
2811 This caused the apparent unresponsiveness of the dashboard despite of the fact
2812 charts themselves updated almost instantaneously.
2814 * public/index.html:
2815 * public/js/helper-classes.js:
2816 (TestBuild): Compute the return values of formattedTime and formattedBuildTime
2817 lazily as creating new Date objects and running string replace is expensive.
2818 (TestBuild.formattedTime):
2819 (TestBuild.formattedBuildTime):
2820 (PerfTestRuns.setResults): Added. Pushing each result was the biggest bottle neck.
2821 (PerfTestRuns.addResult): Deleted.
2823 2014-07-18 Ryosuke Niwa <rniwa@webkit.org>
2825 Perf dashboard shouldn't show the full git hash
2826 https://bugs.webkit.org/show_bug.cgi?id=135083
2828 Reviewed by Benjamin Poulain.
2830 Detect Git/Mercurial hash by checking the length.
2832 If it's a hash, use the first 8 characters in the label
2833 while retaining the full length to be used in hyperlinks.
2835 * public/js/helper-classes.js:
2836 (.this.formattedRevisions):
2839 2014-05-29 Ryosuke Niwa <rniwa@webkit.org>
2841 Add an instruction on how to backup the database.
2842 https://bugs.webkit.org/show_bug.cgi?id=133391
2844 Rubber-stamped by Andreas Kling.
2848 2014-04-08 Ryosuke Niwa <rniwa@webkit.org>
2850 Build fix after r166479. 'bytes' is now abbreviated as 'B'.
2852 * public/js/helper-classes.js:
2853 (PerfTestRuns.smallerIsBetter):
2855 2014-04-08 Ryosuke Niwa <rniwa@webkit.org>
2859 * public/common.css:
2861 * public/index.html:
2865 2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
2867 WebKitPerfMonitor: There should be a way to add all metrics of a suite without also adding subtests
2868 https://bugs.webkit.org/show_bug.cgi?id=131157
2870 Reviewed by Andreas Kling.
2872 Split "all metrics" into all metrics of a test suite and all subtests of the suite.
2873 This allows, for example, adding all metrics such as Arithmetic and Geometric for
2874 a given test suite without also adding its subtests.
2876 * public/index.html:
2880 2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
2882 WebKitPerfMonitor: Tooltips cannot be pinned after using browser's back button
2883 https://bugs.webkit.org/show_bug.cgi?id=131155
2885 Reviewed by Andreas Kling.
2887 The bug was caused by Chart.attach binding event listeners on plot container on each call.
2888 This resulted in the click event handler toggling the visiblity of the tooltip twice upon
2889 click when attach() has been called even number of times, keeping the tooltip invisible.
2891 Fixed the bug by extracting the code to bind event listeners outside of Chart.attach as
2892 a separate function, bindPlotEventHandlers, and calling it exactly once when Chart.attach
2893 is called for the first time.
2895 * public/index.html:
2897 (Chart..bindPlotEventHandlers):
2899 2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
2901 WebKitPerfMonitor: Tooltips can be cut off at the top
2902 https://bugs.webkit.org/show_bug.cgi?id=130960
2904 Reviewed by Andreas Kling.
2906 * public/common.css:
2907 (#title): Removed the gradients, box shadows, and border from the header.
2908 (#title h1): Reduce the font size.
2909 (#title ul): Use line-height to vertically align the navigation bar instead of specifying a padding atop.
2910 * public/index.html:
2911 (.tooltop:before): Added. Identical to .tooltop:after except it's upside down (arrow facing up).
2912 (.tooltip.inverted:before): Show the arrow facing up when .inverted is set.
2913 (.tooltip.inverted:before): Hide the arrow facing down when .inverted is set.
2914 * public/js/helper-classes.js:
2915 (Tooltip.show): Show the tooltip below the point if placing it above the point results in the top of the
2916 tooltip extending above y=0.
2918 2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
2920 WebKitPerfMonitor: Y-axis adjustment is too aggressive
2921 https://bugs.webkit.org/show_bug.cgi?id=130937
2923 Reviewed by Andreas Kling.
2925 Previously, adjusted min. and max. were defined as the two standards deviations away from EWMA of measured
2926 results. This had two major problems:
2927 1. Two standard deviations can be too small to show the confidence interval for results.
2928 2. Sometimes baseline and target can be more than two standards deviations away.
2930 Fixed the bug by completely rewriting the algorithm to compute the interval. Instead of blindly using two
2931 standard deviations as margins, we keep adding quarter the standard deviation on each side until more than 90%
2932 of points lie in the interval or we've expanded 4 standard deviations. Once this condition is met, we reduce
2933 the margin on each side separately to reduce the empty space on either side.
2935 A more rigorous approach would involve computing least squared value of results with respect to intervals
2936 but that seems like an overkill for a simple UI problem; it's also computationally expensive.
2938 * public/index.html:
2939 (Chart..adjustedIntervalForRun): Extracted from computeYAxisBoundsToFitLines.
2940 (Chart..computeYAxisBoundsToFitLines): Compute the min. and max. adjusted intervals out of adjusted intervals
2941 for each runs (current, baseline, and target) so that at least one point from each set of results is shown.
2942 We wouldn't see the difference between measured values versus baseline and target values otherwise.
2943 * public/js/helper-classes.js:
2944 (PerfTestResult.unscaledConfidenceIntervalDelta): Returns the default value if the confidence
2945 interval delta cannot be computed.
2946 (PerfTestResult.isInUnscaledInterval): Added. Returns true iff the confidence intervals lies
2947 within the given interval.
2948 (PerfTestRuns..filteredResults): Extracted from unscaledMeansForAllResults now that PerfTestRuns.min and
2949 PerfTestRuns.max need to use both mean and confidence interval delta for each result.
2950 (PerfTestRuns..unscaledMeansForAllResults):
2951 (PerfTestRuns.min): Take the confidence interval delta into account.
2952 (PerfTestRuns.max): Ditto.
2953 (PerfTestRuns.countResults): Returns the number of results in the given time frame (> minTime).
2954 (PerfTestRuns.countResultsInInterval): Returns the number of results whose confidence interval lie within the
2956 (PerfTestRuns.exponentialMovingArithmeticMean): Fixed the typo so that it actually computes the EWMA.
2958 2014-03-31 Ryosuke Niwa <rniwa@webkit.org>
2960 Some CSS tweaks after r166477 and r166479,
2962 * public/index.html:
2964 2014-03-30 Ryosuke Niwa <rniwa@webkit.org>
2966 WebKitPerfMonitor: Sometimes text inside panes overlap
2967 https://bugs.webkit.org/show_bug.cgi?id=130956
2969 Reviewed by Gyuyoung Kim.
2971 Revamped the pane UI. Now build info uses table element instead of plane text with BRs. The computed status of
2972 the latest result against baseline/target such as "3% until target" is now shown above the current value. This
2973 reduces the total height of the pane and fits more information per screen capita on the dashboard.
2975 * public/index.html: Updated and added a bunch of CSS rules for the new look.
2976 (.computeStatus): Don't append the build info here. The build info is constructed as a separate table now.
2977 (.createSummaryRowMarkup): Use th instead of td for "Current", "Baseline", and "Target" in the summary table.
2978 (.buildLabelWithLinks): Construct table rows instead of br separated lines of text. This streamlines the look
2979 of the build info shown in a chart pane and a tooltip.
2980 (Chart): Made .status a table.
2981 (Chart.populate): Prepend status.text, which contains text such as "3% until target", into the summary rows
2982 right above "Current" value, and populate .status with buildLabelWithLinks manually instead of status.text
2983 now that status.text no longer contains it.
2984 (Chart..showTooltipWithResults): Wrap buildLabelWithLinks with a table element.
2986 * public/js/helper-classes.js:
2987 (TestBuild.formattedRevisions): Don't include repository names in labels since repository names are now added
2988 by buildLabelWithLinks inside th elements. Also place spaces around '-' between two different OS X versions.
2989 e.g. "OS X 10.8 - OS X 10.9" instead of "OS X 10.8-OS X 10.9".
2990 (PerfTestRuns): Use "/s" for "runs/s" and "B" for "bytes" to make text shorter in .status and .summaryTable.
2991 (PerfTestRuns..computeScalingFactorIfNeeded): Avoid placing a space between 'M' and a unit starting with a
2992 capital letter; e.g. "MB" instead of "M B".
2994 2014-03-30 Ryosuke Niwa <rniwa@webkit.org>
2996 WebKitPerfMonitor: Header and number-of-days slider takes up too much space
2997 https://bugs.webkit.org/show_bug.cgi?id=130957
2999 Reviewed by Gyuyoung Kim.
3001 Moved the slider into the header. Also reduced the spacing between the header and platform names.
3002 This reclaims 50px × width of the screen real estate.
3004 * public/common.css:
3005 (#title): Reduced the space below the header from 20px to 10px.
3006 * public/index.html:
3007 (#numberOfDaysPicker): Removed the rounded border around the number-of-days slider.
3008 (#dashboard > tbody > tr > td): Added a 1.5em padding at the bottom.
3009 (#dashboard > thead th): That allows us to remove the padding at the top here. This reduces the wasted screen
3010 real estate between the header and the platform names.
3012 2014-03-10 Zoltan Horvath <zoltan@webkit.org>
3014 Update the install guidelines for perf.webkit.org
3015 https://bugs.webkit.org/show_bug.cgi?id=129895
3017 Reviewed by Ryosuke Niwa.
3019 The current install guideline for perf.webkit.org discourages the use of the installed
3020 Server application. I've actualized the documentation for Mavericks, and modified the
3021 guideline to include the instructions for Server.app also.
3025 2014-03-08 Zoltan Horvath <zoltan@webkit.org>
3027 Update perf.webkit.org json example
3028 https://bugs.webkit.org/show_bug.cgi?id=129907
3030 Reviewed by Andreas Kling.
3032 The current example is not valid json syntax. I fixed the syntax errors and indented the code properly.
3036 2014-01-31 Ryosuke Niwa <rniwa@webkit.org>
3038 Merge database-common.js and utility.js into run-tests.js.
3040 Reviewed by Matthew Hanson.
3042 Now that run-tests is the only node.js script, merged database-common.js and utility.js into it.
3043 Also moved init-database.sql out of the database directory and removed the directory entirely.
3045 * database: Removed.
3046 * database/database-common.js: Removed.
3047 * database/utility.js: Removed.
3048 * init-database.sql: Moved from database/init-database.sql.
3050 (connect): Moved from database-common.js.
3051 (pathToDatabseSQL): Extracted from pathToLocalScript.
3052 (pathToTests): Moved from database-common.js.
3055 (SerializedTaskQueue): Ditto.
3057 (initializeDatabase):
3058 (TestEnvironment.it):
3059 (TestEnvironment.queryAndFetchAll):
3062 2014-01-30 Ryosuke Niwa <rniwa@webkit.org>
3064 Remove the dependency on node.js from the production code.
3066 Reviewed by Ricky Mondello.
3068 Work towards <rdar://problem/15955053> Upstream SafariPerfMonitor.
3070 Removed node.js dependency from TestRunsGenerator. It was really a design mistake to invoke node.js from php.
3071 It added so much complexity with only theoretical extensibility of adding aggregators. It turns out that
3072 many aggregators we'd like to add are a lot more complicated than ones that could be written under the current
3073 infrastructure, and we need to make the other aspects (e.g. the level of aggregations) a lot more extensible.
3074 Removing and simplifying TestRunsGenerator allows us to implement such extensions in the future.
3076 Also removed the js files that are no longer used.
3078 * config.json: Moved from database/config.json.
3079 * database/aggregate.js: Removed. No longer used.
3080 * database/database-common.js: Removed unused functions, and updated the path to config.json.
3081 * database/process-jobs.js: Removed. No longer used.
3082 * database/sample-data.sql: Removed. We have a much better corpus of data now.
3083 * database/schema.graffle: Removed. It's completely obsolete.
3084 * public/include/db.php: Updated the path to config.json.
3085 * public/include/evaluator.js: Removed.
3087 * public/include/report-processor.php:
3088 (TestRunsGenerator::aggregate): Directly aggregate values via newly added aggregate_values method instead of
3089 storing values into $expressions and calling evaluate_expressions_by_node.
3090 (TestRunsGenerator::aggregate_values): Added.
3091 (TestRunsGenerator::compute_caches): Directly compute the caches.
3093 2014-01-30 Ryosuke Niwa <rniwa@webkit.org>
3095 Build fix. Don't fail the platform merges even if there are no test configurations to be moved to the new platform.
3097 * public/admin/platforms.php:
3098 * public/include/db.php:
3100 2014-01-30 Ryosuke Niwa <rniwa@webkit.org>
3102 Zoomed y-axis view is ununsable when the last result is an outlier.
3104 Reviewed by Stephanie Lewis.
3106 Show two standard deviations from the exponential moving average with alpha = 0.3 instead of the mean of
3107 the last result so that the graph looks sane if the last result was an outlier. However, always show
3108 the last result's mean even if it was an outlier.
3110 * public/index.html:
3111 * public/js/helper-classes.js:
3112 (unscaledMeansForAllResults): Extracted from min/max/sampleStandardDeviation.
3113 Also added the ability to cache the unscaled means to avoid recomputation.
3114 (PerfTestRuns.min): Refactored to use unscaledMeansForAllResults.
3115 (PerfTestRuns.max): Ditto.
3116 (PerfTestRuns.sampleStandardDeviation): Ditto.
3117 (PerfTestRuns.exponentialMovingArithmeticMean): Added.
3119 2014-01-30 Ryosuke Niwa <rniwa@webkit.org>
3123 * public/admin/tests.php:
3124 * public/js/helper-classes.js:
3126 2014-01-29 Ryosuke Niwa <rniwa@webkit.org>
3128 Use two standard deviations instead as I mentioned in the mailing list.
3130 * public/index.html:
3132 2014-01-28 Ryosuke Niwa <rniwa@webkit.org>
3134 The performance dashboard erroneously shows upward arrow for combined metrics.
3136 A single outlier can ruin the zoomed y-axis view.
3138 Rubber-stamped by Antti Koivisto.
3140 * public/index.html:
3141 (computeYAxisBoundsToFitLines): Added adjustedMax and adjustedMin, which are pegged at 4 standard deviations
3142 from the latest results' mean.
3143 (Chart): Renamed shouldStartYAxisAtZero to shouldShowEntireYAxis.
3144 (Chart.attachMainPlot): Use the adjusted max and min when we're not showing the entire y-axis.
3145 (Chart.toggleYAxis):
3146 * public/js/helper-classes.js:
3147 (PerfTestRuns.sampleStandardDeviation): Added.
3148 (PerfTestRuns.smallerIsBetter): 'Combined' is a smaller is better metric.
3150 2014-01-28 Ryosuke Niwa <rniwa@webkit.org>
3152 Don't include the confidence interval when computing the y-axis.
3154 Rubber-stamped by Simon Fraser.
3156 * public/js/helper-classes.js:
3160 2014-01-25 Ryosuke Niwa <rniwa@webkit.org>
3162 Tiny CSS tweak for tooltips.
3164 * public/index.html:
3166 2014-01-25 Ryosuke Niwa <rniwa@webkit.org>
3168 Remove the erroneously repeated code.
3170 * public/admin/test-configurations.php:
3172 2014-01-24 Ryosuke Niwa <rniwa@webkit.org>
3174 <rdar://problem/15704893> perf dashboard should show baseline numbers
3176 Reviewed by Stephanie Lewis.
3178 * public/admin/bug-trackers.php:
3179 (associated_repositories): Return an array of HTMLs instead of echo'ing as expected by AdministrativePage.
3182 * public/admin/platforms.php:
3183 (merge_list): Ditto.
3185 * public/admin/test-configurations.php: Added.
3186 (add_run): Adds a "synthetic" test run and a corresponding build. It doesn't create run_iterations and
3187 build_revisions as they're not meaningful for baseline / target numbers.
3188 (delete_run): Deletes a synthetic test run and its build. It verifies that the specified build has exactly
3189 one test run so that we don't accidentally delete a reported test run.
3190 (generate_rows_for_configurations): Generates rows of configuration IDs and types.
3191 (generate_rows_for_test_runs): Ditto for test runs. It also emits the form to add new "synthetic" test runs
3192 and delete existing ones.
3194 * public/admin/tests.php: We wrongfully assumed there is exactly one test configuration for each metric
3195 on each platform; there could be configurations of distinct types such as "current" and "baseline".
3196 Thus, update all test configurations for a given metric when updating config_is_in_dashboard.
3198 * public/api/runs.php: Remove the NotImplemented when we have multiple test configurations.
3199 (fetch_runs_for_config): "Synthetic" test runs created on test-configurations page are missing revision
3200 data so we need to left-outer-join (instead of inner-join) build_revisions. To avoid making the query
3201 unreadable, don't join revision_repository here. Instead, fetch the list of repositories upfront and
3202 resolve names in parse_revisions_array. This actually reduces the query time by ~10%.
3204 (parse_revisions_array): Skip an empty array created for "synthetic" test runs.
3206 * public/include/admin-header.php:
3207 (AdministrativePage::render_table): Now custom columns support sub columns. e.g. a configuration column may
3208 have id and type sub columns, and each custom column could generate multiple rows.
3210 Any table with sub columns now generates two rows for thead. We generate td's in in the first row without
3211 sub columns with rowspan of 2, and generate ones with sub columns with colspan set to the sub column count.
3212 We then proceed to generate the second header row with sub column names.
3214 When generating the actual content, we first generate all custom columns as they may have multiple rows in
3215 which case regular columns need rowspan set to the maximum number of rows.
3217 Once we've generated the first row, we proceed to generate subsequent rows for those custom columns that
3220 (AdministrativePage::render_custom_cells): Added. This function is responsible for generating table cells
3221 for a given row in a given custom column. It generates an empty td when the custom column doesn't have
3222 enough rows. It also generates empty an td when it doesn't have enough columns in some rows except when
3223 the entire row consists of exactly one cell for a custom column with sub columns, in which case the cell is
3224 expanded to occupy all sub columns.
3226 * public/include/manifest.php:
3227 (ManifestGenerator::platforms): Don't add the metric more than once.
3229 * public/include/test-name-resolver.php:
3230 (TestNameResolver::__construct): We had wrongfully assumed that we have exactly one test configuration on
3231 each platform for each metric like tests.php. Fixed that. Also fetch the list of aggregators to compute the
3232 full metric name later.
3233 (TestNameResolver::map_metrics_to_tests): Populate $this->id_to_metric.
3234 (TestNameResolver::test_id_for_full_name): Simplified the code using array_get.
3235 (TestNameResolver::full_name_for_test): Added.
3236 (TestNameResolver::full_name_for_metric): Added.
3237 (TestNameResolver::configurations_for_metric_and_platform): Renamed as it returns multiple configurations.
3239 * public/js/helper-classes.js:
3240 (TestBuild): Use the build time as the maximum time when revision information is missing for "synthetic"
3241 test runs created to set baseline and target points.
3243 2014-01-24 Ryosuke Niwa <rniwa@webkit.org>
3245 Build fix after r57928. Removed a superfluous close parenthesis.
3247 * public/api/runs.php:
3249 2014-01-24 Ryosuke Niwa <rniwa@webkit.org>
3251 Unreviewed build & typo fixes.
3253 * public/admin/platforms.php:
3254 * tests/admin-platforms.js:
3256 2014-01-24 Ryosuke Niwa <rniwa@webkit.org>
3258 <rdar://problem/15704893> perf dashboard should show baseline numbers
3260 Rubber-stamped by Antti Koivisto.
3262 Organize some code into functions in runs.php.
3264 Also added back $paths that was erroneously removed in r57925 from json-header.php.
3266 * public/api/runs.php:
3267 (fetch_runs_for_config): Extracted.
3268 (format_run): Ditto.
3270 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
3272 Merge the upstream json-shared.php as of https://trac.webkit.org/r162693.
3274 * database/config.json:
3275 * public/admin/reprocess-report.php:
3276 * public/api/report.php:
3277 * public/api/runs.php:
3278 * public/include/json-header.php:
3280 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
3282 Commit yet another forgotten change.
3284 Something went horribly wrong with my merge :(
3286 * database/init-database.sql:
3288 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
3290 Commit one more forgotten change. Sorry for making a mess here.
3292 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
3294 Commit the forgotten files.
3296 * public/admin/platforms.php: Added.
3297 * tests/admin-platforms.js: Added.
3299 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
3301 <rdar://problem/15889905> SafariPerfMonitor: there should be a way to merge and hide platforms
3303 Reviewed by Stephanie Lewis.
3305 Added /admin/platforms/ page to hide and merge platforms.
3307 Merging two platforms is tricky because we need to migrate test runs as well as some test configurations.
3308 Recall that each test (e.g. Dromaeo) can have many "test metrics" (e.g. MaxAllocations, EndAllocations),
3309 and they have a distinct "test configuration" for each platform (e.g. MaxAllocation on Mountain Lion), and
3310 each test configuration a distinct "test run" for each build.
3312 In order to merge platform A into platform B, we must migrate all test runs that belong to platform A via
3313 their test configurations into platform B.
3315 Suppose we're migrating a test run R for test configuration T_A in platform A for metric M. Since M exists
3316 independent of platforms, R should continue to relate to M through some test configuration. Unfortunately,
3317 we can't simply move T_A into platform B since we may already have a test configuration T_B for metric M
3318 in platform B, in which case R should relate to T_B instead.
3320 Thus, we first migrate all test runs for which we already have corresponding test configurations in the
3321 new platform. We then migrate the test configurations of the remaining test runs.
3323 * database/init-database.sql: Added platform_hidden.
3325 * public/admin/platforms.php: Added.
3326 (merge_platforms): Added. Implements the algorithm described above.
3327 (merge_list): Added.
3329 * public/admin/tests.php: Disable the checkbox to show a test configuration on the dashboard if its platform
3330 is hidden since it doesn't do anything.
3332 * public/include/admin-header.php: Added the hyperlink to /admin/platforms.
3333 (update_field): Don't bail out if the newly added "update-column" is set to the field name even if $_POST is
3334 missing it since unchecked checkbox doesn't set the value in $_POST.
3335 (AdministrativePage::render_form_control_for_column): Added the support for boolean edit mode. Also used
3336 switch statement instead of repeated if's.
3337 (AdministrativePage::render_table): Emit "update-column" for update_field.
3339 * public/include/db.php: Disable warnings when we're not in the debug mode.
3341 * public/include/manifest.php:
3342 (ManifestGenerator::platforms): Skip platforms that have been hidden.
3345 (TestEnvironment.postJSON):
3346 (TestEnvironment.httpGet):
3347 (TestEnvironment.httpPost): Added.
3348 (sendHttpRequest): Set the content type if specified.
3350 * tests/admin-platforms.js: Added tests.
3352 2014-01-22 Ryosuke Niwa <rniwa@webkit.org>
3354 Extract the code to compute full test names from tests.php.
3356 Reviewed by Stephanie Lewis.
3358 Extracted TestNameResolver out of tests.php. This reduces the number of global variables in tests.php
3359 and paves our way to re-use the code in other pages.
3361 * public/admin/tests.php:
3363 * public/include/db.php:
3364 (array_set_default): Renamed from array_item_set_default and moved from tests.php as it's used in both
3365 tests.php and test-name-resolver.php.
3367 * public/include/test-name-resolver.php: Added.
3368 (TestNameResolver::__construct):
3369 (TestNameResolver::compute_full_name): Moved from tests.php.
3370 (TestNameResolver::map_metrics_to_tests): Ditto.
3371 (TestNameResolver::sort_tests_by_full_name): Ditto.
3372 (TestNameResolver::tests): Added.
3373 (TestNameResolver::test_id_for_full_name): Ditto.
3374 (TestNameResolver::metrics_for_test_id): Ditto.
3375 (TestNameResolver::child_metrics_for_test_id): Ditto.
3376 (TestNameResolver::configuration_for_metric_and_platform): Ditto.
3378 2014-01-21 Ryosuke Niwa <rniwa@webkit.org>
3380 <rdar://problem/15867325> Perf dashboard is erroneously associating reported results with old revisions
3382 Reviewed by Stephanie Lewis.
3384 Add the ability to reprocess reports so that I can re-associate wrongfully associated reports.
3386 Added public/admin/reprocess-report.php. It doesn't have any nice UI to find reports and it returns JSON
3387 but that's sufficient to correct the wrongfully processed reports for now.
3389 * public/admin/reprocess-report.php: Added. Takes a report id in $_GET or $_POST and process the report.
3390 We should eventually add a nice UI to find and reprocess reports.
3392 * public/api/report.php: ReportProcessor and TestRunsGenerator have been removed.
3394 * public/include/db.php: Added the forgotten call to prefixed_column_names.
3396 * public/include/report-processor.php: Copied from public/api/report.php.
3397 (ReportProcessor::__construct): Fetch the list of aggregators here for simplicity.
3398 (ReportProcessor::process): Optionally takes $existing_report_id. When this value is specified, we don't
3399 create a new report or authenticate the builder password (the password is never stored in the report).
3400 Also use select_first_row instead of query_and_fetch_all to find the builder for simplicity.
3401 (ReportProcessor::construct_build_data): Extracted from store_report_and_get_build_data.
3402 (ReportProcessor::store_report): Ditto.
3404 * tests/admin-reprocess-report.js: Added.
3406 2014-01-21 Ryosuke Niwa <rniwa@webkit.org>
3408 <rdar://problem/15867325> Perf dashboard is erroneously associating reported results with old revisions
3410 Reviewed by Ricky Mondello.
3412 The bug was caused by a build fix r57645. It attempted to treat multiple reports from the same builder
3413 for the same build number as a single build by ignoring build time. This was necessary to associate
3414 multiple reports by a single build - e.g. for different performance test suites - because the scripts
3415 we use to submit results computed its own "build time" when they're called.
3417 An unintended consequence of this change was revealed when we moved a buildbot master to the new machine
3418 last week; new reports were wrongfully associated with old build numbers.
3420 Fixed the bug by not allowing reports made more than 1 day after the initial build time to be assigned
3421 to the same build. Instead, we create a new build object for those reports. Since the longest set of
3422 tests we have only take a couple of hours to run, 24 hours should be more than enough.
3424 * database/init-database.sql: We can no longer constrain that each build number is unique to a builder
3425 or that build number and build time pair is unique. Instead, constrain the uniqueness of the tuple
3426 (builder, build number, build time).
3428 * public/api/report.php:
3429 (ReportProcessor::resolve_build_id): Look for any builds made within the past one day. Create a new build
3430 when no such build exists. This prevents a report from being associated with a very old build of the same
3433 Also check that revision numbers or hashes match when we're adding revision info. This will let us catch
3434 a similar bug in the future sooner.
3436 * tests/api-report.js: Added three test cases.
3438 2014-01-20 Ryosuke Niwa <rniwa@webkit.org>
3440 Merged the upstream changes to db.php
3441 See http://trac.webkit.org/browser/trunk/Websites/test-results/public/include/db.php
3443 * public/include/db.php:
3445 2014-01-20 Ryosuke Niwa <rniwa@webkit.org>
3447 Update other scripts and tests per previous patch.
3449 * public/include/manifest.php:
3450 * tests/admin-regenerate-manifest.js:
3452 2014-01-20 Ryosuke Niwa <rniwa@webkit.org>
3454 Remove metrics_unit.
3456 Reviewed by Ricky Mondello.
3458 This column is no longer used by the front-end code since r48360.
3460 * database/init-database.sql:
3461 * public/admin/tests.php:
3463 2014-01-16 Ryosuke Niwa <rniwa@webkit.org>
3465 Unreviewed build fix.
3467 * public/api/report.php:
3469 2014-01-15 Ryosuke Niwa <rniwa@webkit.org>
3471 <rdar://problem/15832456> Automate DoYouEvenBench (124497)
3473 Reviewed by Ricky Mondello.
3475 Support a new alternative format for aggregated results where we have raw values as well as
3476 the list aggregators so that instead of
3477 "metrics": {"Time": ["Arithmetic"]}
3479 "metrics": {"Time": { "aggregators" : ["Arithmetic"], "current": [300, 310, 320, 330] }}
3481 This allows single JSON generated by run-perf-tests in WebKit to be shared between the perf
3482 dashboard and the generated results page, which doesn't know how to aggregate values.
3484 We need to keep the support for the old format because all other existing performance tests
3485 all rely on the old format. Even if we updated the tests, we need the dashboard to support
3486 the old format during the transition.
3488 * public/api/report.php:
3489 (ReportProcessor::recursively_ensure_tests): Support the new format in addition to the old one.
3490 (ReportProcessor::aggregator_list_if_exists): Replaced is_list_of_aggregators.
3492 * tests/api-report.js: Updated one of aggregator test cases to test the new format.
3494 2013-05-31 Ryosuke Niwa <rniwa@webkit.org>
3496 Unreviewed; Tweak the CSS so that chart panes align vertically.
3498 * public/index.html:
3500 2013-05-31 Ryosuke Niwa <rniwa@webkit.org>
3502 SafariPerfMonitor should support Combined metric.
3504 * public/js/helper-classes.js:
3505 (PerfTestRuns): Added 'Combined' metric. In general, it could be used for smaller-is-better
3506 value as well but assume it to be greater-is-better for now.
3508 2013-05-30 Ryosuke Niwa <rniwa@webkit.org>
3510 Commit the forgotten init-database change to add iteration_relative_time.
3512 * database/init-database.sql:
3514 2013-05-30 Ryosuke Niwa <rniwa@webkit.org>
3516 <rdar://problem/13993069> SafariPerfMonitor: Support accepting (relative time, value) pairs
3518 Reviewed by Ricky Mondello.
3520 Add the support for each value to have a relative time. This is necessary for frame rate history
3521 since a frame rate needs to be associated with a time it was sampled.
3523 * database/init-database.sql: Added iteration_relative_time to run_iterations.
3525 * public/api/report.php:
3526 (TestRunsGenerator::test_value_list_to_values_by_iterations): Reject any non-numeral values here.
3527 This code is used to aggregate values but it doesn't make sense to aggregate iteration values
3528 with relative time since taking the average of two frame rates for two subtests taken at two
3529 different times doesn't make any sense.
3530 (TestRunsGenerator::compute_caches): When we encounter an array value while computing sum, mean,
3531 etc..., use the second element since we assume values are of the form (relative time, frame rate).
3532 Also exit early with an error if the number of elements in the array is not a pair.
3533 (TestRunsGenerator::commit): Store the relative time and the frame rate as needed.
3535 * tests/api-report.js: Added a test case. Also modified existing test cases to account for
3536 iteration_relative_time.
3538 2013-05-27 Ryosuke Niwa <rniwa@webkit.org>
3540 <rdar://problem/13654488> SafariPerfMonitor: Support accepting single-value results
3542 Reviewed by Ricky Mondello.
3544 Support that. It's one line change.
3546 * public/api/report.php:
3547 (ReportProcessor.recursively_ensure_tests): When there is exactly one value, wrap it inside an array
3548 to match the convention assumed elsewhere.
3549 * tests/api-report.js: Added a test case.
3551 2013-05-26 Ryosuke Niwa <rniwa@webkit.org>
3553 SafariPerfMonitor shows popups for points outside of the visible region.
3555 Rubber-stamped by Simon Fraser.
3557 * public/index.html:
3558 (Chart.closestItemForPageXRespectingPlotOffset): renamed from closestItemForPageX.
3559 (Chart.attach): Always use closestItemForPageXRespectingPlotOffset to work around the fact flot
3560 may return an item underneath y-axis labels.
3562 2013-05-26 Ryosuke Niwa <rniwa@webkit.org>
3564 Tweak the CSS a little to avoid the test name overlapping with the summary table.
3566 * public/index.html:
3568 2013-05-26 Ryosuke Niwa <rniwa@webkit.org>
3570 Unreviewed. Fix the typo. The anchor element should wrap the svg element, not the other way around.
3572 * public/index.html:
3574 2013-05-26 Ryosuke Niwa <rniwa@webkit.org>
3576 <rdar://problem/13992266> Should be a toggle to show entire Y-axis range
3577 <rdar://problem/13992271> Should scale Y axis to include error ranges
3579 Reviewed by Ricky Mondello.
3581 Add the feature. Also made adjust y-axis respect confidence interval delta so that the gray shade behind
3582 the main graph doesn't go outside the graph even when the y-axis is adjusted.
3584 * database/config.json:
3585 * public/index.html:
3586 (Chart): Add a SVG arrow to toggle y-axis mode, and bind click on the arrow to toggleYAxis().
3587 (Chart.attachMainPlot): Respect shouldStartYAxisAtZero.
3588 (Chart.toggleYAxis): Toggle the y-axis mode of this chart by toggling shouldStartYAxisAtZero and calling
3590 * public/js/helper-classes.js:
3591 (PerfTestResult.confidenceIntervalDelta):
3592 (PerfTestResult.unscaledConfidenceIntervalDelta): Extracted.
3593 (PerfTestRuns.min): Take confidence interval delta into account.
3594 (PerfTestRuns.max): Ditto.
3595 (PerfTestRuns.hasConfidenceInterval): Not sure why this function was checking the typeof. Just use isNaN.
3597 2013-04-26 Ryosuke Niwa <rniwa@webkit.org>
3599 A build fix of the previous. Don't look for a test with NULL parent because NULL != NULL in our beloved SQL.
3601 * public/api/report.php:
3602 (ReportProcessor::recursively_ensure_tests):
3603 * tests/api-report.js: Added a test.
3605 2013-04-26 Ryosuke Niwa <rniwa@webkit.org>
3607 Unreviewed build fixes.
3609 * public/api/report.php:
3610 (ReportProcessor::process): Explicitly exit with error when builder name or build time is missing.
3611 Also, tolerate reports without any revision information.
3613 (ReportProcessor::recursively_ensure_tests): When looking for a test, don't forget to compare its
3616 * tests/api-report.js: Added few test cases.
3618 2013-04-26 Ryosuke Niwa <rniwa@webkit.org>
3620 Commit another change that was supposed to be committed in r50331.
3623 (TestEnvironment.this.postJSON):
3624 (TestEnvironment.this.httpGet):
3627 2013-04-09 Ryosuke Niwa <rniwa@webkit.org>
3629 Commit the remaining files.
3631 * public/admin/regenerate-manifest.php:
3632 * public/include/admin-header.php:
3633 * public/include/json-header.php:
3634 * public/include/manifest.php:
3636 (TestEnvironment.this.postJSON):
3637 (TestEnvironment.this.httpGet):
3640 2013-03-15 Ryosuke Niwa <rniwa@webkit.org>
3642 SafariPerfMonitor: Add some tests for admin/regenerate-manifest.
3644 Reviewed by Ricky Mondello.
3646 Added some tests for admin/regenerate-manifest.
3648 * public/admin/regenerate-manifest.php: Use require_once instead of require.
3649 * public/include/admin-header.php: Ditto.
3650 * public/include/json-header.php: Ditto.
3652 * public/include/manifest.php:
3653 (ManifestGenerator::builders): Removed a reference to a non-existent variable.