1 2015-05-20 Ryosuke Niwa <rniwa@webkit.org>
3 UI to associate bugs with an analysis task is crappy
4 https://bugs.webkit.org/show_bug.cgi?id=145198
6 Reviewed by Andreas Kling.
8 Make the UI less crappy by linkifying bug numbers and adding an explicit button to disassociate
9 a bug and a separate select view with a text field to associate a new bug instead of implicitly
10 updating or deleting the existing record based on what the user had typed.
12 * init-database.sql: Removed the constraint that each bug tracker should appear exactly once for
13 a given analysis task since it's perfectly reasonable for a given task to be associated with
16 * public/privileged-api/associate-bug.php:
17 (main): Only remove the bug specified by newly added bugToDelete instead of implicitly deleting
18 one that matches the analysis task and the bug tracker when the bug number is falsey.
20 * public/v2/analysis.js:
22 (App.BugAdapter.deleteRecord): Added. Uses the privileged API to delete the record.
27 (App.AnalysisTaskController.actions.addBug): Added.
28 (App.AnalysisTaskController.actions.deleteBug): Added.
29 (App.AnalysisTaskController.associateBug): Deleted.
31 * public/v2/index.html: Updated the templates.
33 * public/v2/manifest.js:
34 (App.BugTracker.urlFromBugNumber): Added.
36 2015-05-20 Ryosuke Niwa <rniwa@webkit.org>
38 A/B testing rootSets should provide commit times as well as revisions
39 https://bugs.webkit.org/show_bug.cgi?id=145207
41 Reviewed by Andreas Kling.
43 Some continuous build systems need the commit time as well as the revision number / hash so provide one
44 in the root sets but maintain the backwards compatibility with buildbots that use revision number directly.
46 * public/include/build-requests-fetcher.php:
47 (BuildRequestsFetcher::fetch_roots_for_set): Made the revision info an associative array that contains
48 the revision number as well as the commit time.
49 * tools/sync-with-buildbot.py:
50 (schedule_request): Removed "replacement" which was a superfluous copy of "roots". Use "revision" values
51 when the JSON configuration refers to "root". This is necessary in buildbot instances that require WebKit
52 revision to be specified on its own field instead of it being a JSON that contains "revision" and "time".
54 2015-05-19 Ryosuke Niwa <rniwa@webkit.org>
56 Build fix. Don't fall into an infinite loop when value (renamed from bytes) is zero.
58 * public/v2/manifest.js:
59 (App.Manifest.Ember.Controller.extend.):
60 (App.Manifest.Ember.Controller.extend):
62 2015-05-19 Ryosuke Niwa <rniwa@webkit.org>
64 Don't show unit (bytes) separaetly from SI suffixes (K, M, etc...)
65 https://bugs.webkit.org/show_bug.cgi?id=145181
67 Rubber-stamped by Chris Dumez.
69 Show 'MB' in each y-axis label instead of showing 'bytes' separately and suffixing each label with just 'M'
70 for clarity. This change also reduces the code complexity.
74 (App.AnalysisTaskController._chartDataChanged):
75 (App.TestGroupPane._createConfigurationSummary):
77 (RunsData.unitFromMetricName): Use 'B' instead of 'bytes' as the unit.
79 * public/v2/interactive-chart.js: Removed the support for showing units separately.
80 (App.InteractiveChartComponent._constructGraphIfPossible):
81 (App.InteractiveChartComponent._relayoutDataAndAxes)
83 * public/v2/manifest.js:
84 (App.Manifest._makeFormatter): Renamed from _formatBytes. Support more SI suffixes such as micro and mili.
85 Now takes the unit as the first argument. Adjust the base unit if it's 'ms'.
86 (App.Manifest._formatFetchedData): Removed unit and formatWithUnit now that all all formatters would
87 automatically include unit.
89 2015-05-18 Ryosuke Niwa <rniwa@webkit.org>
91 REGRESSION: v2 UI reports a higher memory usage
92 https://bugs.webkit.org/show_bug.cgi?id=145151
94 Reviewed by Chris Dumez.
96 The bug was caused by v2 UI using 1000 to divide the number of bytes instead of by 1024 as done in v1.
97 Fixed the bug by manually implementing the formatter as done in v1.
99 * public/v2/manifest.js:
100 (App.Manfiest._formatBytes): Added.
101 (App.Manifest._formatFetchedData): Use _formatByte instead of format('s').
103 2015-05-11 Ryosuke Niwa <rniwa@webkit.org>
105 Unreviewed build fix. Add "Duration" as a time metric.
107 * public/js/helper-classes.js:
109 (RunsData.unitFromMetricName):
111 2015-05-06 Ryosuke Niwa <rniwa@webkit.org>
113 Perf dashboard treats Speedometer and JetStream as smaller is better
114 https://bugs.webkit.org/show_bug.cgi?id=144711
116 Reviewed by Chris Dumez.
118 Added the support for "Score" metric.
120 * public/js/helper-classes.js:
123 (RunsData.unitFromMetricName):
124 (RunsData.isSmallerBetter):
126 2015-04-23 Ryosuke Niwa <rniwa@webkit.org>
128 Build fix after r183232.
130 * public/include/json-header.php:
132 2015-04-23 Ryosuke Niwa <rniwa@webkit.org>
134 Perf dashboard should automatically detect regressions
135 https://bugs.webkit.org/show_bug.cgi?id=141443
137 Reviewed by Anders Carlsson.
139 Added a node.js script detect-changes.js to detect potential regressions and progressions
140 on the graphs tracked on v2 dashboards.
142 * init-database.sql: Added analysis_strategies table and task_segmentation and task_test_range
143 columns to analysis_tasks to keep the segmentation and test range selection strategies used
144 to create an analysis task.
146 * public/api/analysis-tasks.php:
147 (format_task): Include task_segmentation and analysis_tasks in the results.
149 * public/include/json-header.php:
150 (remote_user_name): Returns null when the privileged API is authenticated as a slave instead
151 of a CSRF prevention token.
152 (should_authenticate_as_slave): Added.
153 (ensure_privileged_api_data_and_token_or_slave): Added. Authenticate as a slave if slaveName
154 and slavePassword are specified. Since detect-changes.js and other slaves are not susceptible
155 to a CSRF attack, we don't need to check a CSRF token.
157 * public/privileged-api/create-analysis-task.php:
158 (main): Use ensure_privileged_api_data_and_token_or_slave to let detect-changes.js create new
159 analysis task. Also add or find segmentation and test range selection strategies if specified.
161 * public/privileged-api/create-test-group.php:
162 (main): Use ensure_privileged_api_data_and_token_or_slave.
164 * public/privileged-api/generate-csrf-token.php:
167 (App.Pane._computeMovingAverageAndOutliers): _executeStrategy has been moved to Statistics.
169 * public/v2/data.js: Export Measurement, RunsData, TimeSeries. Used in detect-changes.js.
170 (Array.prototype.find): Added a polyfill to be used in node.js.
171 (RunsData.fetchRuns):
172 (RunsData.pathForFetchingRuns): Extracted from fetchRuns. Used in detect-changes.js.
173 (RunsData.createRunsDataInResponse): Extracted from App.Manifest._formatFetchedData to use it
174 in detect-changes.js.
175 (RunsData.unitFromMetricName): Ditto.
176 (RunsData.isSmallerBetter): Ditto.
177 (RunsData.prototype._timeSeriesByTimeInternal): Added secondaryTime to sort points when commit
179 (TimeSeries): When commit times are identical, order points based on build time. This is needed
180 for when we trigger two builds at two different OS versions with the same WebKit revision since
181 OS versions don't change the commit times.
182 (TimeSeries.prototype.findPointByIndex): Added.
183 (TimeSeries.prototype.rawValues): Added.
185 * public/v2/js/statistics.js:
186 (Statistics.TestRangeSelectionStrategies.[0]): Use the 99% two-sided probability as claimed in the
187 description of this strategy instead of the default probability. Also fixed a bug that debugging
188 code was referring to non-existent variables.
189 (Statistics.executeStrategy): Moved from App.Pane (app.js).
191 * public/v2/manifest.js:
192 (App.Manifest._formatFetchedData): Various code has been extracted into RunsData in data.js to be
193 used in detect-changes.js.
195 * tools/detect-changes.js: Added. The script fetches the manifest JSON, analyzes each graph in
196 the v2 dashboards, and creates an analysis task for the latest regression or progression detected.
197 It also schedules an A/B testing if possible and notifies another server; e.g. to send an email.
198 (main): Loads the settings JSON specified in the argument.
199 (fetchManifestAndAnalyzeData): The main loop that periodically wakes up to do the analysis.
200 (mapInOrder): Executes callback sequentially (i.e. blocking) on each item in the array.
201 (configurationsForTesting): Finds every (platform, metric) pair to analyze in the v2 dashbaords,
202 and computes various values for when statistically significant changes are detected later.
203 (analyzeConfiguration): Finds potential regressions and progression in the last X days where X
204 is the specified maximum number of days using the specified strategies. Sort the resultant ranges
205 in chronological order and create a new analysis task for the very last change we detected. We'll
206 eventually create an analysis task for all detected changes since we're repeating the analysis in
207 fetchManifestAndAnalyzeData after some time.
208 (computeRangesForTesting): Fetch measured values and compute ranges to test using the specified
209 segmentation and test range selection strategies. Once ranges are found, find overlapping analysis
210 tasks as they need to be filtered out in analyzeConfiguration to avoid creating multiple analysis
211 tasks for the same range (e.g. humans may create one before the script gets to do it).
212 (createAnalysisTaskAndNotify): Create a new analysis task for the specified range, trigger an A/B
213 testing if available, and notify another server with a HTML message as specified.
214 (findStrategyByLabel):
215 (changeTypeForRange): A change is a regression if values are getting larger in a smaller-is-better
216 test or values are getting smaller in a larger-is-better test and vice versa.
217 (summarizeRange): Create a human readable string that summarizes the change detected. e.g.
218 "Potential 3.2% regression detected between 2015-04-20 12:00 and 17:00".
222 (postNotification): Recursively replaces $title and $massage in the specified JSON template.
223 (instantiateNotificationTemplate):
226 2015-04-20 Ryosuke Niwa <rniwa@webkit.org>
228 Perf dashboard should have UI to set status on analysis tasks
229 https://bugs.webkit.org/show_bug.cgi?id=143977
231 Reviewed by Chris Dumez.
233 Added the UI to set the result of an analysis task to 'progression', 'regression', 'unchanged', and 'inconclusive'
234 as well as a boolean indicating whether creating the analysis task was the right thing to do or not.
235 The latter will be a useful metric once we start automatically creating analysis tasks.
237 * init-database.sql: Added two columns to analysis_tasks table.
238 * public/api/analysis-tasks.php: Include the added columns in the JSON.
239 * public/include/db.php:
240 (Database::to_database_boolean): Added.
241 * public/include/json-header.php:
242 (require_match_one_of_values): Added.
243 * public/privileged-api/update-analysis-task.php: Added. Updates 'result' and 'needed' values of an analysis task.
245 * public/v2/analysis.js:
246 (App.AnalysisTask.result): Added.
247 (App.AnalysisTask.needed): Added. We don't use DS.attr('boolean') here since that would coerce null into false
248 and we want to differentiate null from false in order to differentiate the null-ness of the value.
249 (App.AnalysisTask.saveStatus): Added.
250 (App.AnalysisTask.statusLabel): Use 'result' as the label if it's set and all build requests have been processed.
253 (App.AnalysisTaskController.analysisResultOptions): Added.
254 (App.AnalysisTaskController.shouldNotHaveBeenCreated): Added.
255 (App.AnalysisTaskController.needsFeedback): Added. Show the checkbox to indicate the analysis task should not have
256 been created if 'no change' is selected.
257 (App.AnalysisTaskController._updateChosenAnalysisResult): Added.
258 (App.AnalysisTaskController.actions.saveStatus): Added.
259 * public/v2/index.html: Extracted a partial template for updating the bug numbers. Also added the UI to update
260 'result' and 'needed' values of the analysis task.
262 2015-04-10 Ryosuke Niwa <rniwa@webkit.org>
264 Unreviewed build fix. Updated config.json after recent changes.
268 2015-04-10 Ryosuke Niwa <rniwa@webkit.org>
270 Make the analysis page more useful
271 https://bugs.webkit.org/show_bug.cgi?id=143617
273 Reviewed by Chris Dumez.
275 * public/api/analysis-tasks.php:
276 (fetch_and_push_bugs_to_tasks): Added total and finished numbers of build requests associated
277 with the fetched analysis tasks as buildRequestCount and finishedBuildRequestCount respectively.
278 * public/v2/analysis.js:
279 (App.AnalysisTask.formattedCreatedAt): Added.
280 (App.AnalysisTask._addLeadingZero): Added.
281 (App.AnalysisTask.buildRequestCount): Added.
282 (App.AnalysisTask.finishedBuildRequestCount): Added.
283 (App.AnalysisTask.statusLabel): Added. Status total and finished numbers of build requests.
284 (App.AnalysisTask.testGroups):
285 (App.AnalysisTask.triggerable):
286 (App.AnalysisTask.label):
288 * public/v2/app.css: Tweaked style rules for the analysis page.
291 (App.buildPopup): Sort the list of platforms by name.
292 (App.AnalysisRoute.model): Sort the list of analysis tasks by the order they are created.
293 (App.AnalysisTaskController._fetchedManifest): Added elementId to associate bug tracker names
294 such as "Bugzilla" with the corresponding text field.
296 * public/v2/index.html: Added a bunch of columns to the analysis page and also wrapped the table
297 showing A/B testing results in a div with overflow: scroll so that it always leaves enough space
298 for the accompanying graph.
300 2015-04-09 Ryosuke Niwa <rniwa@webkit.org>
302 Perf dashboard should automatically select ranges for A/B testing
303 https://bugs.webkit.org/show_bug.cgi?id=143580
305 Reviewed by Chris Dumez.
307 Added a new statistics option for picking a A/B test range selection strategy.
308 The selected ranges are shown in the graph using the same UI to show analysis tasks.
311 (App.DashboardPaneProxyForPicker._platformOrMetricIdChanged): Updated the query parameters for
312 charts page used by the dashboard since we've added a new parameter at the end.
313 (App.Pane.ranges): Added. Merges ranges created for analysis tasks and A/B testing.
314 (App.Pane.updateStatisticsTools): Clone and set the test range selection strategies.
315 (App.Pane._cloneStrategy): Copy isSegmentation.
316 (App.Pane._updateMovingAverageAndEnvelope): Set testRangeCandidates.
317 (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Update the charts when a new text range
318 selection strategy is picked by the user.
319 (App.Pane._computeMovingAverageAndOutliers): Compute the test ranges using the chosen strategy.
320 Avoid going through isAnomalyArray when no anomaly detection strategy is enabled. Also changed
321 the return value from the moving average time series to a dictionary that contains the moving
322 average time series, a dictionary of anomalies, and an array of test ranges.
323 (App.ChartsController._parsePaneList): Parse the test range selection strategy configuration.
324 (App.ChartsController._serializePaneList): Ditto for serialization.
325 (App.ChartsController._scheduleQueryStringUpdate): Update the URL hash when the user picks a new
326 test range selection strategy.
328 * public/v2/chart-pane.css: Fixed a typo as well as added a CSS rule for test ranges markers.
330 * public/v2/index.html: Added UI for selecting a test range selection strategy.
332 * public/v2/interactive-chart.js:
333 (App.InteractiveChartComponent._rangesChanged): Pass down "status" to be used as a class name.
335 * public/v2/js/statistics.js:
336 (Statistics.MovingAverageStrategies): Added isSegmentation to segmentation strategies.
337 (Statistics.TestRangeSelectionStrategies): Added.
339 2015-04-08 Ryosuke Niwa <rniwa@webkit.org>
341 The results of A/B testing should state statistical significance
342 https://bugs.webkit.org/show_bug.cgi?id=143552
344 Reviewed by Chris Dumez.
346 Added statistical comparisons between results for each configuration on analysis task page using
347 Welch's t-test. The probability as well as t-statistics and the degrees of freedoms are reported.
350 (App.TestGroupPane._populate): Report the list of statistical comparison between every pair of
351 root configurations in the results. e.g. if we've got A, B, C configurations then compare A/B, A/C
353 (App.TestGroupPane._computeStatisticalSignificance): Compute the statistical significance using
354 Welch's t-test. Report the probability by which two samples do not come from the same distribution.
355 (App.TestGroupPane._createConfigurationSummary): Include the array of results for this configuration.
356 Also renamed "items" to "requests" for clarity.
358 * public/v2/index.html: Added the template for showing statistical comparisons.
360 * public/v2/js/statistics.js: Renamed tDistributionQuantiles to tDistributionByOneSidedProbability
361 for clarity. Also factored out the functions to convert from one-sided probability to two-sided
362 probability and vice versa.
363 (Statistics.supportedConfidenceIntervalProbabilities):
364 (Statistics.confidenceIntervalDelta):
365 (Statistics.probabilityRangeForWelchsT): Added. Computes the lower bound and the upper bound for
366 the probability that two values are sampled from distinct distributions using Welch's t-test.
367 (Statistics.computeWelchsT): This function now takes two-sided probability like all other functions.
368 (.tDistributionByOneSidedProbability): Renamed from tDistributionQuantiles.
369 (.oneSidedToTwoSidedProbability): Extracted.
370 (.twoSidedToOneSidedProbability): Extracted.
371 (Statistics.MovingAverageStrategies): Converted the one-sided probability to the two-sided probability
372 now that computeWelchsT takes two-sided probability.
374 2015-04-08 Ryosuke Niwa <rniwa@webkit.org>
376 Unreviewed fix after r182496 for when the cached runs JSON doesn't exist.
380 (App.Pane.refetchRuns):
382 2015-04-07 Ryosuke Niwa <rniwa@webkit.org>
384 Perf dashboard should have a way of marking outliers
385 https://bugs.webkit.org/show_bug.cgi?id=143466
387 Reviewed by Chris Dumez.
389 Address kling's in-person comment to notify users when the new run status is saved in the database.
392 (App.PaneController._selectedItemIsMarkedOutlierDidChange)
393 * public/v2/chart-pane.css: Fixed a typo.
395 2015-04-07 Ryosuke Niwa <rniwa@webkit.org>
397 Perf dashboard should have a way of marking outliers
398 https://bugs.webkit.org/show_bug.cgi?id=143466
400 Reviewed by Chris Dumez.
402 Added UI to mark a data point as an outlier as well as a button to toggle the visibility of outliers.
403 Added a new privileged API /privileged-api/update-run-status to store this boolean flag.
405 * init-database.sql: Added run_marked_outlier column to test_runs table.
407 * public/admin/tests.php:
409 * public/api/runs.php:
410 (main): Only emit Cache-Control and Expires headers in v1 UI.
411 (RunsGenerator::format_run): Emit markedOutlier.
413 * public/include/admin-header.php:
415 * public/include/db.php:
416 (Database::is_true): Made it static.
418 * public/include/manifest.php:
419 (Manifest::platforms):
421 * public/index.html: Call into /api/runs/ with ?cache=true.
423 * public/privileged-api/update-run-status.php: Added.
424 (main): Updates the newly added column in test_runs table.
428 (App.Pane.refetchRuns): Extracted from App.Pane._fetch.
429 (App.Pane._didFetchRuns): Renamed from _updateChartData.
430 (App.Pane._setNewChartData): Added. Pick the right time series based based on the value of showOutlier.
431 Cloning chartData is necessary when toggling the outlier visibility or using statistics tools because
432 the interactive chart component only observes changes to chartData and not individual properties of it.
433 (App.Pane._highlightPointsMarkedAsOutlier): Added. Highlight points marked as outliers.
434 (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Call to _setNewChartData replaced the code to
435 clone chartData here.
437 (App.PaneController.actions.toggleShowOutlier): Toggle the visibility of points marked as outliers by
438 invoking App.Pane._setNewChartData.
439 (App.PaneController._detailsChanged): Don't hide the analysis pane when details changed since keep
440 opening the pane for marking points as outliers would be annoying.
441 (App.PaneController._updateCanAnalyze): Update 'cannotMarkOutlier' as well as 'cannotAnalyze'.
442 (App.PaneController.selectedMeasurement): Added.
443 (App.PaneController.showOutlierTitle): Added.
444 (App.PaneController._selectedItemIsMarkedOutlierDidChange): Added. Call out to setMarkedOutlier to
445 mark the selected point as an outlier via the newly added privileged API.
447 * public/v2/chart-pane.css: Updated styles.
450 (PrivilegedAPI._post): Report the semantic errors.
451 (Measurement.prototype.markedOutlier): Added.
452 (Measurement.prototype.setMarkedOutlier): Added. Uses PrivilegedAPI to update the database.
453 (RunsData.prototype.timeSeriesByCommitTime): Added a new argument, includeOutliers, to indicate
454 whether the time series should include measurements marked as outliers or not.
455 (RunsData.prototype.timeSeriesByBuildTime): Ditto.
456 (RunsData.prototype._timeSeriesByTimeInternal): Extracted from timeSeriesByCommitTime and
457 timeSeriesByBuildTime to share code. Now ignores measurements marked as outliers if needed.
459 * public/v2/index.html: Added an icon for showing and hiding outliers. Also added a checkbox to
460 mark individual points as outliers.
462 * public/v2/interactive-chart.js:
463 (App.InteractiveChartComponent._selectClosestPointToMouseAsCurrentItem): Re-enable the distance
464 heuristics that takes vertical closeness into account. This heuristics is more useful when marking
465 some points as outliers. This heuristics was disabled because the behavior was unpredictable but
466 with the arrow key navigation support, this is no longer an issue.
468 * public/v2/manifest.js:
469 (App.Manifest._formatFetchedData): Added showOutlier to the chart data. This function dynamically
470 updates the time series in this chart data in order to include or exclude outliers.
472 2015-04-03 Ryosuke Niwa <rniwa@webkit.org>
474 Perf dashboard should be able to trigger A/B testing jobs for iOS
475 https://bugs.webkit.org/show_bug.cgi?id=143398
477 Reviewed by Chris Dumez.
479 Fix various bugs in the perf dashboard so that it can schedule A/B testing jobs for iOS.
481 Also generalized sync-with-buildbot.py slightly to meet the requirements of iOS builders.
483 * public/api/triggerables.php:
484 (main): Avoid spitting a warning when $id_to_triggerable doesn't contain the triggerable.
485 * public/v2/analysis.js:
486 (App.AnalysisTask.triggerable): Log an error when failed to fetch triggerables for debugging purposes.
488 (App.AnalysisTaskController.updateRootConfigurations): Show 'None' when a revision is missing from
489 some of the data points. This will happen when we modify the list of projects we build for iOS.
490 (App.AnalysisTaskController.actions.createTestGroup): Gracefully fail by showing alerts when an user
491 attempts to create an invalid test group; when there is already another test group of the same or when
492 only either configuration specifies the revision for some repository.
493 (App.AnalysisTaskController._updateRootsBySelectedPoints): Fixed a typo: sets[i] -> set.
494 * public/v2/index.html: Don't show the form to create a new test group if it's not available.
495 * tools/sync-with-buildbot.py:
496 (find_request_updates):
497 (schedule_request): iOS builders take a JSON that contains the list of roots. Generate this JSON when
498 a dictionary of the form {rootsExcluding: ["WebKit"]} is specified. Also replaced the way we refer to
499 a revision from $-based text replacements to an explicit dictionary of the form {root: "WebKit"}.
500 (request_id_from_build): Don't hard code the parameter name here. Retrieve the name from the config.
502 2015-04-03 Ryosuke Niwa <rniwa@webkit.org>
504 Add time series segmentation algorithms as moving averages
505 https://bugs.webkit.org/show_bug.cgi?id=143362
507 Reviewed by Chris Dumez.
509 This patch implements two preliminary time series segmentation algorithms as moving averages.
511 Recursive t-test: Compute Welch's t-statistic at each point in a given segment of the time series.
512 If Welch's t-test implicates a statistically significance difference, then split the segment into two
513 sub segments with the maximum t-statistic (i.e. the point at which if split would yield the highest
514 probability that two segments do not share the same "underlying" mean in classical / frequentist sense).
515 We repeat this process recursively. See [1] for the evaluation of this particular algorithm.
517 Schwarz criterion: Use Schwarz or Bayesian information criterion to heuristically find the optimal
518 segmentation. Intuitively, the problem of finding the best segmentation comes down to minimizing the
519 residual sum of squares in each segment as in linear regressions. That is, for a given segment with
520 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
521 through i = n. However, we also don't want to split every data point into a separate segment so we need
522 to account the "cost" of introducing new segments. We use a cost function that's loosely based on two
523 models discussed in [2] for simplicity. We will tune this cost function further in the future.
525 The problem of finding the best segmentation then reduces to a search problem. Unfortunately, our problem
526 space is exponential with respect to the size of the time series since we could split at each data point.
527 We workaround this problem by first splitting the time series into a manageable smaller grids, and only
528 considering segmentation of a fixed size (i.e. the number of segments is constant). Since time series
529 tend to contain a lot more data points than segments, this strategy finds the optimal solution without
530 exploring much of the problem space.
532 Finding the optimal segmentation of a fixed size is, itself, another search problem that is equivalent to
533 finding the shortest path of a fixed length in DAG. Here, we use dynamic programming with a matrix of size
534 n by n where n is the length of the time series (grid). Each entry in this matrix at (i, k) stores
535 the minimum cost of segmenting data points 1 through i using k segments. We start our search at i = 1.
536 Clearly C(1, 0) = 0 (note the actual code uses 0-based index). In i-th iteration, we compute the cost
537 S(i, j) of each segment starting at i and ending at another point j after i and update C(j, k + 1) by
538 min( C(j, k + 1), C(i, k) + S(i, j) ) for all values of j above i.
540 [1] Kensuke Fukuda, H. Eugene Stanley, and Luis A. Nunes Amaral, "Heuristic segmentation of
541 a nonstationary time series", Physical Review E 69, 021108 (2004)
543 [2] Marc Lavielle, Gilles Teyssi`ere, "Detection of Multiple Change–Points in Multivariate Time Series"
544 Lithuanian Mathematical Journal, vol 46, 2006
546 * public/v2/index.html: Show the optional description for the chosen moving average strategy.
547 * public/v2/js/statistics.js:
548 (Statistics.testWelchsT):
549 (Statistics.computeWelchsT): Extracted from testWelchsT. Generalized to take the offset and the length
550 of each value array between which Welch's t-statistic is computed. This generalization helps the
551 Schwarz criterion segmentation algorithm avoid splitting values array O(n^2) times.
552 (.sampleMeanAndVarianceForValues): Ditto for the generalization.
553 (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Added. Implements recursive t-test.
554 (.splitIntoSegmentsUntilGoodEnough): Added. Implements Schwarz criterion.
555 (.findOptimalSegmentation): Added. Implements the algorithm to find the optimal segmentation of a fixed
557 (.SampleVarianceUpperTriangularMatrix): Added. Stores S(i, j) used by findOptimalSegmentation.
558 (.SampleVarianceUpperTriangularMatrix.prototype.costBetween): Added.
560 2015-04-03 Ryosuke Niwa <rniwa@webkit.org>
562 REGRESSION: Perf dashboard sometimes fails to update zooming level
563 https://bugs.webkit.org/show_bug.cgi?id=143359
565 Reviewed by Darin Adler.
567 The bug was caused by various bugs that ended up in an exception.
570 (App.Pane._handleFetchErrors): Removed superfluous console.log.
571 (App.Pane.computeStatus): Fixed the bug in r182185 that previousPoint could be null.
572 (App.PaneController.actions.zoomed): Update the overview when the main chart triggered a zoom.
573 * public/v2/index.html: Replaced all instances of href="#" by href="javascript:false" to avoid navigating
574 to # when Ember.js fails to attach event listeners on time.
575 * public/v2/interactive-chart.js:
576 (App.InteractiveChartComponent._updateDimensionsIfNeeded): Avoid using a negative width or height when
577 the containing element's size is 0.
578 (App.InteractiveChartComponent._updateBrush): Ditto.
580 2015-04-02 Ryosuke Niwa <rniwa@webkit.org>
582 Perf dashboard should have UI to test out anomaly detection strategies
583 https://bugs.webkit.org/show_bug.cgi?id=143290
585 Reviewed by Benjamin Poulain.
587 Added the UI to select anomaly detection strategies. The detected anomalies are highlighted in the graph.
589 Implemented the Western Electric Rules 1 through 4 in http://en.wikipedia.org/wiki/Western_Electric_rules
590 as well as Welch's t-test that compares the last five points to the prior twenty points.
592 The latter is what Mozilla uses (or at least did in the past) to detect performance regressions on their
593 performance tests although they compare medians instead of means.
595 All of these strategies don't quite work for us since our data points are too noisy but this is a good start.
598 (App.Pane.updateStatisticsTools): Clone anomaly detection strategies.
599 (App.Pane._updateMovingAverageAndEnvelope): Highlight anomalies detected by the enabled strategies.
600 (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Observe changes to anomaly detection strategies.
601 (App.Pane._computeMovingAverageAndOutliers): Detect anomalies by each strategy and aggregate results.
602 Only report the first data point when multiple consecutive data points are detected as anomalies.
603 * public/v2/chart-pane.css: Updated styles.
604 * public/v2/index.html: Added the pane for selecting anomaly detection strategies.
605 * public/v2/js/statistics.js:
606 (Statistics.testWelchsT): Added. Implements Welch's t-test.
607 (.sampleMeanAndVarianceForValues): Added.
608 (.createWesternElectricRule): Added.
609 (.countValuesOnSameSide): Added.
610 (Statistics.AnomalyDetectionStrategy): Added.
612 2015-03-31 Ryosuke Niwa <rniwa@webkit.org>
614 REGRESSION: Searching commits can highlight wrong data points
615 https://bugs.webkit.org/show_bug.cgi?id=143272
617 Reviewed by Antti Koivisto.
619 The bug was caused by /api/commits returning commit times with millisecond precision whereas /api/runs
620 return commit times with only second precision. This resulted in the frontend code to match a commit
621 with the data point that included the next commit when the millisecond component of commit's timestamp
622 wasn't identically 0.
624 This discrepancy was caused by the fact PHP's strtotime only ignores milliseconds and /api/commits
625 was returning timestamp as string instead of parsing via Database::to_js_time as done in /api/runs
626 so miliseconds component was only preserved in /api/commits.
628 Fixed the bug by always using Database::to_js_time to return commit time. Also fixed to_js_time so that
629 it returns time in milisecond precision.
631 * public/api/commits.php:
632 (fetch_commits_between): Use Database::to_js_time for format commit times.
633 (format_commit): Ditto.
634 * public/include/db.php:
635 (Database::to_js_time): Parse and append millisecond component. Ignore sub-milliseconds for simplicity.
637 (CommitLogs.fetchForTimeRange): The commit time is now an integer so don't call "replace" on it.
639 2015-03-31 Ryosuke Niwa <rniwa@webkit.org>
641 Perf dashboard should show relative change in values
642 https://bugs.webkit.org/show_bug.cgi?id=143252
644 Reviewed by Antti Koivisto.
646 When a range of values are selected, show the percentage difference between the start and the end
647 in addition to the absolute value difference. When a single point is selected, show the relative
648 difference with respect to the previous point. Use two significant figures and always show plus sign
649 when the difference is positive.
651 * public/v2/app.js: Compute and format the relative difference.
652 * public/v2/chart-pane.css: Don't let commits view shrink itself when they're all collapsed.
653 * public/v2/index.html: Show the relative difference.
655 2015-03-31 Ryosuke Niwa <rniwa@webkit.org>
657 REGRESSION(r180000): Changing moving average or enveloping strategy doesn't update the graph
658 https://bugs.webkit.org/show_bug.cgi?id=143254
660 Reviewed by Antti Koivisto.
662 The bug was caused by App.Pane no longer replacing 'chartData' property when updating the moving average
663 or the enveloping values. Fixed the bug by creating a new chartData object when the strategy is changed
664 so that the interactive chart component will observe a change to 'chartData'.
667 (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Added.
669 2015-03-19 Ryosuke Niwa <rniwa@webkit.org>
671 Unreviewed build fixes.
673 * public/include/manifest.php:
674 (Manifest::generate): These should be {} instead of [] when they're empty.
676 (Measurement.prototype.formattedRevisions): Don't assume previousRevisions[repositoryId] exits.
677 * public/v2/manifest.js:
678 (App.Metric.fullName): Fixed the typo.
679 * tests/admin-regenerate-manifest.js: Fixed the test.
681 2015-02-20 Ryosuke Niwa <rniwa@webkit.org>
683 Commit the erroneously reverted change.
685 * public/api/runs.php:
686 (RunsGenerator::results):
688 2015-02-20 Ryosuke Niwa <rniwa@webkit.org>
690 Loading the perf dashboard takes multiple seconds
691 https://bugs.webkit.org/show_bug.cgi?id=141860
693 Reviewed by Andreas Kling.
695 This patch introduces the caches of JSON files returned by /api/ in /data/ directory. It also records
696 the last time test_runs rows associated with the requested platforms and metrics are inserted, updated,
697 or removed in the caches as well as the manifest JSON files ("last modified time"). Because the manifest
698 is regenerated each time a new test result is reported, the front end can compare last modified time in
699 the manifest file with that in a /api/runs JSON cache to detect the stale-ness.
701 More concretely, the front end first optimistically fetches the JSON in /data/. If the cache doesn't exit
702 or the last modified time in the cache doesn't match with that in the manifest file, it would fetch it
703 again via /api/runs. In the case the cache did exist, we render the charts based on the cache meanwhile.
704 This dramatically reduces the perceived latency for the page load since charts are drawn immediately using
705 the cache and we would only re-render the charts as new up-to-date JSON comes in.
707 This patch also changes the format of runs JSONs by pushing the exiting properties into 'configurations'
708 and adding 'lastModified' and 'elapsedTime' at the top level.
710 * init-database.sql: Added config_runs_last_modified to test_configurations table as well as a trigger to
711 auto-update this column upon changes to test_runs table.
713 * public/admin/test-configurations.php:
714 (add_run): Regenerate the manifest file to invalidate the /api/runs JSON cache.
717 * public/api/runs.php:
718 (main): Fetch all columns of test_configurations table including config_runs_last_modified. Also generate
719 the cache in /data/ directory.
720 (RunsGenerator::__construct): Compute the last modified time for this (platform, metric) pair.
721 (RunsGenerator::results): Put the old content in 'configurations' property and include 'lastModified' and
722 'elapsedTime' properties. 'elapsedTime' is added for debugging purposes.
723 (RunsGenerator::add_runs):
724 (RunsGenerator::parse_revisions_array):
726 * public/include/db.php:
728 (generate_data_file): Added based on ManifestGenerator::store.
729 (Database::to_js_time): Extracted from RunsGenerator::add_runs to share code.
731 * public/include/json-header.php:
732 (echo_success): Renamed from success_json. Return the serialized JSON instead of echo'ing it so that we can
733 generate caches in /api/runs/.
736 * public/include/manifest.php:
737 (ManifestGenerator::generate): Added 'elapsedTime' property for the time taken to generate the manifest.
738 It seems like we're generating it in 200-300ms for now so that's good.
739 (ManifestGenerator::store): Uses generate_data_file.
740 (ManifestGenerator::platforms): Added 'lastModified' array to each platform entry. This array contains the
741 last modified time for each (platform, metric) pair.
744 (fetchTest): Updated per the format change in runs JSON.
747 (App.Pane._fetch): Fetch the cached JSON first. Refetch the uncached version if instructed as such.
748 (App.Pane._updateChartData): Extracted from App.Pane._fetch.
749 (App.Pane._handleFetchErrors): Ditto.
752 (RunsData.fetchRuns): Takes the fourth argument indicating whether we should fetch the cached version or not.
753 The cached JSON is located in /data/ with the same filename. When fetching a cached JSON results in 404,
754 fulfill the promise with null as the result instead of rejecting it. The only client of this function which
755 sets useCache to true is App.Manifest.fetchRunsWithPlatformAndMetric, and it handles this special case.
757 * public/v2/manifest.js:
758 (App.DateArrayTransform): Added. Handles the array of last modified dates in platform objects.
759 (App.Platform.lastModifiedTimeForMetric): Added. Returns the last modified date in the manifest JSON.
760 (App.Manifest.fetchRunsWithPlatformAndMetric): Takes "useCache" like RunsData.fetchRuns. Set shouldRefetch
761 to true if response is null (the cache didn't exit) or the cache is out-of-date.
762 (App.Manifest._formatFetchedData): Extracted from App.Manifest.fetchRunsWithPlatformAndMetric.
765 (initializeDatabase): Avoid splitting function definitions in the middle.
767 * tests/api-report.js: Added tests to verify that reporting new test results updates the last modified time
768 in test_configurations.
770 2015-02-20 Ryosuke Niwa <rniwa@webkit.org>
772 REGRESSION(r180333): Analysis tasks can't be associated with bugs
773 https://bugs.webkit.org/show_bug.cgi?id=141858
775 Reviewed by Andreas Kling.
777 Added back the erroneously removed table to associate bugs. Also moved "details-table-container" div outside
778 of the chart-details partial template as it needs to wrap associate bugs in analysis task pages.
780 * public/v2/chart-pane.css:
781 * public/v2/index.html:
783 2015-02-20 Ryosuke Niwa <rniwa@webkit.org>
785 Selecting revisions for A/B testing is hard
786 https://bugs.webkit.org/show_bug.cgi?id=141824
788 Reviewed by Andreas Kling.
790 Update the revisions used in A/B testing based on the selection in the overview chart. This allows users to
791 intuitively select revisions based on points shown in the chart. Removed the old select elements used to
792 select A/B testing points manually.
794 Also renamed 'testSets' to 'configurations', 'roots' to 'rootConfigurations', and 'revisions' in each root's
795 sets to 'options' for clarity.
797 * public/v2/app.css: Reorganized style rules.
800 (App.AnalysisTaskController):
801 (App.AnalysisTaskController._taskUpdated): Merged updateTestGroupPanes.
802 (App.AnalysisTaskController._chartDataChanged): Renamed from paneDomain. It's now an observer instead of
803 a property, which sets 'overviewDomain' property as well as other properties.
804 (App.AnalysisTaskController.updateRootConfigurations): Renamed from updateRoots.
805 (App.AnalysisTaskController._updateRootsBySelectedPoints): Added. Select roots based on the selected points
806 in the overview chart.
808 * public/v2/chart-pane.css: Added arrows next to the configuration names (e.g. 'A') to indicate whether
809 individual build requests / test results are shown or not.
811 * public/v2/index.html: Removed the select element per configuration column. Also moved the select element
812 for the number of runs as it doesn't belong in the same table as the one that lists repositories and roots.
814 2015-02-20 Ryosuke Niwa <rniwa@webkit.org>
816 Unreviewed test fixes after r179037, r179591, and r179763.
818 * tests/admin-regenerate-manifest.js:
819 * tests/admin-reprocess-report.js:
821 2015-02-19 Ryosuke Niwa <rniwa@webkit.org>
823 Relationship between A/B testing results are unclear
824 https://bugs.webkit.org/show_bug.cgi?id=141810
826 Reviewed by Andreas Kling.
828 Show a "reference chart" indicating which two points have been tested in each test group pane.
830 Now the chart shown at the top of an analysis task page is called the "overview pane", and we use the pane
831 and the domain used in this chart to show charts in each test group.
833 Also renamed an array of revisions used in the A/B test results tables from 'revisions' to 'revisionList'.
835 * public/v2/analysis.js:
836 (App.TestGroup._fetchTestResults): Renamed from _fetchChartData. Set 'testResults' instead of 'chartData'
837 since this is the results of A/B testing results, not the data for charts shown next to them.
839 * public/v2/app.css: Added CSS rules for reference charts.
842 (App.AnalysisTaskController.paneDomain): Set 'overviewPane' and 'overviewDomain' on each test group pane.
843 (App.TestGroupPane._populate): Updated per 'chartData' to 'testResults' rename.
844 (App.TestGroupPane._updateReferenceChart): Get the chart data via the overview pane and find points that
845 identically matches root sets. If one of configuration used a set of revisions for which no measurement
846 was made in the original chart, don't show the reference chart as that would be misleading / confusing.
847 (App.TestGroupPane._computeRepositoryList): Updated per 'chartData' to 'testResults' rename.
848 (App.TestGroupPane._createConfigurationSummary): Ditto. Also renamed 'revisions' to 'revisionList'.
849 In addition, renamed 'buildNumber' to 'buildLabel' and prefixed it with "Build ".
852 (Measurement.prototype.revisionForRepository): Added.
853 (Measurement.prototype.commitTimeForRepository): Cleanup.
854 (TimeSeries.prototype.findPointByRevisions): Added. Finds a point based on a set of revisions.
856 * public/v2/index.html: Added the reference chart. Streamlined the status label for each build request
857 by including the build number in the title attribute instead of in the markup.
859 * public/v2/interactive-chart.js:
860 (App.InteractiveChartComponent._updateDomain): Fixed a typo introduced as a consequence of r179913.
861 (App.InteractiveChartComponent._computeYAxisDomain): Expand the y-axis to show the highlighted points.
862 (App.InteractiveChartComponent._highlightedItemsChanged): Adjust the y-axis as needed.
864 2015-02-18 Ryosuke Niwa <rniwa@webkit.org>
866 Analysis task pages are unusable
867 https://bugs.webkit.org/show_bug.cgi?id=141786
869 Reviewed by Andreas Kling.
871 This patch makes following improvements to analysis task pages:
872 1. Making the main chart interactive. This change required the use of App.Pane as well as moving the code to
873 compute the data for the details pane from PaneController.
874 2. Moving the form to add a new test group to the top of test groups instead of the bottom of them.
875 3. Grouping the build requests in each test group by root sets instead of the order by which they were ran.
876 This change required the creation of App.TestGroupPane as well as its methods.
877 4. Show a box plot for each root set configuration as well as each build request. This change required
878 App.BoxPlotComponent.
879 5. Show revisions of each repository (e.g. WebKit) for each root set and build request.
881 * public/api/build-requests.php:
882 (main): Update per the rename of BuildRequestsFetcher::root_sets to BuildRequestsFetcher::root_sets_by_id.
884 * public/api/test-groups.php:
885 (main): Include root sets and roots in the response.
888 * public/include/build-requests-fetcher.php:
889 (BuildRequestsFetcher::root_sets_by_id): Renamed from root_sets.
890 (BuildRequestsFetcher::root_sets): Added.
891 (BuildRequestsFetcher::roots): Added.
892 (BuildRequestsFetcher::fetch_roots_for_set): Takes a boolean argument $resolve_ids. This flag is only set to
893 true in /api/build-requests/ (as done prior to this patch) to use repository names as identifiers since
894 tools/sync-with-buildbot.py can't convert repository names to their ids.
896 * public/v2/analysis.js:
898 (App.RootSet): Added.
899 (App.RootSet.revisionForRepository): Added.
900 (App.TestGroup.rootSets): Deleted the code to compute root set ids from build requests now that the JSON
901 response at /api/test-groups will include them.
902 (App.BuildRequest): Ditto. Also deleted 'configLetter' property, which has been moved to a proxy created by
903 _createConfigurationSummary.
904 (App.BuildRequest.statusLabel): Use 'Completed' as the human readable label for 'completed' status.
905 (App.BuildRequest.aggregateStatuses): Added. Generates a human readable status for a set of build requests.
907 * public/v2/app.css: Updated style rules for analysis task pages.
910 (App.Pane): This class is now used in analysis task pages to make the main chart interactive.
911 (App.Pane._updateDetails): Moved from App.PaneController.
913 (App.PaneController._updateCanAnalyze): Updated the code per the move of selectedPoints.
915 (App.AnalysisTaskController): Added 'details'.
916 (App.AnalysisTaskController._taskUpdated):
917 (App.AnalysisTaskController.paneDomain):Renamed from _fetchedRuns.
918 (App.AnalysisTaskController.updateTestGroupPanes): Added. Creates App.TestGroupPane for each test group.
919 (App.AnalysisTaskController.actions.toggleShowRequestList): Added.
921 (App.TestGroupPane): Added.
922 (App.TestGroupPane._populate): Added. Group build requests by root sets and create a summary for each group.
923 (App.TestGroupPane._computeRepositoryList): Added. Returns a sorted list of repositories which is the union
924 of all repositories appearing in root sets and builds associated with A/B testing results.
925 (App.TestGroupPane._groupRequestsByConfigurations): Added. Groups build requests by root sets.
926 (App.TestGroupPane._createConfigurationSummary): Added. Creates a summary for a group of build requests that
927 use the same root set. We start by wrapping "raw" build requests in a proxy with formatted values,
928 build numbers, etc... obtained from the fetched chart data. The list of revisions shown in the group summary
929 is a union of revisions in the root set and the first build request in the group. We null-out revision info
930 for a build request if it is identical to the one in the summary. The range of values is expanded as needed
931 by the values in the group as well as 95% percentile confidence interval.
933 (App.BoxPlotComponent): Added. Controls a box plot shown for each test group summary and build request.
934 (App.BoxPlotComponent.didInsertElement): Added. Inserts a SVG element as well as two indicator rects to show
935 the mean and the confidence interval.
936 (App.BoxPlotComponent._updateBars): Added. Updates the dimensions of the indicator rects.
937 (App.BoxPlotComponent.valueChanged): Added. Computes the relative dimensions of the indicator rects and
938 calls _updateBars to update the rects.
940 * public/v2/chart-pane.css: Added some style rules to be used in the details pane in analysis task pages.
943 (Measurement.prototype.formattedRevisions):
944 (Measurement.formatRevisionRange): Renamed from Measurement.prototype._formatRevisionRange so that it can be
945 called in _createConfigurationSummary.
947 * public/v2/index.html: Updated the templates for analysis task pages. Moved the form to create a new test
948 group above all test groups, and replaced the list of data points by "details" pane used in the charts page.
949 Also made the fetching of chartData no longer block showing of test groups.
951 * public/v2/interactive-chart.js:
952 (App.InteractiveChartComponent._updateDomain): Added an early exit to fix a newly revealed race condition.
953 (App.InteractiveChartComponent._domainChanged): Ditto.
954 (App.InteractiveChartComponent._updateSelectionToolbar): Made it respect 'zoomable' boolean property.
956 * public/v2/js/statistics.js:
957 (Statistics.min): Added.
958 (Statistics.max): Added.
960 * public/v2/manifest.js:
961 (App.Manifest.fetchRunsWithPlatformAndMetric): Added formatWithDeltaAndUnit to be used in _createConfigurationSummary.
963 2015-02-14 Ryosuke Niwa <rniwa@webkit.org>
965 Build URL on new perf dashboard doesn't resolve $builderName
966 https://bugs.webkit.org/show_bug.cgi?id=141583
968 Reviewed by Darin Adler.
970 Support $builderName in the build URL template.
972 * public/js/helper-classes.js:
973 (TestBuild.buildUrl): Replaced $builderName with the builder name.
975 * public/v2/manifest.js:
976 (App.Metric.fullName): Fixed the typo. We need &ni, not &in.
977 (App.BuilderurlFromBuildNumber): Replaced $builderName with the builder name.
979 2015-02-13 Ryosuke Niwa <rniwa@webkit.org>
981 Unreviewed build fix after r179591.
983 * public/api/commits.php:
985 2015-02-13 Ryosuke Niwa <rniwa@webkit.org>
987 The status of a A/B testing request always eventually becomes "Failed"
988 https://bugs.webkit.org/show_bug.cgi?id=141523
990 Reviewed by Andreas Kling.
992 The bug was caused by /api/build-requests always setting the status of a build request to 'failed' when
993 'failedIfNotCompleted' was sent by the buildbot sync'er.
995 Fixed the bug by only setting the status to 'failed' if it wasn't set to 'completed'.
997 * public/api/build-requests.php:
1000 2015-02-13 Csaba Osztrogonác <ossy@webkit.org>
1002 Unreviewed, remove empty directories.
1004 * public/data: Removed.
1006 2015-02-12 Ryosuke Niwa <rniwa@webkit.org>
1008 Perf dashboard should show the results of A/B testing
1009 https://bugs.webkit.org/show_bug.cgi?id=141500
1011 Reviewed by Chris Dumez.
1013 Added the support for fetching test_runs for a specific test group in /api/runs/, and used it in the
1014 analysis task page to fetch results for each test group.
1016 Merged App.createChartData into App.Manifest.fetchRunsWithPlatformAndMetric so that App.BuildRequest
1017 can use the formatter.
1019 * public/api/runs.php:
1020 (fetch_runs_for_config_and_test_group): Added.
1021 (fetch_runs_for_config): Just return the fetched rows since main will format them with RunsGenerator.
1022 (main): Use fetch_runs_for_config_and_test_group to fetch rows when a test group id is specified. Also
1023 use RunsGenerator to format results.
1024 (RunsGenerator): Added.
1025 (RunsGenerator::__construct): Added.
1026 (RunsGenerator::add_runs): Added.
1027 (RunsGenerator::format_run): Moved.
1028 (RunsGenerator::parse_revisions_array): Moved.
1030 * public/v2/analysis.js:
1031 (App.TestGroup): Fixed a typo. The property on a test group that refers to an analysis task is "task".
1032 (App.TestGroup._fetchChartData): Added. Fetches all A/B testing results for this group.
1033 (App.BuildRequest.configLetter): Renamed from config since this returns a letter that identifies the
1034 configuration associated with this build request such as "A" and "B".
1035 (App.BuildRequest.statusLabel): Added the missing label for failed build requests.
1036 (App.BuildRequest.url): Added. Returns the URL associated with this build request.
1037 (App.BuildRequest._meanFetched): Added. Retrieve the mean and the build number for this request via
1041 (App.Pane._fetch): Set chartData directly here.
1042 (App.Pane._updateMovingAverageAndEnvelope): Renamed from _computeChartData. No longer sets chartData
1043 now that it's done in App.Pane._fetch.
1044 (App.AnalysisTaskController._fetchedRuns): Updated per createChartData merge.
1046 * public/v2/data.js:
1047 (Measurement.prototype.buildId): Added.
1048 (TimeSeries.prototype.findPointByBuild): Added.
1050 * public/v2/index.html: Fixed a bug that build status URL was broken. We can't use link-to helper since
1051 url is not an Ember routed path.
1053 * public/v2/manifest.js:
1054 (App.Manifest.fetchRunsWithPlatformAndMetric): Takes testGroupId as the third argument. Merged
1055 App.createChartData here so that App.BuildRequest can use the formatter
1057 2015-02-12 Ryosuke Niwa <rniwa@webkit.org>
1059 v2 UI should adjust the number of ticks on dashboards based on screen size
1060 https://bugs.webkit.org/show_bug.cgi?id=141502
1062 Reviewed by Chris Dumez.
1064 * public/v2/interactive-chart.js:
1065 (App.InteractiveChartComponent._updateDimensionsIfNeeded): Compute the number of ticks based on the
1068 2015-02-11 Ryosuke Niwa <rniwa@webkit.org>
1070 New perf dashboard shows too much space around interesting data points
1071 https://bugs.webkit.org/show_bug.cgi?id=141487
1073 Reviewed by Chris Dumez.
1075 Revise the y-axis range adjustment algorithm in r179913. Instead of showing the entire moving average,
1076 show the current time series excluding points in the series outside the moving average envelope.
1079 (App.Pane._computeChartData): Don't deal with missing moving average or enveloping strategy here.
1080 (App.Pane._computeMovingAverageAndOutliers): Set isOutliner to true on all data points in the current
1081 time series if the point lies outside the moving average envelope. Don't expose the moving average or
1082 the envelope computed for this purpose if they're not set by the user.
1084 * public/v2/data.js:
1085 (TimeSeries.prototype.minMaxForTimeRange): Takes a boolean argument, ignoreOutlier. When the flag is set
1086 to true, min/max computation will ignore any point in the series with non-falsy "isOutliner" property.
1088 * public/v2/interactive-chart.js:
1089 (App.InteractiveChartComponent._constructGraphIfPossible): Unsupport hideMovingAverage and hideEnvelope.
1090 (App.InteractiveChartComponent._computeYAxisDomain): Removed the commented out code. Also moved the code
1091 to deal with showFullYAxis here.
1092 (App.InteractiveChartComponent._minMaxForAllTimeSeries): Rewrote the code. Takes ignoreOutliners as an
1093 argument instead of directly inspecting showFullYAxis.
1095 2015-02-10 Ryosuke Niwa <rniwa@webkit.org>
1097 New perf dashboard shouldn't always show outliners
1098 https://bugs.webkit.org/show_bug.cgi?id=141445
1100 Reviewed by Chris Dumez.
1102 Use the simple moving average with an average difference envelope to compute the y-axis range to show
1103 to avoid expanding it spuriously to show one off outlier.
1106 (App.Pane): Don't show the full y-axis range by default.
1107 (App.Pane._computeChartData): Use the first strategies for the moving average and the enveloping if
1108 one is not specified by the user but without showing them in the charts.
1109 (App.Pane._computeMovingAverage): Takes moving average and enveloping strategies as arguments instead
1110 of retrieving via chosenMovingAverageStrategy and chosenEnvelopingStrategy.
1112 (App.ChartsController._parsePaneList): Added showFullYAxis as a query string argument to each pane.
1113 (App.ChartsController._serializePaneList): Ditto.
1115 * public/v2/chart-pane.css: Added a CSS rule for when y-axis is clickable.
1117 * public/v2/index.html: Pass in showFullYAxis as an argument to the main interactive chart.
1119 * public/v2/interactive-chart.js:
1120 (App.InteractiveChartComponent._constructGraphIfPossible): Add an event listener on y-axis labels when
1121 the chart is interactive so that toggle showFullYAxis. Also hide the moving average and/or the envelope
1122 if they are not specified by the user (i.e. only used to adjust y-axis range).
1123 (App.InteractiveChartComponent._updateDomain): Don't exit early if y-axis domains are different even if
1124 x-axis domain remained the same. Without this change, the charts would never redraw.
1125 (App.InteractiveChartComponent._minMaxForAllTimeSeries): Use the moving average instead of the current
1126 time series to compute the y-axis range if showFullYAxis is false. When showFullYAxis is true, expand
1127 y-axis all the way down to 0 or the minimum value in the current time series whichever is smaller.
1129 * public/v2/js/statistics.js:
1130 (Statistics.MovingAverageStrategies): Use a wider window in Simple Moving Average by default.
1132 2015-02-10 Ryosuke Niwa <rniwa@webkit.org>
1134 Unreviewed build fix.
1137 (set get App.Pane.Ember.Object.extend):
1139 2015-02-10 Ryosuke Niwa <rniwa@webkit.org>
1141 New perf dashboard should have the ability to overlay moving average with an envelope
1142 https://bugs.webkit.org/show_bug.cgi?id=141438
1144 Reviewed by Andreas Kling.
1146 This patch adds three kinds of moving average strategies and two kinds of enveloping strategies:
1148 Simple Moving Average - The moving average x̄_i of x_i is computed as the arithmetic mean of values
1149 from x_(i - n) though x_(i + m) where n is a non-negative integer and m is a positive integer. It takes
1150 n, backward window size, and m, forward window size, as an argument.
1152 Cumulative Moving Average - x̄_i is computed as the arithmetic mean of all values x_0 though x_i.
1153 That is, x̄_1 = x_1 and x̄_i = ((i - 1) * M_(i - 1) + x_i) / i for all i > 1.
1155 Exponential Moving Average - x̄_i is computed as the weighted average of x_i and x̄_(i - 1) with α as
1156 an argument specifying x_i's weight. To be precise, x̄_1 = x_1 and x̄_i = α * x_i + (α - 1) x̄_(i-1).
1159 Average Difference - The enveloping delta d is computed as the arithmetic mean of the difference
1160 between each x_i and x̄_i.
1162 Moving Average Standard Deviation - d is computed like the standard deviation except the deviation
1163 for each term is measured from the moving average instead of the sample arithmetic mean. i.e. it uses
1164 the average of (x_i - x̄_i)^2 as the "sample variance" instead of the conventional (x_i - x̄)^2 where
1165 x̄ is the sample mean of all x_i's. This change was necessary since our time series is non-stationary.
1168 Each strategy is cloned for an App.Pane instance so that its parameterList can be configured per pane.
1169 The configuration of the currently chosen strategies is saved in the query string for convenience.
1171 Also added the "stat pane" to choose a moving average strategy and a enveloping strategy in each pane.
1173 * public/v2/app.css: Specify the fill color for all SVG groups in the pane toolbar icons.
1176 (App.Pane._fetch): Delegate the creation of 'chartData' to _computeChartData.
1177 (App.Pane.updateStatisticsTools): Added. Clones moving average and enveloping strategies for this pane.
1178 (App.Pane._cloneStrategy): Added. Clones a strategy for a new pane.
1179 (App.Pane._configureStrategy): Added. Finds and configures a strategy from the configuration retrieved
1180 from the query string via ChartsController.
1181 (App.Pane._computeChartData): Added. Creates chartData from fetchedData.
1182 (App.Pane._computeMovingAverage): Added. Computes the moving average and the envelope.
1183 (App.Pane._executeStrategy): Added.
1184 (App.Pane._updateStrategyConfigIfNeeded): Pushes the strategy configurations to the query string via
1186 (App.ChartsController._parsePaneList): Merged the query string arguments for the range and point
1187 selections, and added two new arguments for the moving average and the enveloping configurations.
1188 (App.ChartsController._serializePaneList): Ditto.
1189 (App.ChartsController._scheduleQueryStringUpdate): Observes strategy configurations.
1190 (App.PaneController.actions.toggleBugsPane): Hides the stat pane.
1191 (App.PaneController.actions.toggleSearchPane): Hides the stat pane.
1192 (App.PaneController.actions.toggleStatPane): Added.
1194 * public/v2/chart-pane.css: Added CSS rules for the new stat pane. Also added .foreground class for the
1195 current (as opposed to baseline and target) time series for when it's the most foreground graph without
1196 moving average and its envelope overlapping on top of it.
1198 * public/v2/index.html: Added the templates for the stat pane and the corresponding icon (Σ).
1200 * public/v2/interactive-chart.js:
1201 (App.InteractiveChartComponent.chartDataDidChange): Unset _totalWidth and _totalHeight to avoid exiting
1202 early inside _updateDimensionsIfNeeded when chartData changes after the initial layout.
1203 (App.InteractiveChartComponent.didInsertElement): Attach event listeners here instead of inside
1204 _constructGraphIfPossible since that could be called multiple times on the same SVG element.
1205 (App.InteractiveChartComponent._constructGraphIfPossible): Clear down the old SVG element we created
1206 but don't bother removing individual paths and circles. Added the code to show the moving average time
1207 series when there is one. Also add "foreground" class on SVG elements for the current time series when
1208 we're not showing the moving average. chart-pane.css has been updated to "dim down" the current time
1209 series when "foreground" is not set.
1210 (App.InteractiveChartComponent._minMaxForAllTimeSeries): Take the moving average time series into
1211 account when computing the y-axis range.
1212 (App.InteractiveChartComponent._brushChanged): Removed 'selectionIsLocked' argument as it's useless.
1214 * public/v2/js/statistics.js:
1215 (Statistics.MovingAverageStrategies): Added.
1216 (Statistics.EnvelopingStrategies): Added.
1218 2015-02-06 Ryosuke Niwa <rniwa@webkit.org>
1220 The delta value in the chart pane sometimes doens't show '+' for a positive delta
1221 https://bugs.webkit.org/show_bug.cgi?id=141340
1223 Reviewed by Andreas Kling.
1225 The bug was caused by computeStatus prefixing the value delta with '+' if it's greater than 0 after
1226 it had already been formatted. Fixed the bug by using a formatter that always emits a sign symbol.
1229 (App.Pane.computeStatus):
1230 (App.createChartData):
1232 2015-02-06 Ryosuke Niwa <rniwa@webkit.org>
1234 Unreviewed build fix. currentPoint wasn't defined when selectedPoints was used to find points.
1237 (App.PaneController._updateDetails):
1239 2015-02-06 Ryosuke Niwa <rniwa@webkit.org>
1241 Unreviewed. Commit the forgotten change.
1243 * public/include/manifest.php:
1245 2015-02-06 Ryosuke Niwa <rniwa@webkit.org>
1247 New perf dashboard should have multiple dashboard pages
1248 https://bugs.webkit.org/show_bug.cgi?id=141339
1250 Reviewed by Chris Dumez.
1252 Added the support for multiple dashboard pages. Also added the status of the latest data point.
1253 e.g. "5% better than target"
1255 * public/v2/app.css: Tweaked the styles to work around the fact Ember.js creates empty script elements.
1256 Also hid the border lines around charts on the dashboard page for a cleaner look.
1259 (App.IndexRoute): Added. Navigate to /dashboard/<defaultDashboardName> once the manifest.json is loaded.
1260 (App.IndexRoute.beforeModel): Added.
1261 (App.DashboardRoute): Added.
1262 (App.DashboardRoute.model): Added. Return the dashboard specified by the name.
1263 (App.CustomDashboardRoute): Added. This route is used for a customized dashboard specified by "grid".
1264 (App.CustomDashboardRoute.model): Create a dashboard model from "grid" query parameter.
1265 (App.CustomDashboardRoute.renderTemplate): Use the dashboard template.
1266 (App.DashboardController): Renamed from App.IndexController.
1267 (App.DashboardController.modelChanged): Renamed from gridChanged. Removed the code to deal with "grid"
1268 and "defaultDashboard" as these are taken care of by newly added routers.
1269 (App.DashboardController.computeGrid): Renamed from updateGrid. No longer updates "grid" since this is
1270 now done in actions.toggleEditMode.
1271 (App.DashboardController.actions.toggleEditMode): Navigate to CustomDashboardRoute when start editing
1272 an existing dashboard.
1274 (App.Pane.computeStatus): Moved from App.PaneController so that to be called in App.Pane.latestStatus.
1275 Also moved the code to compute the delta with respect to the previous data point from _updateDetails.
1276 (App.Pane._relativeDifferentToLaterPointInTimeSeries): Ditto.
1277 (App.Pane.latestStatus): Added. Used by the dashboard template to show the status of the latest result.
1279 (App.createChartData): Added deltaFormatter to show less significant digits for differences.
1281 (App.PaneController._updateDetails): Updated per changes to computeStatus.
1283 * public/v2/chart-pane.css: Added style rules for the status labels on the dashboard.
1285 * public/v2/data.js:
1286 (TimeSeries.prototype.lastPoint): Added.
1288 * public/v2/index.html: Prefetch manifest.json as soon as possible, show the latest data points' status
1289 on the dashboard, and enumerate all predefined dashboards.
1291 * public/v2/interactive-chart.js:
1292 (App.InteractiveChartComponent._relayoutDataAndAxes): Slightly adjust the offset at which we show unit
1293 for the dashboard page.
1295 * public/v2/manifest.js:
1296 (App.Dashboard): Inherit from App.NameLabelModel now that each predefined dashboard has a name.
1297 (App.MetricSerializer.normalizePayload): Parse all predefined dashboards instead of a single dashboard.
1298 IDs are generated for each dashboard for forward compatibility.
1300 (App.Manifest.dashboardByName): Added.
1301 (App.Manifest.defaultDashboardName): Added.
1302 (App.Manifest._fetchedManifest): Create dashboard model objects for all predefined ones.
1304 2015-02-05 Ryosuke Niwa <rniwa@webkit.org>
1306 Move commits viewer to the end of details view
1307 https://bugs.webkit.org/show_bug.cgi?id=141315
1309 Rubber-stamped by Andreas Kling.
1311 Show the difference instead of the old value per kling's request.
1314 (App.PaneController._updateDetails):
1315 * public/v2/index.html:
1317 2015-02-05 Ryosuke Niwa <rniwa@webkit.org>
1319 Move commits viewer to the end of details view
1320 https://bugs.webkit.org/show_bug.cgi?id=141315
1322 Reviewed by Andreas Kling.
1324 Improved the way list of commits are shown per kling's request.
1327 (App.PaneController._updateDetails): Always show the old value even when a single point is selected.
1329 * public/v2/chart-pane.css: Updated the style for the commits viewer.
1331 * public/v2/commits-viewer.js:
1332 (App.CommitsViewerComponent): Added "visible" property to hide the list of commits.
1333 (App.CommitsViewerComponent.actions.toggleVisibility): Added. Toggles "visible" property.
1335 * public/v2/index.html: Updated the template for commits viewer to support "visible" property. Also
1336 moved the commits viewers out of the details tables so that they don't interleave revision data.
1338 2015-02-05 Ryosuke Niwa <rniwa@webkit.org>
1340 New perf dashboard should compare results to baseline and target
1341 https://bugs.webkit.org/show_bug.cgi?id=141286
1343 Reviewed by Chris Dumez.
1345 Compare the selected value against baseline and target values as done in v1. e.g. "5% below target"
1346 Also use d3.format to format the selected value to show four significant figures.
1349 (App.Pane.searchCommit):
1350 (App.Pane._fetch): Create time series here via createChartData so that _computeStatus can use them
1351 to compute the status text without having to recreate them.
1352 (App.createChartData): Added.
1353 (App.PaneController._updateDetails): Use 3d.format on current and old values.
1354 (App.PaneController._computeStatus): Added. Computes the status text.
1355 (App.PaneController._relativeDifferentToLaterPointInTimeSeries): Added.
1356 (App.AnalysisTaskController._fetchedManifest): Use createChartData as done in App.Pane._fetch. Also
1357 format the values using chartData.formatter.
1359 * public/v2/chart-pane.css: Enlarge the status text. Show the status text in red if it's worse than
1360 the baseline and in blue if it's better than the target.
1362 * public/v2/data.js:
1363 (TimeSeries.prototype.findPointAfterTime): Added.
1365 * public/v2/index.html: Added a new tbody for the status text and the selected value. Also fixed
1366 the bug that we were not showing the old value's unit.
1368 * public/v2/interactive-chart.js:
1369 (App.InteractiveChartComponent._constructGraphIfPossible): Use chartData.formatter. Also cleaned up
1370 the code to show the baseline and the target lines.
1372 * public/v2/manifest.js:
1373 (App.Manifest.fetchRunsWithPlatformAndMetric): Added smallerIsBetter.
1375 2015-02-05 Ryosuke Niwa <rniwa@webkit.org>
1377 Unreviewed build fix.
1380 (App.IndexController.gridChanged): Use store.createRecord to create a custom dashboard as required by Ember.js
1382 2015-02-04 Ryosuke Niwa <rniwa@webkit.org>
1384 New perf dashboard doesn't preserve the number of days when clicking on a dashboard chart
1385 https://bugs.webkit.org/show_bug.cgi?id=141280
1387 Reviewed by Chris Dumez.
1389 Fixed the bug by passing in "since" as a query parameter to the charts page.
1391 Also fixed the styling issue that manifests when a JSON fetching fails on "Dashboard" page.
1393 * public/v2/app.css: Fixed CSS rules for error messages shown in the place of charts.
1395 (App.IndexController): Changed the default number of days from one month to one week.
1396 (App.IndexController._sharedDomainChanged): Set "since" property on the controller.
1397 * public/v2/index.html: Pass in "since" property on the controller as a query parameter.
1399 2015-02-04 Ryosuke Niwa <rniwa@webkit.org>
1401 New perf dashboard erroneously clears zoom when poping history items
1402 https://bugs.webkit.org/show_bug.cgi?id=141278
1404 Reviewed by Chris Dumez.
1406 The bug was caused by _sharedZoomChanged updating overviewSelection without updating mainPlotDomain.
1408 Updating overviewSelection resulted in _overviewSelectionChanged, which observes changes to overviewSelection,
1409 to schedule a call to propagateZoom, which in turn overrode "sharedZoom" we just parsed from the query string.
1412 (App.PaneController._overviewSelectionChanged): Don't schedule propagateZoom if the selected domain is already
1413 shown in the main plot.
1414 (App.PaneController._sharedZoomChanged): Set both overviewSelection and mainPlotDomain to avoid overriding
1415 "sharedZoom" via propagateZoom inside _overviewSelectionChanged.
1417 2015-02-04 Ryosuke Niwa <rniwa@webkit.org>
1419 New perf dashboard shows null as the aggregator name if no aggregation is done
1420 https://bugs.webkit.org/show_bug.cgi?id=141256
1422 Reviewed by Chris Dumez.
1424 Don't show the aggregator name if there isn't one.
1426 * public/v2/manifest.js:
1429 2015-02-04 Ryosuke Niwa <rniwa@webkit.org>
1431 Unreviewed build fix after r179611.
1433 * public/v2/interactive-chart.js:
1435 2015-02-04 Ryosuke Niwa <rniwa@webkit.org>
1437 Perf dashboard doesn’t show the right unit for Safari UI tests
1438 https://bugs.webkit.org/show_bug.cgi?id=141238
1440 Reviewed by Darin Adler.
1442 Safari UI tests use custom metrics that end with "Time". This patch teaches the perf dashboard how to
1443 get the unit for a given metric based on the suffix of the metric name instead of hard-coding the mapping
1444 between metrics and their units.
1446 * public/js/helper-classes.js:
1447 (PerfTestRuns): Use the suffix of the metric name to compute the unit.
1448 * public/v2/manifest.js:
1449 (App.Manifest.fetchRunsWithPlatformAndMetric): Ditto. Also set "useSI" property iff for "bytes".
1450 * public/v2/interactive-chart.js:
1451 (App.InteractiveChartComponent._constructGraphIfPossible): Respect useSI. Use toPrecision(3) otherwise.
1452 (App.InteractiveChartComponent._relayoutDataAndAxes): Place the unit vertically on the left of ticks.
1454 2015-02-04 Ryosuke Niwa <rniwa@webkit.org>
1456 Interactive chart component provides two duplicate API for highlighting points
1457 https://bugs.webkit.org/show_bug.cgi?id=141234
1459 Reviewed by Chris Dumez.
1461 Prior to this patch, the interactive chart component supported highlightedItems for finding commits
1462 on the main charts page and markedPoints to show the two end points in the analysis task page.
1464 This patch merges markedPoints into highlightedItems.
1467 (App.AnalysisTaskController._fetchedRuns): Use highlightedItems.
1468 * public/v2/chart-pane.css:
1469 * public/v2/index.html: Ditto.
1470 * public/v2/interactive-chart.js:
1471 (App.InteractiveChartComponent._constructGraphIfPossible): Make this._highlights an array instead of
1472 array of arrays. Also call _highlightedItemsChanged at the end to fix the bug that we never highlight
1473 items if highlightedItems was set before the initial layout.
1474 (App.InteractiveChartComponent._relayoutDataAndAxes):
1475 (App.InteractiveChartComponent._updateHighlightPositions): Now that highlights are circles instead of
1476 vertical lines, just set cx and cy as done for other "dots".
1477 (App.InteractiveChartComponent._highlightedItemsChanged): Exit early only if _clippedContainer wasn't
1478 already set; i.e. _constructGraphIfPossible hasn't been called. Also updated the logic to accommodate
1479 the fact this._highlights is an array of elements instead of an array of arrays of elements. Finally,
1480 set the radius of highlight circles here.
1482 2015-02-03 Ryosuke Niwa <rniwa@webkit.org>
1484 Don’t use repository names as id’s.
1485 https://bugs.webkit.org/show_bug.cgi?id=141226
1487 Reviewed by Chris Dumez.
1489 Not using repository names as their id's reduces the need to fetch the entire repositories table.
1490 Since names of repositories are available in manifest.json, we can resolve their names in the front end.
1492 * Websites/perf.webkit.org/public/api/runs.php:
1493 (parse_revisions_array): No longer uses $repository_id_to_name.
1494 (main): No longer populates $repository_id_to_name.
1496 * Websites/perf.webkit.org/public/api/triggerables.php:
1497 (main): Don't resolve repository names.
1499 * Websites/perf.webkit.org/public/include/manifest.php:
1500 (ManifestGenerator::repositories): Use repositories ids as keys in the result and include their names.
1501 (ManifestGenerator::bug_trackers): Don't resolve repository names.
1503 * Websites/perf.webkit.org/public/js/helper-classes.js:
1504 (TestBuild): Renamed repositoryName to repositoryId.
1505 (TestBuild.revision): Ditto.
1506 (TestBuild.formattedRevisions): Ditto. Continue to use the repository name in the formatted result
1507 since this is the text shown to human.
1509 * Websites/perf.webkit.org/public/v2/app.js:
1510 (App.pane.searchCommit): Renamed repositoryName to repositoryId.
1511 (App.PaneController._updateDetails): Ditto.
1512 (App.AnalysisTaskController.updateRoots): Ditto.
1514 * Websites/perf.webkit.org/public/v2/data.js:
1515 (Measurement): Ditto.
1516 (Measurement.prototype.commitTimeForRepository): Ditto.
1517 (Measurement.prototype.formattedRevisions): Ditto.
1519 * Websites/perf.webkit.org/public/v2/index.html: Use the repository name and the repository id as
1520 select element's label and value respectively.
1522 2015-02-03 Ryosuke Niwa <rniwa@webkit.org>
1524 Unreviewed build fix. Declare $repository_id_to_name in the global scope.
1526 * public/api/runs.php:
1528 2015-02-03 Ryosuke Niwa <rniwa@webkit.org>
1530 /api/runs.php should have main function
1531 https://bugs.webkit.org/show_bug.cgi?id=141220
1533 Reviewed by Benjamin Poulain.
1535 Wrapped the code inside main function for clarity.
1537 * public/api/runs.php:
1539 2015-01-27 Ryosuke Niwa <rniwa@webkit.org>
1541 Unreviewed build fix. "eta" isn't set on a in-progress build on a newly added builder.
1543 * tools/sync-with-buildbot.py:
1544 (find_request_updates):
1546 2015-01-23 Ryosuke Niwa <rniwa@webkit.org>
1548 Perf dashboard always assigns the result of A/B testing with build request 1
1549 https://bugs.webkit.org/show_bug.cgi?id=140382
1551 Reviewed by Darin Adler.
1553 The bug was caused by the expression array_get($report, 'jobId') or array_get($report, 'buildRequest')
1554 which always evaluated to 1 when the report contained jobId. Fixed the bug by cascading array_get instead.
1556 Also fixed a typo as well as a bug that reports were never associated with builds.
1558 * public/include/report-processor.php:
1559 (ReportProcessor::process): Don't use "or" to find the non-null value since that always evaluates to 1
1560 instead of the first non-null value.
1561 (ReportProcessor::resolve_build_id): Fixed the typo by adding the missing "$this->".
1562 (ReportProcessor::commit): Associate the report with the corresponding build as intended.
1564 2015-01-23 Ryosuke Niwa <rniwa@webkit.org>
1566 Unreviewed typo fix. The prefix in triggerable_configurations is "trigconfig", not "trigrepo".
1568 * public/admin/tests.php:
1570 2015-01-10 Ryosuke Niwa <rniwa@webkit.org>
1572 Unreviewed build fix. Removed the stale code.
1574 * public/admin/triggerables.php:
1576 2015-01-09 Ryosuke Niwa <rniwa@webkit.org>
1578 Perf dashboard should have the ability to post A/B testing builds
1579 https://bugs.webkit.org/show_bug.cgi?id=140317
1581 Rubber-stamped by Simon Fraser.
1583 This patch adds the support for triggering A/B testing from the perf dashboard.
1585 We add a few new tables to the database. "build_triggerables", which represents a set of builders
1586 that accept A/B testing. "triggerable_repositories" associates each "triggerable" with a fixed set
1587 of repositories for which an arbitrary revision can be specified for A/B testing.
1588 "triggerable_configurations" specifies a triggerable available on a given test on a given platform.
1589 "roots" table which specifies the revision used in a given root set in each repository.
1591 * init-database.sql: Added "build_triggerables", "triggerable_repositories",
1592 "triggerable_configurations", and "roots" tables. Added references to "build_triggerables",
1593 "platforms", and "tests" tables as well as columns to store status, status url, and creation time
1594 to build_requests table. Also made each test group's name unique in a given analysis task as it
1595 would be confusing to have multiple test groups of the same name.
1597 * public/admin/tests.php: Added the UI and the code to associate a test with a triggerable.
1599 * public/admin/triggerables.php: Added. Manages the list of triggerables as well as repositories
1600 for which a specific revision can be set in an A/B testing on a given triggerable.
1602 * public/api/build-requests.php: Added. Returns the list of open build requests on a specified
1603 triggerable. Also updates the status' and the status urls of specified build requests when
1604 buildRequestUpdates is provided in the raw POST data.
1607 * public/api/runs.php:
1608 (fetch_runs_for_config): Don't include results associated with a build request, meaning they are
1609 results of an A/B testing.
1611 * public/api/test-groups.php:
1612 (main): Use the newly added BuildRequestsFetcher. Also merged fetch_test_groups_for_task back.
1614 * public/api/triggerables.php: Added.
1615 (main): Returns a list of triggerables or a triggerable associated with a given analysis task.
1617 * public/include/admin-header.php:
1619 * public/include/build-requests-fetcher.php: Added. Extracted from public/api/test-groups.php.
1620 (BuildRequestsFetcher): This class abstracts the process of fetching a list of builds requests
1621 and root sets used in those requests.D
1622 (BuildRequestsFetcher::__construct):
1623 (BuildRequestsFetcher::fetch_for_task):
1624 (BuildRequestsFetcher::fetch_for_group):
1625 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable):
1626 (BuildRequestsFetcher::has_results):
1627 (BuildRequestsFetcher::results):
1628 (BuildRequestsFetcher::results_with_resolved_ids):
1629 (BuildRequestsFetcher::results_internal):
1630 (BuildRequestsFetcher::root_sets):
1631 (BuildRequestsFetcher::fetch_roots_for_set):
1633 * public/include/db.php:
1634 (Database::prefixed_column_names): Don't return "$prefix_" when there are no columns.
1635 (Database::insert_row): Support taking an empty array for values. This is useful in "root_sets"
1636 table since it only has the primary key, id, column.
1637 (Database::select_or_insert_row):
1638 (Database::update_or_insert_row):
1639 (Database::update_row): Added.
1640 (Database::_select_update_or_insert_row): Takes an extra argument specifying whether a new row
1641 should be inserted when no row matches the specified criteria. This is used while updating
1642 build_requests' status and url in public/api/build-requests.php since we shouldn't be inserting
1643 new build requests in that API.
1644 (Database::select_rows): Also use "1 == 1" in the select query when the query criteria is empty.
1645 This is used in public/api/triggerables.php when no analysis task is specified.
1647 * public/include/json-header.php:
1648 (find_triggerable_for_task): Added. Finds a triggerable available on a given test. We return the
1649 triggerable associated with the closest ancestor of the test. Since issuing a new query for each
1650 ancestor test is expensive, we retrieve triggerable for all ancestor tests at once and manually
1651 find the closest ancestor with a triggerable.
1653 * public/include/report-processor.php:
1654 (ReportProcessor::process):
1655 (ReportProcessor::resolve_build_id): Associate a build request with the newly created build
1656 if jobId or buildRequest is specified.
1658 * public/include/test-name-resolver.php:
1659 (TestNameResolver::map_metrics_to_tests): Store the entire metric row instead of its name so that
1660 test_exists_on_platform can use it. The last diff in public/admin/tests.php adopts this change.
1661 (TestNameResolver::test_exists_on_platform): Added. Returns true iff the test has ever run on
1664 * public/include/test-path-resolver.php: Added.
1665 (TestPathResolver): This class abstracts the ancestor chains of a test. It retrieves the entire
1666 "tests" table to do this since there could be arbitrary number of ancestors for a given test.
1667 This class is a lot more lightweight than TestNameResolver, which retrieves a whole bunch of tables
1668 in order to compute full test metric names.
1669 (TestPathResolver::__construct):
1670 (TestPathResolver::ancestors_for_test): Returns the ordered list of ancestors from the closest to
1671 the highest (a test without a parent).
1672 (TestPathResolver::path_for_test): Returns a test "path", the ordered list of test names from
1673 the highest ancestor to the test itself.
1674 (TestPathResolver::ensure_id_to_test_map): Fetches "tests" table to construct id_to_test_map.
1676 * public/privileged-api/create-test-group.php: Added. An API to create A/B testing groups.
1678 (commit_sets_from_root_sets): Given a dictionary of repository names to a pair of revisions
1679 for sets A and B respectively, returns a pair of arrays, each of which contains the corresponding
1680 set of "commits" for sets A and B respectively. e.g. {"WebKit": [1, 2], "Safari": [3, 4]} will
1681 result in [[WebKit commit at r1, Safari commit at r3], [WebKit commit at r2, Safari commit at r4]].
1683 * public/v2/analysis.js:
1684 (App.AnalysisTask.testGroups): Takes arguments so that set('testGroups') will invalidate the cache.
1685 (App.AnalysisTask.triggerable): Added. Retrieves the triggerable associated with the task lazily.
1686 (App.TestGroup.rootSets): Added. Returns the list of root set ids used in this A/B testing group.
1687 (App.TestGroup.create): Added. Creates a new A/B testing group.
1688 (App.Triggerable): Added.
1689 (App.TriggerableAdapter): Added.
1690 (App.TriggerableAdapter.buildURL): Added.
1691 (App.BuildRequest.testGroup): Renamed from group.
1692 (App.BuildRequest.orderLabel): Added. One-based index to be used in labels.
1693 (App.BuildRequest.config): Added. Returns either 'A' or 'B' depending on the configuration used
1694 in this build request.
1695 (App.BuildRequest.status): Added.
1696 (App.BuildRequest.statusLabel): Added. Returns a human friendly label for the current status.
1697 (App.BuildRequest): Removed buildNumber, buildBuilder, as well as buildTime as they're unused.
1700 (App.AnalysisTaskController.testGroups): Added.
1701 (App.AnalysisTaskController.possibleRepetitionCounts): Added.
1702 (App.AnalysisTaskController.updateRoots): Renamed from roots. This is also no longer a property
1703 but an observer that updates "roots" property. Filter out the repositories that are not accepted
1704 by the associated triggerable as they will be ignored.
1705 (App.AnalysisTaskController.actions.createTestGroup): Added.
1707 * public/v2/index.html: Updated the UI, and added a form element to trigger createTestGroup action.
1709 * tools/sync-with-buildbot.py: Added. This scripts posts new builds on buildbot and reports back
1710 the status of those builds to the perf dashboard. A similar script can be written to support
1711 other continuous builds systems.
1712 (main): Fetches the list of pending builds as well as currently running or completed builds from
1713 a buildbot, and report new statuses of builds requests to the perf dashboard. It will then schedule
1714 a single new build on each builder with no pending builds, and marks the set of open build requests
1715 that have been scheduled to run on the buildbot but not found in the first step as stale.
1716 (load_config): Loads a JSON that contains the configurations for each builder. e.g.
1719 "platform": "mac-mavericks",
1720 "test": ["Parser", "html5-full-render.html"],
1721 "builder": "Trunk Syrah Production Perf AB Tests",
1723 "forcescheduler": "force-mac-mavericks-release-perf",
1724 "webkit_revision": "$WebKit",
1725 "jobid": "$buildRequest"
1730 (find_request_updates): Return a list of build request status updates to make based on the pending
1731 builds as well as in-progress and completed builds on each builder on the buildbot. When a build is
1732 completed, we use the special status "failedIfNotCompleted" which results in "failed" status only
1733 if the build request had not been completed. This is necessary because a failed build will not
1734 report its failed-ness back to the perf dashboard in some cases; e.g. lost slave or svn up failure.
1735 (update_and_fetch_build_requests): Submit the build request status updates and retrieve the list
1736 of open requests the perf dashboard has.
1737 (find_stale_request_updates): Compute the list of build requests that have been scheduled on the
1738 buildbot but not found in find_request_updates. These build requests are lost. e.g. a master reboot
1739 or human canceling a build may trigger such a state.
1740 (schedule_request): Schedules a build with the arguments specified in the configuration JSON after
1741 replacing repository names with their revisions and buildRequest with the build request id.
1742 (config_for_request): Finds a builder for the test and the platform of a build request.
1743 (fetch_json): Fetches a JSON from the specified URL, optionally with BasicAuth.
1744 (property_value_from_build): Returns the value of a specific property in a buildbot build.
1745 (request_id_from_build): Returns the build request id of a given buildbot build if there is one.
1747 2015-01-09 Ryosuke Niwa <rniwa@webkit.org>
1749 Cache-control should be set only on api/runs
1750 https://bugs.webkit.org/show_bug.cgi?id=140312
1752 Reviewed by Andreas Kling.
1754 Some JSON APIs such as api/analysis-tasks can't be cached even for a short period of time (e.g. a few minutes)
1755 since they can be modified by the user on demand. Since only api/runs.php takes a long time to generate JSONs,
1756 just set cache-control there instead of json-header.php which is used by other JSON APIs.
1758 Also set date_default_timezone_set in db.php since we never use non-UTC timezone in our scripts.
1760 * public/api/analysis-tasks.php:
1761 * public/api/runs.php: Set the cache control headers.
1762 * public/api/test-groups.php:
1763 * public/include/db.php: Set the default timezone to UTC.
1764 * public/include/json-header.php: Don't set the cache control headers.
1766 2015-01-09 Ryosuke Niwa <rniwa@webkit.org>
1768 api/report-commit should authenticate with a slave name and password
1769 https://bugs.webkit.org/show_bug.cgi?id=140308
1771 Reviewed by Benjamin Poulain.
1773 Use a slave name and a password to authenticate new commit reports.
1775 * public/api/report-commits.php:
1777 * public/include/json-header.php:
1778 (verify_slave): Renamed and repurposed from verify_builder in report-commits.php. Now authenticates with
1779 a slave name and a password instead of a builder name and a password.
1780 * tests/api-report-commits.js: Updated tests.
1781 * tools/pull-svn.py:
1782 (main): Renamed variables.
1783 (submit_commits): Submits slaveName and slavePassword instead of builderName and builderPassword.
1785 2014-12-19 Ryosuke Niwa <rniwa@webkit.org>
1787 Perf dashboard should support authentication via a slave password
1788 https://bugs.webkit.org/show_bug.cgi?id=139837
1790 Reviewed by Andreas Kling.
1792 For historical reasons, perf dashboard conflated builders and build slaves. As a result we ended up
1793 having to add multiple builders with the same password when a single build slave is shared among them.
1795 This patch introduces the concept of build_slave into the perf dashboard to end this madness.
1797 * init-database.sql: Added build_slave table as well as references to it in builds and reports.
1799 * public/admin/build-slaves.php: Added.
1801 * public/admin/builders.php: Added the support for updating passwords.
1803 * public/include/admin-header.php:
1804 (update_field): Takes an extra argument when a new value needs to be supplied by the caller instead of
1805 being retrieved from $_POST.
1806 (AdministrativePage::render_table): Use array_get to retrieve a value out of the database row since
1807 the raw may not exist (e.g. new_password).
1808 (AdministrativePage::render_form_to_add): Added the support for post_insertion. Don't render the form
1809 control here when this flag evaluates to TRUE.
1811 * public/include/report-processor.php:
1812 (ReportProcessor::process): Added the logic to authenticate with slaveName and slavePassword if those
1813 values are present in the report. In addition, try authenticating builderName with slavePassword if
1814 builderPassword is not specified. When neither password is specified, exit with BuilderNotFound.
1815 Also insert the slave or the builder whichever is missing after we've successfully authenticated.
1816 (ReportProcessor::construct_build_data): Takes a builder ID and an optional slave ID instead of
1818 (ReportProcessor::store_report): Store the slave ID with the report.
1819 (ReportProcessor::resolve_build_id): Exit with MismatchingBuildSlave when the slave associated with
1820 the matching build is different from what's being reported.
1822 * tests/api-report.js: Added a bunch of tests to test the new features of /api/report.
1825 2014-12-18 Ryosuke Niwa <rniwa@webkit.org>
1827 New perf dashboard should not duplicate author information in each commit
1828 https://bugs.webkit.org/show_bug.cgi?id=139756
1830 Reviewed by Darin Adler.
1832 Instead of each commit having author name and email, make it reference a newly added committers table.
1833 Also replace "email" by "account" since some repositories don't use emails as account names.
1835 This improves the keyword search performance in commits.php since LIKE now runs on committers table,
1836 which only contains as many rows as there are accounts in each repository, instead of commits table
1837 which contains every commit ever happened in each repository.
1839 To migrate an existing database into match the new schema, run:
1843 INSERT INTO committers (committer_repository, committer_name, committer_email)
1844 (SELECT DISTINCT commit_repository, commit_author_name, commit_author_email
1845 FROM commits WHERE commit_author_email IS NOT NULL);
1847 ALTER TABLE commits ADD COLUMN commit_committer integer REFERENCES committers ON DELETE CASCADE;
1849 UPDATE commits SET commit_committer = committer_id FROM committers
1850 WHERE commit_repository = committer_repository AND commit_author_email = committer_email;
1852 ALTER TABLE commits DROP COLUMN commit_author_name CASCADE;
1853 ALTER TABLE commits DROP COLUMN commit_author_email CASCADE;
1857 * init-database.sql: Added committers table, and replaced author columns in commits table by a foreign
1858 reference to committers. Also added the missing drop table statements.
1860 * public/api/commits.php:
1861 (main): Fetch the corresponding committers row for a single commit. Also wrap a single commit by
1862 an array here instead of doing it in format_commit.
1863 (fetch_commits_between): Updated queries to JOIN commits with committers.
1864 (format_commit): Takes both commit and committers rows. Also don't wrap the result in an array as that
1865 is now done in main.
1867 * public/api/report-commits.php:
1868 (main): Store the reported committer information or update the existing entry if there is one.
1870 * tests/admin-regenerate-manifest.js: Fixed tests.
1872 * tests/api-report-commits.js: Ditto. Also added a test for updating an existing committer entry.
1874 * tools/pull-svn.py: Renamed email to account.
1876 (fetch_commit_and_resolve_author):
1878 (resolve_author_name_from_account):
1879 (resolve_author_name_from_email): Deleted.
1881 2014-12-17 Ryosuke Niwa <rniwa@webkit.org>
1883 Unreviewed build fix.
1885 * public/v2/index.html: Include js files we extracted in r177424.
1887 2014-12-16 Ryosuke Niwa <rniwa@webkit.org>
1889 Unreviewed. Adding the forgotten svnprop.
1891 * tools/pull-svn.py: Added property svn:executable.
1893 2014-12-16 Ryosuke Niwa <rniwa@webkit.org>
1895 Split InteractiveChartComponent and CommitsViewerComponent into separate files
1896 https://bugs.webkit.org/show_bug.cgi?id=139716
1898 Rubber-stamped by Benjamin Poulain.
1900 Refactored InteractiveChartComponent and CommitsViewerComponent out of app.js into commits-viewer.js
1901 and interactive-chart.js respectively since app.js has gotten really large.
1904 * public/v2/commits-viewer.js: Added.
1905 * public/v2/interactive-chart.js: Added.
1907 2014-12-02 Ryosuke Niwa <rniwa@webkit.org>
1909 New perf dashboard's chart UI is buggy
1910 https://bugs.webkit.org/show_bug.cgi?id=139214
1912 Reviewed by Chris Dumez.
1914 The bugginess was caused by weird interactions between charts and panes. Rewrote the code to fix it.
1916 Superfluous selectionChanged and domainChanged "event" actions were removed from the interactive chart
1917 component. This is not how Ember.js components should interact to begin with. The component now exposes
1918 selectedPoints and always updates selection instead of sharedSelection.
1921 (App.ChartsController.present): Added. We can't call Date.now() in various points in our code as that
1922 would lead to infinite mutual recursions since X-axis domain values wouldn't match up.
1923 (App.ChartsController.updateSharedDomain): This function was completely useless. The overview's start
1924 and end time should be completely determined by "since" and the present time.
1925 (App.ChartsController._startTimeChanged): Ditto.
1926 (App.ChartsController._scheduleQueryStringUpdate):
1927 (App.ChartsController._updateQueryString): Set "zoom" only if it's different from the shared domain.
1929 (App.domainsAreEqual): Moved from InteractiveChartComponent._xDomainsAreSame.
1931 (App.PaneController.actions.createAnalysisTask): Use selectedPoints property set by the chart.
1932 (App.PaneController.actions.overviewDomainChanged): Removed; only needed to call updateSharedDomain.
1933 (App.PaneController.actions.rangeChanged): Removed. _showDetails (renamed to _updateDetails) directly
1934 observes the changes to selectedPoints property as it gets updated by the main chart.
1935 (App.PaneController._overviewSelectionChanged): This was previously a dead code. Now it's used again
1936 with a bug fix. When the overview selection is cleared, we use the same domain in the main chart and
1938 (App.PaneController._sharedDomainChanged): Fixed a but that it erroneously updates the overview domain
1939 when domain arrays aren't identical. This was causing a subtle race with other logic.
1940 (App.PaneController._sharedZoomChanged): Ditto. Also don't set mainPlotDomain here as any changes to
1941 overviewSelection will automatically propagate to the main plot's domain as they're aliased.
1942 (App.PaneController._currentItemChanged): Merged into _updateDetails (renamed from _showDetails).
1943 (App.PaneController._updateDetails): Previously, this function took points and inspected _hasRange to
1944 see if those two points correspond to a range or a single data point. Rewrote all that logic by
1945 directly observing selectedPoints and currentItem properties instead of taking points and relying on
1946 an instance variable, which was a terrible API.
1947 (App.PaneController._updateCanAnalyze): Use selectedPoints property. Since this property is only set
1948 when the main plot has a selected range, we don't have to check this._hasRange anymore.
1950 (App.InteractiveChartComponent._updateDomain): No longer sends domainChanged "event" action.
1951 (App.InteractiveChartComponent._sharedSelectionChanged): Removed. This is a dead code.
1952 (App.InteractiveChartComponent._updateSelection):
1953 (App.InteractiveChartComponent._xDomainsAreSame): Moved to App.domainsAreEqual.
1954 (App.InteractiveChartComponent._setCurrentSelection): Update the selection only if needed. Also set
1955 selectedPoints property.
1957 (App.AnalysisTaskController._fetchedRuns):
1958 (App.AnalysisTaskController._rootChangedForTestSet):
1960 * public/v2/index.html:
1961 Removed non-functional sharedSelection and superfluous selectionChanged and domainChanged actions.
1963 2014-11-21 Ryosuke Niwa <rniwa@webkit.org>
1965 Unreviewed. Fixed syntax errors.
1967 * init-database.sql:
1968 * public/api/commits.php:
1970 2014-11-21 Ryosuke Niwa <rniwa@webkit.org>
1972 The dashboard on new perf monitor should be configurable
1973 https://bugs.webkit.org/show_bug.cgi?id=138994
1975 Reviewed by Benjamin Poulain.
1977 For now, make it configurable via config.json. We should eventually make it configurable via
1978 an administrative page but this will do for now.
1980 * config.json: Added the empty dashboard configuration.
1982 * public/include/manifest.php: Include the dashboard configuration in the manifest file.
1985 (App.IndexController): Removed defaultTable since this is now dynamically obtained via App.Manifest.
1986 (App.IndexController.gridChanged): Use App.Dashboard to parse the dashboard configuration.
1987 Also obtain the default configuration from App.Manifest.
1988 (App.IndexController._normalizeTable): Moved to App.Dashboard.
1990 * public/v2/manifest.js:
1991 (App.Repository.urlForRevision): Fixed the position of the open curly bracket.
1992 (App.Repository.urlForRevisionRange): Ditto.
1993 (App.Dashboard): Added.
1994 (App.Dashboard.table): Extracted from App.IndexController.gridChanged.
1995 (App.Dashboard.rows): Ditto.
1996 (App.Dashboard.headerColumns): Ditto.
1997 (App.Dashboard._normalizeTable): Moved from App.IndexController._normalizeTable.
1998 (App.MetricSerializer.normalizePayload): Synthesize a dashboard record from the configuration.
1999 Since there is exactly one dashboard object per app, it's okay to hard code an id here.
2000 (App.Manifest._fetchedManifest): Set defaultDashboard to the one and only one dashboard we have.
2002 2014-11-21 Ryosuke Niwa <rniwa@webkit.org>
2004 There should be a way to associate bugs with analysis tasks
2005 https://bugs.webkit.org/show_bug.cgi?id=138977
2007 Reviewed by Benjamin Poulain.
2009 Updated associate-bug.php to match the new database schema.
2011 * public/include/json-header.php:
2012 (require_format): Removed the call to camel_case_words_separated_by_underscore since the name is
2013 already camel-cased in require_existence_of. This makes the function usable elsewhere.
2015 * public/privileged-api/associate-bug.php:
2016 (main): Changed the API to take run, bugTracker, and number to match the new database schema.
2017 Also verify that those values are integers using require_format.
2019 * public/v2/analysis.js:
2020 (App.AnalysisTask.label): Added. Concatenates the task's name with the bug numbers.
2021 (App.Bug.label): Added.
2022 (App.BugAdapter): Added.
2023 (App.BugAdapter.createRecord): Use PrivilegedAPI instead of the builtin ajax call.
2024 (App.BuildRequest): Inherit from newly added App.Model, which is set to DS.Model right now.
2026 * public/v2/app.css: Renamed .test-groups to .analysis-group. Also added new rules for the table
2027 containing the bug information.
2030 (App.InteractiveChartComponent._rangesChanged): Added label to range bar objects.
2031 (App.AnalysisTaskRoute):
2032 (App.AnalysisTaskController): Replaced the functionality of App.AnalysisTaskViewModel.
2033 (App.AnalysisTaskController._fetchedManifest): Added.
2034 (App.AnalysisTaskController.actions.associateBug): Added.
2036 * public/v2/chart-pane.css: Renamed .bugs-pane to .analysis-pane.
2038 * public/v2/data.js:
2039 (Measurement.prototype.associateBug): Deleted.
2041 * public/v2/index.html: Renamed .bugs-pane to .analysis-pane and .test-groups to .analysis-group.
2042 Added a table show the bug information. Also hide the chart until chartData is available.
2044 * public/v2/manifest.js:
2047 2014-11-20 Ryosuke Niwa <rniwa@webkit.org>
2049 Fix misc bugs and typos in app.js
2050 https://bugs.webkit.org/show_bug.cgi?id=138946
2052 Reviewed by Benjamin Poulain.
2055 (App.DashboardPaneProxyForPicker._platformOrMetricIdChanged):
2056 (App.ChartsController.init):
2057 (App.buildPopup): Renamed from App.BuildPopup.
2058 (App.InteractiveChartComponent._constructGraphIfPossible): Fixed the bug that we were calling
2059 remove() on the wrong object (an array as opposed to elements in the array).
2060 (App.InteractiveChartComponent._highlightedItemsChanged): Check the length of _highlights as
2061 _highlights is always an array and evalutes to true.
2063 2014-11-20 Ryosuke Niwa <rniwa@webkit.org>
2065 New perf dashboard should provide UI to create a new analysis task
2066 https://bugs.webkit.org/show_bug.cgi?id=138910
2068 Reviewed by Benjamin Poulain.
2070 This patch reverts some parts of r175006 and re-introduces bugs associated with analysis tasks.
2071 I'll add UI to show and edit bug numbers associated with an analysis task in a follow up patch.
2073 With this patch, we can create a new analysis task by selection a range of points and opening
2074 "analysis pane" (renamed from "bugs pane"). Each analysis task created is represented by a yellow bar
2075 in the chart hyperlinked to the analysis task.
2077 * init-database.sql: Redefined the bugs to be associated with an analysis task instead of a test run.
2079 * public/api/analysis-tasks.php: Added the support for querying analysis tasks for a specific metric
2080 on a specific platform. Also retrieve and return all bugs associated with analysis tasks.
2082 (fetch_and_push_bugs_to_tasks): Added. Fetches all bugs associated with an array of analysis tasks
2083 and adds the associated bugs to each task in the array.
2086 * public/api/runs.php: Reverted changes made in r175006.
2087 (fetch_runs_for_config):
2090 * public/api/test-groups.php:
2091 (fetch_test_groups_for_task): Use the newly added Database::select_rows.
2093 * public/include/db.php:
2094 (Database::select_first_or_last_row):
2095 (Database::select_rows): Extracted from select_first_or_last_row.
2097 * public/v2/analysis.js:
2098 (App.AnalysisTask): Added "bugs" property.
2099 (App.Bug): Added now that bugs are regular data store objects.
2102 (App.Pane._fetch): Calls this.fetchAnalyticRanges to fetch analysis tasks as well as test runs.
2103 (App.Pane.fetchAnalyticRanges): Added. Fetches analysis tasks for the current metric on the current
2104 platform that are associated with a specific range of runs.
2105 (App.PaneController.actions.toggleBugsPane): Updated per showingBugsPane to showingAnalysisPane rename.
2106 (App.PaneController.actions.associateBug): Deleted.
2107 (App.PaneController.actions.createAnalysisTask): Replaced the pre-condition checks with assertions as
2108 this action should never be triggered when the pre-condition is not met. Also re-fetch analysis tasks
2109 once we've created one.
2110 (App.PaneController.toggleSearchPane): Updated per showingBugsPane to showingAnalysisPane rename.
2111 (App.PaneController._detailsChanged): Ditto. Removed selectedSinglePoint since it's no longer used.
2112 (App.PaneController._showDetails): Call _updateCanAnalyze to update the status of "Analyze" button.
2113 (App.PaneController._updateBugs): Deleted.
2114 (App.PaneController._updateMarkedPoints): Deleted.
2115 (App.PaneController._updateCanAnalyze): Added. Disables the button to create an analysis task when
2116 the name is missing or when at most one point is selected.
2118 (App.InteractiveChartComponent._constructGraphIfPossible): Update the locations of range rects.
2119 (App.InteractiveChartComponent._relayoutDataAndAxes): Ditto.
2120 (App.InteractiveChartComponent._mousePointInGraph): Don't return a point unless the mouse cursor is
2121 on our svg element to avoid locking the current item when a bar shown for an analysis task is clicked.
2122 (App.InteractiveChartComponent._rangesChanged): Added. Creates an array of objects representing
2123 clickable bars for analysis tasks.
2124 (App.InteractiveChartComponent._updateRangeBarRects): Computes the inline style used by each clickable
2125 bar for analysis tasks to place them at the right location.
2126 (App.InteractiveChartComponent.actions.openRange): Added. Forwards the action to the parent controller.
2128 * public/v2/chart-pane.css:
2129 (.chart .extent): Use the same color as the vertical indicator in the highlight behind the selection.
2130 (.chart .rangeBar): Added.
2132 * public/v2/data.js:
2133 (TimeSeries.prototype.nextPoint): Added. Used by _rangesChanged.
2135 * public/v2/index.html: Renamed "bugs pane" to "analysis pane" and removed the UI to associate bugs.
2136 This ability will be reinstated in a follow up patch. Also added a container div and spans for analysis
2137 task bars in the interactive chart component.
2139 2014-11-19 Ryosuke Niwa <rniwa@webkit.org>
2141 Fix typos in r176203.
2144 (App.ChartsController.actions.addPaneByMetricAndPlatform):
2145 (App.AnalysisTaskRoute):
2147 2014-11-18 Ryosuke Niwa <rniwa@webkit.org>
2149 Unreviewed. Updated the install instruction.
2153 2014-11-17 Ryosuke Niwa <rniwa@webkit.org>
2155 App.Manifest shouldn't use App.__container__.lookup
2156 https://bugs.webkit.org/show_bug.cgi?id=138768
2158 Reviewed by Andreas Kling.
2160 Removed the hack to find the store object via App.__container__.lookup.
2161 Pass around the store object instead.
2164 (App.DashboardRow._createPane): Add "store" property to the pane.
2165 (App.DashboardPaneProxyForPicker._platformOrMetricIdChanged): Ditto.
2166 (App.IndexController.gridChanged): Ditto.
2167 (App.IndexController.actions.addRow): Ditto.
2168 (App.IndexController.init): Ditto.
2169 (App.Pane._fetch): Ditto.
2170 (App.ChartsController._parsePaneList): Ditto.
2171 (App.ChartsController._updateQueryString): Ditto.
2172 (App.ChartsController.actions.addPaneByMetricAndPlatform): Ditto.
2173 (App.BuildPopup): Ditto.
2174 (App.AnalysisTaskRoute.model): Ditto.
2175 (App.AnalysisTaskViewModel._taskUpdated): Ditto.
2177 * public/v2/manifest.js:
2178 (App.Manifest.fetch): Removed the code to find the store object.
2180 2014-11-08 Ryosuke Niwa <rniwa@webkit.org>
2182 Fix Ember.js warnings the new perf dashboard
2183 https://bugs.webkit.org/show_bug.cgi?id=138531
2185 Reviewed by Darin Adler.
2187 Fixed various warnings.
2190 (App.InteractiveChartComponent._relayoutDataAndAxes): We can't use "rem". Use this._rem as done for x.
2191 * public/v2/data.js:
2192 (PrivilegedAPI._post): Removed the superfluous console.log.
2193 (CommitLogs.fetchForTimeRange): Ditto.
2194 * public/v2/index.html: Added tbody as required by the HTML specification.
2196 2014-11-07 Ryosuke Niwa <rniwa@webkit.org>
2198 Fix typos in r175768.
2201 (App.AnalysisTaskViewModel.roots):
2203 2014-11-07 Ryosuke Niwa <rniwa@webkit.org>
2205 Introduce the concept of analysis task to perf dashboard
2206 https://bugs.webkit.org/show_bug.cgi?id=138517
2208 Reviewed by Andreas Kling.
2210 Introduced the concept of an analysis task, which is created for a range of measurements for a given metric on
2211 a single platform and used to bisect regressions in the range.
2213 Added a new page to see the list of active analysis tasks and a page to view the contents of an analysis task.
2215 * init-database.sql: Added a bunch of tables to store information about analysis tasks.
2216 analysis_tasks - Represents each analysis task. Associated with a platform and a metric and possibly with two
2217 test runs. Analysis tasks not associated with test runs are used for try new patches.
2218 analysis_test_groups - A test group in an analysis task represents a bunch of related A/B testing results.
2219 root_sets - A root set represents a set of roots (or packages) installed in each A/B testing.
2220 build_requests - A build request represents a single pending build for A/B testing.
2222 * public/api/analysis-tasks.php: Added. Returns the specified analysis task or all analysis tasks in an array.
2226 * public/api/test-groups.php: Added. Returns analysis task groups for the specified analysis task or returns
2227 the specified analysis task group as well as build requests associated with them.
2229 (fetch_test_groups_for_task):
2230 (fetch_build_requests_for_task):
2231 (fetch_build_requests_for_group):
2232 (format_test_group):
2233 (format_build_request):
2235 * public/include/json-header.php:
2236 (remote_user_name): Extracted from compute_token so that we can use it in create-analysis-task.php.
2239 * public/privileged-api/associate-bug.php:
2240 (main): Fixed a typo.
2242 * public/privileged-api/create-analysis-task.php: Added. Creates a new analysis task for a given test run range.
2245 (ensure_config_from_runs):
2247 * public/privileged-api/generate-csrf-token.php: Use remote_user_name.
2249 * public/v2/analysis.js: Added. Various Ember data store models to represent analysis tasks and related objects.
2251 (App.AnalysisTask.create):
2253 (App.TestGroupAdapter):
2254 (App.AnalysisTaskSerializer):
2255 (App.TestGroupSerializer):
2258 * public/v2/app.css: Added style rules for the analysis page.
2261 (App.Pane._fetch): Use fetchRunsWithPlatformAndMetric, which has been refactored into App.Manifest.
2263 (App.PaneController.actions.toggleBugsPane): Show bugs pane even when there are no bug trackers or there is not
2264 exactly one selected point as we can still create an analysis task.
2265 (App.PaneController.actions.associateBug): Renamed singlySelectedPoint to selectedSinglePoint to be more
2266 grammatical and also alert'ed the error message when there is one.
2267 (App.PaneController.actions.createAnalysisTask): Added. Creates a new analysis task and opens it in a new tab.
2268 Since window.open only works during the click, we open the new "window" preemptively and navigates or closes it
2269 once XHR request has completed.
2270 (App.PaneController._detailsChanged): Changes due to singlySelectedPoint to selectedSinglePoint rename.
2271 (App.PaneController._updateBugs): Fixed a bug that we were showing bugs in the previous point when a single point
2272 is selected in the details pane.
2274 (App.AnalysisRoute): Added.
2275 (App.AnalysisTaskRoute): Added.
2276 (App.AnalysisTaskViewModel): Added.
2277 (App.AnalysisTaskViewModel._taskUpdated): Fetch runs for the associated platform and metric.
2278 (App.AnalysisTaskViewModel._fetchedRuns): Setup the chart data to show.
2279 (App.AnalysisTaskViewModel.testSets): The computed property used to update roots for all repositories/projects.
2280 (App.AnalysisTaskViewModel._rootChangedForTestSet): Updates root selections for all repositories/projects when
2281 the user selects an option for all roots in A or B configuration.
2282 (App.AnalysisTaskViewModel.roots): The computed property used to show root choices for each repository/project.
2284 * public/v2/chart-pane.css: Added style rules for details view in the analysis task page.
2286 * public/v2/data.js:
2287 (Measurement.prototype._formatRevisionRange): Don't prefix a revision number with "At " when there is no previous
2288 point so that we can use it in App.AnalysisTaskViewModel.roots.
2289 (TimeSeries.prototype.findPointByMeasurementId): Added.
2290 (TimeSeries.prototype.seriesBetweenPoints): Added.
2292 * public/v2/index.html: Use Metric.fullName since the same value is needed in the analysis task page. Also added
2293 a button to create an analysis task, and made bugs pane button always enabled since we can an analysis task even
2294 when multiple points are selected. Finally, added a new template for the analysis task page.
2296 * public/v2/manifest.js:
2297 (App.Metric.fullName): Added to share code between the charts page and the analysis task page.
2298 (App.Manifest.fetchRunsWithPlatformAndMetric): Extracted from App.Pane._fetch to be reused in
2299 App.AnalysisTaskViewModel._taskUpdated.
2301 2014-10-28 Ryosuke Niwa <rniwa@webkit.org>
2303 Remove App.PaneController.bugsChangeCount in the new perf dashboard
2304 https://bugs.webkit.org/show_bug.cgi?id=138111
2306 Reviewed by Darin Adler.
2309 (App.PaneController.bugsChangeCount): Removed.
2310 (App.PaneController.actions.associateBug): Call _updateMarkedPoints instead of incrementing bugsChangeCount.
2311 (App.PaneController._updateMarkedPoints): Extracted from App.InteractiveChartComponent._updateDotsWithBugs.
2312 Finds the list of current run's points that are associated with bugs.
2313 (App.InteractiveChartComponent._updateMarkedDots): Renamed from _updateDotsWithBugs.
2314 * public/v2/chart-pane.css:
2315 (.chart .marked): Renamed from .hasBugs.
2316 * public/v2/index.html: Specify chartPointRadius and markedPoints.
2318 2014-10-27 Ryosuke Niwa <rniwa@webkit.org>
2320 REGRESSION: commit logs are not shown sometimes on the new dashboard UI
2321 https://bugs.webkit.org/show_bug.cgi?id=138099
2323 Reviewed by Benjamin Poulain.
2325 The bug was caused by _currentItemChanged not passing the previous point in the list of points and also
2326 _showDetails inverting the order of the current and old measurements.
2329 (App.PaneController._currentItemChanged): Pass in the previous point to _showDetails when there is one.
2330 (App.PaneController._showDetails): Since points are ordered chronologically, the last point is the
2331 current (latest) measurement and the first point is the oldest measurement.
2332 (App.CommitsViewerComponent.commitsChanged): Don't show a single measurement as a range for clarity.
2334 2014-10-18 Ryosuke Niwa <rniwa@webkit.org>
2336 Perf dashboard should provide a way to associate bugs with a test run
2337 https://bugs.webkit.org/show_bug.cgi?id=137857
2339 Reviewed by Andreas Kling.
2341 Added a "privileged" API, /privileged-api/associate-bug, to associate a bug with a test run.
2342 /privileged-api/ is to be protected by an authentication mechanism such as DigestAuth over https by
2343 the Apache configuration.
2346 The Cross Site Request (CSRF) Forgery prevention for privileged APIs work as follows. When a user is
2347 about to make a privileged API access, the front end code obtains a CSRF token generated by POST'ing
2348 to privileged-api/generate-csrf-token; the page sets a randomly generated salt and an expiration time
2349 via the cookie and returns a token computed from those two values as well as the remote username.
2351 The font end code then POST's the request along with the returned token. The server side code verifies
2352 that the specified token can be generated from the salt and the expiration time set in the cookie, and
2353 the token hasn't expired.
2356 * init-database.sql: Added bug_url to bug_trackers table, and added bugs table. Each bug tracker will
2357 have zero or exactly one bug associated with a test run.
2359 * public/admin/bug-trackers.php: Added the support for editing bug_url.
2360 * public/api/runs.php:
2361 (fetch_runs_for_config): Modified the query to fetch bugs associated with test_runs.
2362 (parse_bugs_array): Added. Parses the aggregated bugs and creates a dictionary that maps a tracker id to
2363 an associated bug if there is one.
2364 (format_run): Calls parse_bugs_array.
2366 * public/include/json-header.php: Added helper functions to deal for CSRF prevention.
2367 (ensure_privileged_api_data): Added. Dies immediately if the request's method is not POST or doesn't
2368 have a valid JSON payload.
2369 (ensure_privileged_api_data_and_token): Ditto. Also checks that the CSRF prevention token is valid.
2370 (compute_token): Computes a CSRF token using the REMOTE_USER (e.g. set via BasicAuth), the salt, and
2371 the expiration time stored in the cookie.
2372 (verify_token): Returns true iff the specified token matches what compute_token returns from the cookie.
2374 * public/include/manifest.php:
2375 (ManifestGenerator::bug_trackers): Include bug_url as bugUrl in the manifest. Also use tracker_id instead
2376 of tracker_name as the key in the manifest. This requires changes to both v1 and v2 front end.
2378 * public/index.html:
2379 (Chart..showTooltipWithResults): Updated for the manifest format changed mentioned above.
2381 * public/privileged-api/associate-bug.php: Added.
2382 (main): Added. Associates or dissociates a bug with a test run inside a transaction. It prevent a CSRF
2383 attack via ensure_privileged_api_data_and_token, which calls verify_token.
2385 * public/privileged-api/generate-csrf-token.php: Added. Generates a CSRF token valid for one hour.
2387 * public/v2/app.css:
2388 (.disabled .icon-button:hover g): Used by the "bugs" icon when a range of points or no points are
2389 selected in a chart.
2392 (App.PaneController.actions.toggleBugsPane): Added. Toggles the visibility of the bugs pane when exactly
2393 one point is selected in the chart. Also hides the search pane when making the bugs pane visible since
2394 they would overlap on each other if both of them are shown.
2395 (App.PaneController.actions.associateBug): Makes a privileged API request to associate the specified bug
2396 with the currently selected point (test run). Updates the bug information in "details" and colors of dots
2397 in the charts to reflect new states. Because chart data objects aren't real Ember objects for performance
2398 reasons, we have to use a dirty hack of modifying a dummy counter bugsChangeCount.
2399 (App.PaneController.actions.toggleSearchPane): Renamed from toggleSearch. Also hides the bugs pane when
2400 showing the search pane.
2401 (App.PaneController.actions.rangeChanged): Takes all selected points as the second argument instead of
2402 taking start and end points as the second and the third arguments so that _showDetails can enumerate all
2403 bugs in the selected range.
2405 (App.PaneController._detailsChanged): Added. Hide the bugs pane whenever a new point is selected.
2406 Also update singlySelectedPoint, which is used by toggleBugsPane and associateBug.
2407 (App.PaneController._currentItemChanged): Updated for the _showDetails change.
2408 (App.PaneController._showDetails): Takes an array of selected points in place of old arguments.
2409 Simplified the code to compute the revision information. Calls _updateBugs to format the associated bugs.
2410 (App.PaneController._updateBugs): Sets details.bugTrackers to a dictionary that maps a bug tracker id to
2411 a bug tracker proxy with an array of (bugNumber, bugUrl) pairs and also editedBugNumber, which is used by
2412 the bugs pane to associate or dissociate a bug number, if exactly one point is selected.
2414 (App.InteractiveChartComponent._updateDotsWithBugs): Added. Sets hasBugs class on dots as needed.
2415 (App.InteractiveChartComponent._setCurrentSelection): Finds and passes all points in the selected range
2416 to selectionChanged action instead of just finding the first and the last points.
2418 * public/v2/chart-pane.css: Updated the style.
2420 * public/v2/data.js:
2421 (PrivilegedAPI): Added. A wrapper for privileged APIs' CSRF tokens.
2422 (PrivilegedAPI.sendRequest): Makes a privileged API call. Fetches a new CSRF token if needed.
2423 (PrivilegedAPI._generateTokenInServerIfNeeded): Makes a request to privileged-api/generate-csrf-token if
2424 we haven't already obtained a CSRF token or if the token has already been expired.
2425 (PrivilegedAPI._post): Makes a single POST request to /privileged-api/* with a JSON payload.
2427 (Measurement.prototype.bugs): Added.
2428 (Measurement.prototype.hasBugs): Returns true iff bugs has more than one bug number.
2429 (Measurement.prototype.associateBug): Associates a bug with a test run via privileged-api/associate-bug.
2431 * public/v2/index.html: Added the bugs pane. Also added a list of bugs associated with the current run in
2434 * public/v2/manifest.js:
2435 (App.BugTracker.bugUrl):
2436 (App.BugTracker.newBugUrl): Added.
2437 (App.BugTracker.repositories): Added. This was a missing back reference to repositories.
2438 (App.MetricSerializer.normalizePayload): Now parses/loads the list of bug trackers from the manifest.
2439 (App.Manifest.repositoriesWithReportedCommits): Now initialized to an empty array instead of null.
2440 (App.Manifest.bugTrackers): Added.
2441 (App.Manifest._fetchedManifest): Sets App.Manifest.bugTrackers. Also sorts the list of repositories by
2442 their respective ids to make the ordering stable.
2444 2014-10-14 Ryosuke Niwa <rniwa@webkit.org>
2446 Remove unused jobs table
2447 https://bugs.webkit.org/show_bug.cgi?id=137724
2449 Reviewed by Daniel Bates.
2451 Removed jobs table in the database as well as related code.
2453 * init-database.sql:
2454 * public/admin/jobs.php: Removed.
2455 * public/admin/tests.php:
2456 * public/include/admin-header.php:
2458 2014-10-13 Ryosuke Niwa <rniwa@webkit.org>
2460 New perf dashboard should have an ability to search commits by a keyword
2461 https://bugs.webkit.org/show_bug.cgi?id=137675
2463 Reviewed by Geoffrey Garen.
2465 /api/commits/ now accepts query parameters to search a commit by a keyword. Its output format changed to
2466 include "authorEmail" and "authorName" directly as columns instead of including an "author" object.
2467 This API change allows fetch_commits_between to generate results without processing Postgres query results.
2469 In the front end side, we've added a search pane in pane controller, and the interactive chart component
2470 now has a concept of highlighted items which is used to indicate commits found by the search pane.
2472 * public/api/commits.php:
2473 (main): Extract query parameters: keyword, from, and to and use that to fetch appropriate commits.
2474 (fetch_commits_between): Moved some code from main. Now takes a search term as the third argument.
2475 We look for a commit if its author name or email contains the keyword or if its revision matches the keyword.
2476 (format_commit): Renamed from format_commits. Now only formats one commit.
2478 * public/include/db.php:
2479 (Database::query_and_fetch_all): Now returns array() when the query results is empty (instead of false).
2481 * public/v2/app.css: Renamed .close-button to .icon-button since it's used by a search button as well.
2484 (App.Pane.searchCommit): Added. Finds the commits by a search term and assigns 'highlightedItems',
2485 which is a hash table that contains highlighted items' measurements' ids as keys.
2486 (App.PaneController.actions.toggleSearch): Toggles the visibility of the search pane. Also sets
2487 the default commit repository.
2488 (App.PaneController.actions.searchCommit): Delegates the work to App.Pane.searchCommit.
2489 (App.InteractiveChartComponent._constructGraphIfPossible): Fixed a bug that we weren't removing old this._dots.
2490 Added the code to initialize this._highlights.
2491 (App.InteractiveChartComponent._updateDimensionsIfNeeded): Updates dimensions of highlight lines.
2492 (App.InteractiveChartComponent._updateHighlightPositions): Added. Ditto.
2493 (App.InteractiveChartComponent._highlightedItemsChanged): Adds vertical lines for highlighted items and deletes
2494 the existing lines for the old highlighted items.
2495 (App.CommitsViewerComponent.commitsChanged): Updated the code per JSON API change mentioned above.
2496 Also fixed a bug that the code tries to update the commits viewer even if the viewer had already been destroyed.
2498 * public/v2/chart-pane.css: Added style for the search pane and the search button.
2500 * public/v2/data.js: Turned FetchCommitsForTimeRange into a class: CommitLogs.
2501 (CommitLogs): Added.
2502 (CommitLogs.fetchForTimeRange): Renamed from FetchCommitsForTimeRange. Takes a search term as an argument.
2503 (CommitLogs._cachedCommitsBetween): Extracted from FetchCommitsForTimeRange.
2504 (CommitLogs._cacheConsecutiveCommits): Ditto.
2505 (FetchCommitsForTimeRange._cachedCommitsByRepository): Deleted.
2506 (Measurement.prototype.commitTimeForRepository): Extracted from formattedRevisions.
2507 (Measurement.prototype.formattedRevisions): Uses formattedRevisions. Deleted the unused code for commitTime.
2509 * public/v2/index.html: Added the search pane and the search button. Also removed the unused attribute binding
2510 for showingDetails since this property is no longer used.
2512 * public/v2/manifest.js:
2513 (App.Manifest.repositories): Added.
2514 (App.Manifest.repositoriesWithReportedCommits): Ditto. Used by App.PaneController.actions.toggleSearch to find
2515 the default repository to search.
2516 (App.Manifest._fetchedManifest): Populates repositories and repositoriesWithReportedCommits.
2518 2014-10-13 Ryosuke Niwa <rniwa@webkit.org>
2520 Unreviewed build fix after r174555.
2522 * public/include/manifest.php:
2523 (ManifestGenerator::generate): Assign an empty array to $repositories_with_commit when there are no commits.
2524 * tests/admin-regenerate-manifest.js: Fixed the test case.
2526 2014-10-09 Ryosuke Niwa <rniwa@webkit.org>
2528 New perf dashboard UI tries to fetch commits all the time
2529 https://bugs.webkit.org/show_bug.cgi?id=137592
2531 Reviewed by Andreas Kling.
2533 Added hasReportedCommits boolean to repository meta data in manifest.json, and used that in
2534 the front end to avoid issuing HTTP requests to fetch commit logs for repositories with
2535 no reported commits as they are all going to fail.
2537 Also added an internal cache to FetchCommitsForTimeRange in the front end to avoid fetching
2538 the same commit logs repeatedly. There are two data structures we cache: commitsByRevision
2539 which maps a given commit revision/hash to a commit object; and commitsByTime which is an array
2540 of commits sorted chronologically by time.
2542 * public/include/manifest.php:
2545 (App.CommitsViewerComponent.commitsChanged):
2547 * public/v2/data.js:
2548 (FetchCommitsForTimeRange):
2549 (FetchCommitsForTimeRange._cachedCommitsByRepository):
2551 * public/v2/manifest.js:
2554 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
2556 Another unreviewed build fix after r174477.
2558 Don't try to insert a duplicated row into build_commits as it results in a database constraint error.
2560 This has been caught by a test in /api/report. I don't know why I thought all tests were passing.
2562 * public/include/report-processor.php:
2564 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
2566 Unreviewed build fix after r174477.
2568 * init-database.sql: Removed build_commits_index since it's redundant with build_commit's primary key.
2569 Also fixed a syntax error that we were missing "," after line that declared build_commit column.
2571 * public/api/runs.php: Fixed the query so that test_runs without commits data will be retrieved.
2572 This is necessary for baseline and target values manually added via admin pages.
2574 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
2576 Add v2 UI for the perf dashboard
2577 https://bugs.webkit.org/show_bug.cgi?id=137537
2579 Rubber-stamped by Andreas Kling.
2582 * public/v2/app.css: Added.
2583 * public/v2/app.js: Added.
2584 * public/v2/chart-pane.css: Added.
2585 * public/v2/data.js: Added.
2586 * public/v2/index.html: Added.
2587 * public/v2/js: Added.
2588 * public/v2/js/d3: Added.
2589 * public/v2/js/d3/LICENSE: Added.
2590 * public/v2/js/d3/d3.js: Added.
2591 * public/v2/js/d3/d3.min.js: Added.
2592 * public/v2/js/ember-data.js: Added.
2593 * public/v2/js/ember.js: Added.
2594 * public/v2/js/handlebars.js: Added.
2595 * public/v2/js/jquery.min.js: Added.
2596 * public/v2/js/statistics.js: Added.
2597 * public/v2/manifest.js: Added.
2598 * public/v2/popup.js: Added.
2600 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
2602 Remove superfluously duplicated code in public/api/report-commits.php.
2604 2014-10-08 Ryosuke Niwa <rniwa@webkit.org>
2606 Perf dashboard should store commit logs
2607 https://bugs.webkit.org/show_bug.cgi?id=137510
2609 Reviewed by Darin Adler.
2611 For the v2 version of the perf dashboard, we would like to be able to see commit logs in the dashboard itself.
2613 This patch replaces "build_revisions" table with "commits" and "build_commits" relations to store commit logs,
2614 and add JSON APIs to report and retrieve them. It also adds a tools/pull-svn.py to pull commit logs from
2615 a subversion directory. The git version of this script will be added in a follow up patch.
2618 In the new database schema, each revision in each repository is represented by exactly one row in "commits"
2619 instead of one row for each build in "build_revisions". "commits" and "builds" now have a proper many-to-many
2620 relationship via "build_commits" relations.
2622 In order to migrate an existing instance of this application, run the following SQL commands:
2626 INSERT INTO commits (commit_repository, commit_revision, commit_time)
2627 (SELECT DISTINCT ON (revision_repository, revision_value)
2628 revision_repository, revision_value, revision_time FROM build_revisions);
2630 INSERT INTO build_commits (commit_build, build_commit) SELECT revision_build, commit_id
2631 FROM commits, build_revisions
2632 WHERE commit_repository = revision_repository AND commit_revision = revision_value;
2634 DROP TABLE build_revisions;
2639 The helper script to submit commit logs can be used as follows:
2641 python ./tools/pull-svn.py "WebKit" https://svn.webkit.org/repository/webkit/ https://perf.webkit.org
2642 feeder-slave feeder-slave-password 60 "webkit-patch find-users"
2644 The above command will pull the subversion server at https://svn.webkit.org/repository/webkit/ every 60 seconds
2645 to retrieve at most 10 commits, and submits the results to https://perf.webkit.org using "feeder-slave" and
2646 "feeder-slave-password" as the builder name and the builder password respectively.
2648 The last, optional, argument is the shell command to convert a subversion account to the corresponding username.
2649 e.g. "webkit-patch find-users rniwa@webkit.org" yields "Ryosuke Niwa" <rniwa@webkit.org> in the stdout.
2652 * init-database.sql: Replaced "build_revisions" relation with "commits" and "build_commits" relations.
2654 * public/api/commits.php: Added. Retrieves a list of commits based on arguments in its path of the form
2655 /api/commits/<repository-name>/<filter>. The behavior of this API depends on <filter> as follows:
2657 - Not specified - It returns every single commit for a given repository.
2658 - Matches "oldest" - It returns the commit with the oldest timestamp.
2659 - Matches "latest" - It returns the commit with the latest timestamp.
2660 - Matches "last-reported" - It returns the commit with the latest timestamp added via report-commits.php.
2661 - Is entirely alphanumeric - It returns the commit whose revision matches the filter.
2662 - Is of the form <alphanumeric>:<alphanumeric> or <alphanumeric>-<alphanumeric> - It retrieves the list
2663 of commits added via report-commits.php between two timestamps retrieved from commits whose revisions
2664 match the two alphanumeric values specified. Because it retrieves commits based on their timestamps,
2665 the list may contain commits that do not appear as neither hash's ancestor in git/mercurial.
2667 (commit_from_revision):
2668 (fetch_commits_between):
2671 * public/api/report-commits.php: Added. A JSON API to report new subversion, git, or mercurial commits.
2672 See tests/api-report-commits.js for examples on how to use this API.
2674 * public/api/runs.php: Updated the query to use "commit_builds" and "commits" relations instead of
2675 "build_revisions". Regrettably, the new query is 20% slower but I'm going to wait until the new UI is ready
2676 to optimize this and other JSON APIs.
2678 * public/include/db.php:
2679 (Database::select_or_insert_row):
2680 (Database::update_or_insert_row): Added.
2681 (Database::_select_update_or_insert_row): Extracted from select_or_insert_row. Try to update first and then
2682 insert if the update fails for update_or_insert_row. Preserves the old behavior when $should_update is false.
2684 (Database::select_first_row):
2685 (Database::select_last_row): Added.
2686 (Database::select_first_or_last_row): Extracted from select_first_row. Fixed a bug that we were asserting
2687 $order_by to be not alphanumeric/underscore. Retrieve the last row instead of the first if $descending_order.
2689 * public/include/report-processor.php:
2690 (ReportProcessor::resolve_build_id): Store commits instead of build_revisions. We don't worry about the race
2691 condition for adding "build_commits" rows since we shouldn't have a single tester submitting the same result
2692 concurrently. Even if it happened, it will only result in a PHP error and the database will stay consistent.
2695 (pathToTests): Don't call path.resolve with "undefined" testName; It throws an exception in the latest node.js.
2697 * tests/api-report-commits.js: Added.
2698 * tests/api-report.js: Fixed a test per build_revisions to build_commits/commits replacement.
2701 * tools/pull-svn.py: Added. See above for how to use this script.
2703 (determine_first_revision_to_fetch):
2704 (fetch_revision_from_dasbhoard):
2705 (fetch_commit_and_resolve_author):
2708 (resolve_author_name_from_email):
2711 2014-09-30 Ryosuke Niwa <rniwa@webkit.org>
2713 Update Install.md for Mavericks and fix typos
2714 https://bugs.webkit.org/show_bug.cgi?id=137276
2716 Reviewed by Benjamin Poulain.
2718 Add the instruction to copy php.ini to enable the Postgres extension in PHP.
2720 Also use perf.webkit.org as the directory name instead of WebKitPerfMonitor.
2722 Finally, init-database.sql is no longer located inside database directory.
2726 2014-08-11 Ryosuke Niwa <rniwa@webkit.org>
2728 Report run id's in api/runs.php for the new dashboard UI
2729 https://bugs.webkit.org/show_bug.cgi?id=135813
2731 Reviewed by Andreas Kling.
2733 Include run_id in the generated JSON.
2735 * public/api/runs.php:
2736 (fetch_runs_for_config): Don't sort results by time since that has been done in the front end for ages now.
2739 2014-08-11 Ryosuke Niwa <rniwa@webkit.org>
2741 Merging platforms mixes baselines and targets into reported data
2742 https://bugs.webkit.org/show_bug.cgi?id=135260
2744 Reviewed by Andreas Kling.
2746 When merging two platforms, move test configurations of a different type (baseline, target)
2747 as well as of different metric (Time, Runs).
2749 Also avoid fetching the entire table of runs just to see if there are no remaining runs.
2750 It's sufficient to detect one such test_runs object.
2752 * public/admin/platforms.php:
2755 2014-07-30 Ryosuke Niwa <rniwa@webkit.org>
2757 Merging platforms mixes baselines and targets into reported data
2758 https://bugs.webkit.org/show_bug.cgi?id=135260
2760 Reviewed by Geoffrey Garen.
2762 Make sure two test configurations we're merging are of the same type (e.g. baseline, target, current).
2763 Otherwise, we'll erroneously mix up runs for baseline, target, and current (reported values).
2765 * public/admin/platforms.php:
2767 2014-07-23 Ryosuke Niwa <rniwa@webkit.org>
2769 Build fix after r171361.
2771 * public/js/helper-classes.js:
2772 (.this.formattedBuildTime):
2774 2014-07-22 Ryosuke Niwa <rniwa@webkit.org>
2776 Perf dashboard spends 2s processing JSON data during the page loads
2777 https://bugs.webkit.org/show_bug.cgi?id=135152
2779 Reviewed by Andreas Kling.
2781 In the Apple internal dashboard, we were spending as much as 2 seconds
2782 converting raw JSON data into proper JS objects while loading the dashboard.
2784 This caused the apparent unresponsiveness of the dashboard despite of the fact
2785 charts themselves updated almost instantaneously.
2787 * public/index.html:
2788 * public/js/helper-classes.js:
2789 (TestBuild): Compute the return values of formattedTime and formattedBuildTime
2790 lazily as creating new Date objects and running string replace is expensive.
2791 (TestBuild.formattedTime):
2792 (TestBuild.formattedBuildTime):
2793 (PerfTestRuns.setResults): Added. Pushing each result was the biggest bottle neck.
2794 (PerfTestRuns.addResult): Deleted.
2796 2014-07-18 Ryosuke Niwa <rniwa@webkit.org>
2798 Perf dashboard shouldn't show the full git hash
2799 https://bugs.webkit.org/show_bug.cgi?id=135083
2801 Reviewed by Benjamin Poulain.
2803 Detect Git/Mercurial hash by checking the length.
2805 If it's a hash, use the first 8 characters in the label
2806 while retaining the full length to be used in hyperlinks.
2808 * public/js/helper-classes.js:
2809 (.this.formattedRevisions):
2812 2014-05-29 Ryosuke Niwa <rniwa@webkit.org>
2814 Add an instruction on how to backup the database.
2815 https://bugs.webkit.org/show_bug.cgi?id=133391
2817 Rubber-stamped by Andreas Kling.
2821 2014-04-08 Ryosuke Niwa <rniwa@webkit.org>
2823 Build fix after r166479. 'bytes' is now abbreviated as 'B'.
2825 * public/js/helper-classes.js:
2826 (PerfTestRuns.smallerIsBetter):
2828 2014-04-08 Ryosuke Niwa <rniwa@webkit.org>
2832 * public/common.css:
2834 * public/index.html:
2838 2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
2840 WebKitPerfMonitor: There should be a way to add all metrics of a suite without also adding subtests
2841 https://bugs.webkit.org/show_bug.cgi?id=131157
2843 Reviewed by Andreas Kling.
2845 Split "all metrics" into all metrics of a test suite and all subtests of the suite.
2846 This allows, for example, adding all metrics such as Arithmetic and Geometric for
2847 a given test suite without also adding its subtests.
2849 * public/index.html:
2853 2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
2855 WebKitPerfMonitor: Tooltips cannot be pinned after using browser's back button
2856 https://bugs.webkit.org/show_bug.cgi?id=131155
2858 Reviewed by Andreas Kling.
2860 The bug was caused by Chart.attach binding event listeners on plot container on each call.
2861 This resulted in the click event handler toggling the visiblity of the tooltip twice upon
2862 click when attach() has been called even number of times, keeping the tooltip invisible.
2864 Fixed the bug by extracting the code to bind event listeners outside of Chart.attach as
2865 a separate function, bindPlotEventHandlers, and calling it exactly once when Chart.attach
2866 is called for the first time.
2868 * public/index.html:
2870 (Chart..bindPlotEventHandlers):
2872 2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
2874 WebKitPerfMonitor: Tooltips can be cut off at the top
2875 https://bugs.webkit.org/show_bug.cgi?id=130960
2877 Reviewed by Andreas Kling.
2879 * public/common.css:
2880 (#title): Removed the gradients, box shadows, and border from the header.
2881 (#title h1): Reduce the font size.
2882 (#title ul): Use line-height to vertically align the navigation bar instead of specifying a padding atop.
2883 * public/index.html:
2884 (.tooltop:before): Added. Identical to .tooltop:after except it's upside down (arrow facing up).
2885 (.tooltip.inverted:before): Show the arrow facing up when .inverted is set.
2886 (.tooltip.inverted:before): Hide the arrow facing down when .inverted is set.
2887 * public/js/helper-classes.js:
2888 (Tooltip.show): Show the tooltip below the point if placing it above the point results in the top of the
2889 tooltip extending above y=0.
2891 2014-04-03 Ryosuke Niwa <rniwa@webkit.org>
2893 WebKitPerfMonitor: Y-axis adjustment is too aggressive
2894 https://bugs.webkit.org/show_bug.cgi?id=130937
2896 Reviewed by Andreas Kling.
2898 Previously, adjusted min. and max. were defined as the two standards deviations away from EWMA of measured
2899 results. This had two major problems:
2900 1. Two standard deviations can be too small to show the confidence interval for results.
2901 2. Sometimes baseline and target can be more than two standards deviations away.
2903 Fixed the bug by completely rewriting the algorithm to compute the interval. Instead of blindly using two
2904 standard deviations as margins, we keep adding quarter the standard deviation on each side until more than 90%
2905 of points lie in the interval or we've expanded 4 standard deviations. Once this condition is met, we reduce
2906 the margin on each side separately to reduce the empty space on either side.
2908 A more rigorous approach would involve computing least squared value of results with respect to intervals
2909 but that seems like an overkill for a simple UI problem; it's also computationally expensive.
2911 * public/index.html:
2912 (Chart..adjustedIntervalForRun): Extracted from computeYAxisBoundsToFitLines.
2913 (Chart..computeYAxisBoundsToFitLines): Compute the min. and max. adjusted intervals out of adjusted intervals
2914 for each runs (current, baseline, and target) so that at least one point from each set of results is shown.
2915 We wouldn't see the difference between measured values versus baseline and target values otherwise.
2916 * public/js/helper-classes.js:
2917 (PerfTestResult.unscaledConfidenceIntervalDelta): Returns the default value if the confidence
2918 interval delta cannot be computed.
2919 (PerfTestResult.isInUnscaledInterval): Added. Returns true iff the confidence intervals lies
2920 within the given interval.
2921 (PerfTestRuns..filteredResults): Extracted from unscaledMeansForAllResults now that PerfTestRuns.min and
2922 PerfTestRuns.max need to use both mean and confidence interval delta for each result.
2923 (PerfTestRuns..unscaledMeansForAllResults):
2924 (PerfTestRuns.min): Take the confidence interval delta into account.
2925 (PerfTestRuns.max): Ditto.
2926 (PerfTestRuns.countResults): Returns the number of results in the given time frame (> minTime).
2927 (PerfTestRuns.countResultsInInterval): Returns the number of results whose confidence interval lie within the
2929 (PerfTestRuns.exponentialMovingArithmeticMean): Fixed the typo so that it actually computes the EWMA.
2931 2014-03-31 Ryosuke Niwa <rniwa@webkit.org>
2933 Some CSS tweaks after r166477 and r166479,
2935 * public/index.html:
2937 2014-03-30 Ryosuke Niwa <rniwa@webkit.org>
2939 WebKitPerfMonitor: Sometimes text inside panes overlap
2940 https://bugs.webkit.org/show_bug.cgi?id=130956
2942 Reviewed by Gyuyoung Kim.
2944 Revamped the pane UI. Now build info uses table element instead of plane text with BRs. The computed status of
2945 the latest result against baseline/target such as "3% until target" is now shown above the current value. This
2946 reduces the total height of the pane and fits more information per screen capita on the dashboard.
2948 * public/index.html: Updated and added a bunch of CSS rules for the new look.
2949 (.computeStatus): Don't append the build info here. The build info is constructed as a separate table now.
2950 (.createSummaryRowMarkup): Use th instead of td for "Current", "Baseline", and "Target" in the summary table.
2951 (.buildLabelWithLinks): Construct table rows instead of br separated lines of text. This streamlines the look
2952 of the build info shown in a chart pane and a tooltip.
2953 (Chart): Made .status a table.
2954 (Chart.populate): Prepend status.text, which contains text such as "3% until target", into the summary rows
2955 right above "Current" value, and populate .status with buildLabelWithLinks manually instead of status.text
2956 now that status.text no longer contains it.
2957 (Chart..showTooltipWithResults): Wrap buildLabelWithLinks with a table element.
2959 * public/js/helper-classes.js:
2960 (TestBuild.formattedRevisions): Don't include repository names in labels since repository names are now added
2961 by buildLabelWithLinks inside th elements. Also place spaces around '-' between two different OS X versions.
2962 e.g. "OS X 10.8 - OS X 10.9" instead of "OS X 10.8-OS X 10.9".
2963 (PerfTestRuns): Use "/s" for "runs/s" and "B" for "bytes" to make text shorter in .status and .summaryTable.
2964 (PerfTestRuns..computeScalingFactorIfNeeded): Avoid placing a space between 'M' and a unit starting with a
2965 capital letter; e.g. "MB" instead of "M B".
2967 2014-03-30 Ryosuke Niwa <rniwa@webkit.org>
2969 WebKitPerfMonitor: Header and number-of-days slider takes up too much space
2970 https://bugs.webkit.org/show_bug.cgi?id=130957
2972 Reviewed by Gyuyoung Kim.
2974 Moved the slider into the header. Also reduced the spacing between the header and platform names.
2975 This reclaims 50px × width of the screen real estate.
2977 * public/common.css:
2978 (#title): Reduced the space below the header from 20px to 10px.
2979 * public/index.html:
2980 (#numberOfDaysPicker): Removed the rounded border around the number-of-days slider.
2981 (#dashboard > tbody > tr > td): Added a 1.5em padding at the bottom.
2982 (#dashboard > thead th): That allows us to remove the padding at the top here. This reduces the wasted screen
2983 real estate between the header and the platform names.
2985 2014-03-10 Zoltan Horvath <zoltan@webkit.org>
2987 Update the install guidelines for perf.webkit.org
2988 https://bugs.webkit.org/show_bug.cgi?id=129895
2990 Reviewed by Ryosuke Niwa.
2992 The current install guideline for perf.webkit.org discourages the use of the installed
2993 Server application. I've actualized the documentation for Mavericks, and modified the
2994 guideline to include the instructions for Server.app also.
2998 2014-03-08 Zoltan Horvath <zoltan@webkit.org>
3000 Update perf.webkit.org json example
3001 https://bugs.webkit.org/show_bug.cgi?id=129907
3003 Reviewed by Andreas Kling.
3005 The current example is not valid json syntax. I fixed the syntax errors and indented the code properly.
3009 2014-01-31 Ryosuke Niwa <rniwa@webkit.org>
3011 Merge database-common.js and utility.js into run-tests.js.
3013 Reviewed by Matthew Hanson.
3015 Now that run-tests is the only node.js script, merged database-common.js and utility.js into it.
3016 Also moved init-database.sql out of the database directory and removed the directory entirely.
3018 * database: Removed.
3019 * database/database-common.js: Removed.
3020 * database/utility.js: Removed.
3021 * init-database.sql: Moved from database/init-database.sql.
3023 (connect): Moved from database-common.js.
3024 (pathToDatabseSQL): Extracted from pathToLocalScript.
3025 (pathToTests): Moved from database-common.js.
3028 (SerializedTaskQueue): Ditto.
3030 (initializeDatabase):
3031 (TestEnvironment.it):
3032 (TestEnvironment.queryAndFetchAll):
3035 2014-01-30 Ryosuke Niwa <rniwa@webkit.org>
3037 Remove the dependency on node.js from the production code.
3039 Reviewed by Ricky Mondello.
3041 Work towards <rdar://problem/15955053> Upstream SafariPerfMonitor.
3043 Removed node.js dependency from TestRunsGenerator. It was really a design mistake to invoke node.js from php.
3044 It added so much complexity with only theoretical extensibility of adding aggregators. It turns out that
3045 many aggregators we'd like to add are a lot more complicated than ones that could be written under the current
3046 infrastructure, and we need to make the other aspects (e.g. the level of aggregations) a lot more extensible.
3047 Removing and simplifying TestRunsGenerator allows us to implement such extensions in the future.
3049 Also removed the js files that are no longer used.
3051 * config.json: Moved from database/config.json.
3052 * database/aggregate.js: Removed. No longer used.
3053 * database/database-common.js: Removed unused functions, and updated the path to config.json.
3054 * database/process-jobs.js: Removed. No longer used.
3055 * database/sample-data.sql: Removed. We have a much better corpus of data now.
3056 * database/schema.graffle: Removed. It's completely obsolete.
3057 * public/include/db.php: Updated the path to config.json.
3058 * public/include/evaluator.js: Removed.
3060 * public/include/report-processor.php:
3061 (TestRunsGenerator::aggregate): Directly aggregate values via newly added aggregate_values method instead of
3062 storing values into $expressions and calling evaluate_expressions_by_node.
3063 (TestRunsGenerator::aggregate_values): Added.
3064 (TestRunsGenerator::compute_caches): Directly compute the caches.
3066 2014-01-30 Ryosuke Niwa <rniwa@webkit.org>
3068 Build fix. Don't fail the platform merges even if there are no test configurations to be moved to the new platform.
3070 * public/admin/platforms.php:
3071 * public/include/db.php:
3073 2014-01-30 Ryosuke Niwa <rniwa@webkit.org>
3075 Zoomed y-axis view is ununsable when the last result is an outlier.
3077 Reviewed by Stephanie Lewis.
3079 Show two standard deviations from the exponential moving average with alpha = 0.3 instead of the mean of
3080 the last result so that the graph looks sane if the last result was an outlier. However, always show
3081 the last result's mean even if it was an outlier.
3083 * public/index.html:
3084 * public/js/helper-classes.js:
3085 (unscaledMeansForAllResults): Extracted from min/max/sampleStandardDeviation.
3086 Also added the ability to cache the unscaled means to avoid recomputation.
3087 (PerfTestRuns.min): Refactored to use unscaledMeansForAllResults.
3088 (PerfTestRuns.max): Ditto.
3089 (PerfTestRuns.sampleStandardDeviation): Ditto.
3090 (PerfTestRuns.exponentialMovingArithmeticMean): Added.
3092 2014-01-30 Ryosuke Niwa <rniwa@webkit.org>
3096 * public/admin/tests.php:
3097 * public/js/helper-classes.js:
3099 2014-01-29 Ryosuke Niwa <rniwa@webkit.org>
3101 Use two standard deviations instead as I mentioned in the mailing list.
3103 * public/index.html:
3105 2014-01-28 Ryosuke Niwa <rniwa@webkit.org>
3107 The performance dashboard erroneously shows upward arrow for combined metrics.
3109 A single outlier can ruin the zoomed y-axis view.
3111 Rubber-stamped by Antti Koivisto.
3113 * public/index.html:
3114 (computeYAxisBoundsToFitLines): Added adjustedMax and adjustedMin, which are pegged at 4 standard deviations
3115 from the latest results' mean.
3116 (Chart): Renamed shouldStartYAxisAtZero to shouldShowEntireYAxis.
3117 (Chart.attachMainPlot): Use the adjusted max and min when we're not showing the entire y-axis.
3118 (Chart.toggleYAxis):
3119 * public/js/helper-classes.js:
3120 (PerfTestRuns.sampleStandardDeviation): Added.
3121 (PerfTestRuns.smallerIsBetter): 'Combined' is a smaller is better metric.
3123 2014-01-28 Ryosuke Niwa <rniwa@webkit.org>
3125 Don't include the confidence interval when computing the y-axis.
3127 Rubber-stamped by Simon Fraser.
3129 * public/js/helper-classes.js:
3133 2014-01-25 Ryosuke Niwa <rniwa@webkit.org>
3135 Tiny CSS tweak for tooltips.
3137 * public/index.html:
3139 2014-01-25 Ryosuke Niwa <rniwa@webkit.org>
3141 Remove the erroneously repeated code.
3143 * public/admin/test-configurations.php:
3145 2014-01-24 Ryosuke Niwa <rniwa@webkit.org>
3147 <rdar://problem/15704893> perf dashboard should show baseline numbers
3149 Reviewed by Stephanie Lewis.
3151 * public/admin/bug-trackers.php:
3152 (associated_repositories): Return an array of HTMLs instead of echo'ing as expected by AdministrativePage.
3155 * public/admin/platforms.php:
3156 (merge_list): Ditto.
3158 * public/admin/test-configurations.php: Added.
3159 (add_run): Adds a "synthetic" test run and a corresponding build. It doesn't create run_iterations and
3160 build_revisions as they're not meaningful for baseline / target numbers.
3161 (delete_run): Deletes a synthetic test run and its build. It verifies that the specified build has exactly
3162 one test run so that we don't accidentally delete a reported test run.
3163 (generate_rows_for_configurations): Generates rows of configuration IDs and types.
3164 (generate_rows_for_test_runs): Ditto for test runs. It also emits the form to add new "synthetic" test runs
3165 and delete existing ones.
3167 * public/admin/tests.php: We wrongfully assumed there is exactly one test configuration for each metric
3168 on each platform; there could be configurations of distinct types such as "current" and "baseline".
3169 Thus, update all test configurations for a given metric when updating config_is_in_dashboard.
3171 * public/api/runs.php: Remove the NotImplemented when we have multiple test configurations.
3172 (fetch_runs_for_config): "Synthetic" test runs created on test-configurations page are missing revision
3173 data so we need to left-outer-join (instead of inner-join) build_revisions. To avoid making the query
3174 unreadable, don't join revision_repository here. Instead, fetch the list of repositories upfront and
3175 resolve names in parse_revisions_array. This actually reduces the query time by ~10%.
3177 (parse_revisions_array): Skip an empty array created for "synthetic" test runs.
3179 * public/include/admin-header.php:
3180 (AdministrativePage::render_table): Now custom columns support sub columns. e.g. a configuration column may
3181 have id and type sub columns, and each custom column could generate multiple rows.
3183 Any table with sub columns now generates two rows for thead. We generate td's in in the first row without
3184 sub columns with rowspan of 2, and generate ones with sub columns with colspan set to the sub column count.
3185 We then proceed to generate the second header row with sub column names.
3187 When generating the actual content, we first generate all custom columns as they may have multiple rows in
3188 which case regular columns need rowspan set to the maximum number of rows.
3190 Once we've generated the first row, we proceed to generate subsequent rows for those custom columns that
3193 (AdministrativePage::render_custom_cells): Added. This function is responsible for generating table cells
3194 for a given row in a given custom column. It generates an empty td when the custom column doesn't have
3195 enough rows. It also generates empty an td when it doesn't have enough columns in some rows except when
3196 the entire row consists of exactly one cell for a custom column with sub columns, in which case the cell is
3197 expanded to occupy all sub columns.
3199 * public/include/manifest.php:
3200 (ManifestGenerator::platforms): Don't add the metric more than once.
3202 * public/include/test-name-resolver.php:
3203 (TestNameResolver::__construct): We had wrongfully assumed that we have exactly one test configuration on
3204 each platform for each metric like tests.php. Fixed that. Also fetch the list of aggregators to compute the
3205 full metric name later.
3206 (TestNameResolver::map_metrics_to_tests): Populate $this->id_to_metric.
3207 (TestNameResolver::test_id_for_full_name): Simplified the code using array_get.
3208 (TestNameResolver::full_name_for_test): Added.
3209 (TestNameResolver::full_name_for_metric): Added.
3210 (TestNameResolver::configurations_for_metric_and_platform): Renamed as it returns multiple configurations.
3212 * public/js/helper-classes.js:
3213 (TestBuild): Use the build time as the maximum time when revision information is missing for "synthetic"
3214 test runs created to set baseline and target points.
3216 2014-01-24 Ryosuke Niwa <rniwa@webkit.org>
3218 Build fix after r57928. Removed a superfluous close parenthesis.
3220 * public/api/runs.php:
3222 2014-01-24 Ryosuke Niwa <rniwa@webkit.org>
3224 Unreviewed build & typo fixes.
3226 * public/admin/platforms.php:
3227 * tests/admin-platforms.js:
3229 2014-01-24 Ryosuke Niwa <rniwa@webkit.org>
3231 <rdar://problem/15704893> perf dashboard should show baseline numbers
3233 Rubber-stamped by Antti Koivisto.
3235 Organize some code into functions in runs.php.
3237 Also added back $paths that was erroneously removed in r57925 from json-header.php.
3239 * public/api/runs.php:
3240 (fetch_runs_for_config): Extracted.
3241 (format_run): Ditto.
3243 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
3245 Merge the upstream json-shared.php as of https://trac.webkit.org/r162693.
3247 * database/config.json:
3248 * public/admin/reprocess-report.php:
3249 * public/api/report.php:
3250 * public/api/runs.php:
3251 * public/include/json-header.php:
3253 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
3255 Commit yet another forgotten change.
3257 Something went horribly wrong with my merge :(
3259 * database/init-database.sql:
3261 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
3263 Commit one more forgotten change. Sorry for making a mess here.
3265 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
3267 Commit the forgotten files.
3269 * public/admin/platforms.php: Added.
3270 * tests/admin-platforms.js: Added.
3272 2014-01-23 Ryosuke Niwa <rniwa@webkit.org>
3274 <rdar://problem/15889905> SafariPerfMonitor: there should be a way to merge and hide platforms
3276 Reviewed by Stephanie Lewis.
3278 Added /admin/platforms/ page to hide and merge platforms.
3280 Merging two platforms is tricky because we need to migrate test runs as well as some test configurations.
3281 Recall that each test (e.g. Dromaeo) can have many "test metrics" (e.g. MaxAllocations, EndAllocations),
3282 and they have a distinct "test configuration" for each platform (e.g. MaxAllocation on Mountain Lion), and
3283 each test configuration a distinct "test run" for each build.
3285 In order to merge platform A into platform B, we must migrate all test runs that belong to platform A via
3286 their test configurations into platform B.
3288 Suppose we're migrating a test run R for test configuration T_A in platform A for metric M. Since M exists
3289 independent of platforms, R should continue to relate to M through some test configuration. Unfortunately,
3290 we can't simply move T_A into platform B since we may already have a test configuration T_B for metric M
3291 in platform B, in which case R should relate to T_B instead.
3293 Thus, we first migrate all test runs for which we already have corresponding test configurations in the
3294 new platform. We then migrate the test configurations of the remaining test runs.
3296 * database/init-database.sql: Added platform_hidden.
3298 * public/admin/platforms.php: Added.
3299 (merge_platforms): Added. Implements the algorithm described above.
3300 (merge_list): Added.
3302 * public/admin/tests.php: Disable the checkbox to show a test configuration on the dashboard if its platform
3303 is hidden since it doesn't do anything.
3305 * public/include/admin-header.php: Added the hyperlink to /admin/platforms.
3306 (update_field): Don't bail out if the newly added "update-column" is set to the field name even if $_POST is
3307 missing it since unchecked checkbox doesn't set the value in $_POST.
3308 (AdministrativePage::render_form_control_for_column): Added the support for boolean edit mode. Also used
3309 switch statement instead of repeated if's.
3310 (AdministrativePage::render_table): Emit "update-column" for update_field.
3312 * public/include/db.php: Disable warnings when we're not in the debug mode.
3314 * public/include/manifest.php:
3315 (ManifestGenerator::platforms): Skip platforms that have been hidden.
3318 (TestEnvironment.postJSON):
3319 (TestEnvironment.httpGet):
3320 (TestEnvironment.httpPost): Added.
3321 (sendHttpRequest): Set the content type if specified.
3323 * tests/admin-platforms.js: Added tests.
3325 2014-01-22 Ryosuke Niwa <rniwa@webkit.org>
3327 Extract the code to compute full test names from tests.php.
3329 Reviewed by Stephanie Lewis.
3331 Extracted TestNameResolver out of tests.php. This reduces the number of global variables in tests.php
3332 and paves our way to re-use the code in other pages.
3334 * public/admin/tests.php:
3336 * public/include/db.php:
3337 (array_set_default): Renamed from array_item_set_default and moved from tests.php as it's used in both
3338 tests.php and test-name-resolver.php.
3340 * public/include/test-name-resolver.php: Added.
3341 (TestNameResolver::__construct):
3342 (TestNameResolver::compute_full_name): Moved from tests.php.
3343 (TestNameResolver::map_metrics_to_tests): Ditto.
3344 (TestNameResolver::sort_tests_by_full_name): Ditto.
3345 (TestNameResolver::tests): Added.
3346 (TestNameResolver::test_id_for_full_name): Ditto.
3347 (TestNameResolver::metrics_for_test_id): Ditto.
3348 (TestNameResolver::child_metrics_for_test_id): Ditto.
3349 (TestNameResolver::configuration_for_metric_and_platform): Ditto.
3351 2014-01-21 Ryosuke Niwa <rniwa@webkit.org>
3353 <rdar://problem/15867325> Perf dashboard is erroneously associating reported results with old revisions
3355 Reviewed by Stephanie Lewis.
3357 Add the ability to reprocess reports so that I can re-associate wrongfully associated reports.
3359 Added public/admin/reprocess-report.php. It doesn't have any nice UI to find reports and it returns JSON
3360 but that's sufficient to correct the wrongfully processed reports for now.
3362 * public/admin/reprocess-report.php: Added. Takes a report id in $_GET or $_POST and process the report.
3363 We should eventually add a nice UI to find and reprocess reports.
3365 * public/api/report.php: ReportProcessor and TestRunsGenerator have been removed.
3367 * public/include/db.php: Added the forgotten call to prefixed_column_names.
3369 * public/include/report-processor.php: Copied from public/api/report.php.
3370 (ReportProcessor::__construct): Fetch the list of aggregators here for simplicity.
3371 (ReportProcessor::process): Optionally takes $existing_report_id. When this value is specified, we don't
3372 create a new report or authenticate the builder password (the password is never stored in the report).
3373 Also use select_first_row instead of query_and_fetch_all to find the builder for simplicity.
3374 (ReportProcessor::construct_build_data): Extracted from store_report_and_get_build_data.
3375 (ReportProcessor::store_report): Ditto.
3377 * tests/admin-reprocess-report.js: Added.
3379 2014-01-21 Ryosuke Niwa <rniwa@webkit.org>
3381 <rdar://problem/15867325> Perf dashboard is erroneously associating reported results with old revisions
3383 Reviewed by Ricky Mondello.
3385 The bug was caused by a build fix r57645. It attempted to treat multiple reports from the same builder
3386 for the same build number as a single build by ignoring build time. This was necessary to associate
3387 multiple reports by a single build - e.g. for different performance test suites - because the scripts
3388 we use to submit results computed its own "build time" when they're called.
3390 An unintended consequence of this change was revealed when we moved a buildbot master to the new machine
3391 last week; new reports were wrongfully associated with old build numbers.
3393 Fixed the bug by not allowing reports made more than 1 day after the initial build time to be assigned
3394 to the same build. Instead, we create a new build object for those reports. Since the longest set of
3395 tests we have only take a couple of hours to run, 24 hours should be more than enough.
3397 * database/init-database.sql: We can no longer constrain that each build number is unique to a builder
3398 or that build number and build time pair is unique. Instead, constrain the uniqueness of the tuple
3399 (builder, build number, build time).
3401 * public/api/report.php:
3402 (ReportProcessor::resolve_build_id): Look for any builds made within the past one day. Create a new build
3403 when no such build exists. This prevents a report from being associated with a very old build of the same
3406 Also check that revision numbers or hashes match when we're adding revision info. This will let us catch
3407 a similar bug in the future sooner.
3409 * tests/api-report.js: Added three test cases.
3411 2014-01-20 Ryosuke Niwa <rniwa@webkit.org>
3413 Merged the upstream changes to db.php
3414 See http://trac.webkit.org/browser/trunk/Websites/test-results/public/include/db.php
3416 * public/include/db.php:
3418 2014-01-20 Ryosuke Niwa <rniwa@webkit.org>
3420 Update other scripts and tests per previous patch.
3422 * public/include/manifest.php:
3423 * tests/admin-regenerate-manifest.js:
3425 2014-01-20 Ryosuke Niwa <rniwa@webkit.org>
3427 Remove metrics_unit.
3429 Reviewed by Ricky Mondello.
3431 This column is no longer used by the front-end code since r48360.
3433 * database/init-database.sql:
3434 * public/admin/tests.php:
3436 2014-01-16 Ryosuke Niwa <rniwa@webkit.org>
3438 Unreviewed build fix.
3440 * public/api/report.php:
3442 2014-01-15 Ryosuke Niwa <rniwa@webkit.org>
3444 <rdar://problem/15832456> Automate DoYouEvenBench (124497)
3446 Reviewed by Ricky Mondello.
3448 Support a new alternative format for aggregated results where we have raw values as well as
3449 the list aggregators so that instead of
3450 "metrics": {"Time": ["Arithmetic"]}
3452 "metrics": {"Time": { "aggregators" : ["Arithmetic"], "current": [300, 310, 320, 330] }}
3454 This allows single JSON generated by run-perf-tests in WebKit to be shared between the perf
3455 dashboard and the generated results page, which doesn't know how to aggregate values.
3457 We need to keep the support for the old format because all other existing performance tests
3458 all rely on the old format. Even if we updated the tests, we need the dashboard to support
3459 the old format during the transition.
3461 * public/api/report.php:
3462 (ReportProcessor::recursively_ensure_tests): Support the new format in addition to the old one.
3463 (ReportProcessor::aggregator_list_if_exists): Replaced is_list_of_aggregators.
3465 * tests/api-report.js: Updated one of aggregator test cases to test the new format.
3467 2013-05-31 Ryosuke Niwa <rniwa@webkit.org>
3469 Unreviewed; Tweak the CSS so that chart panes align vertically.
3471 * public/index.html:
3473 2013-05-31 Ryosuke Niwa <rniwa@webkit.org>
3475 SafariPerfMonitor should support Combined metric.
3477 * public/js/helper-classes.js:
3478 (PerfTestRuns): Added 'Combined' metric. In general, it could be used for smaller-is-better
3479 value as well but assume it to be greater-is-better for now.
3481 2013-05-30 Ryosuke Niwa <rniwa@webkit.org>
3483 Commit the forgotten init-database change to add iteration_relative_time.
3485 * database/init-database.sql:
3487 2013-05-30 Ryosuke Niwa <rniwa@webkit.org>
3489 <rdar://problem/13993069> SafariPerfMonitor: Support accepting (relative time, value) pairs
3491 Reviewed by Ricky Mondello.
3493 Add the support for each value to have a relative time. This is necessary for frame rate history
3494 since a frame rate needs to be associated with a time it was sampled.
3496 * database/init-database.sql: Added iteration_relative_time to run_iterations.
3498 * public/api/report.php:
3499 (TestRunsGenerator::test_value_list_to_values_by_iterations): Reject any non-numeral values here.
3500 This code is used to aggregate values but it doesn't make sense to aggregate iteration values
3501 with relative time since taking the average of two frame rates for two subtests taken at two
3502 different times doesn't make any sense.
3503 (TestRunsGenerator::compute_caches): When we encounter an array value while computing sum, mean,
3504 etc..., use the second element since we assume values are of the form (relative time, frame rate).
3505 Also exit early with an error if the number of elements in the array is not a pair.
3506 (TestRunsGenerator::commit): Store the relative time and the frame rate as needed.
3508 * tests/api-report.js: Added a test case. Also modified existing test cases to account for
3509 iteration_relative_time.
3511 2013-05-27 Ryosuke Niwa <rniwa@webkit.org>
3513 <rdar://problem/13654488> SafariPerfMonitor: Support accepting single-value results
3515 Reviewed by Ricky Mondello.
3517 Support that. It's one line change.
3519 * public/api/report.php:
3520 (ReportProcessor.recursively_ensure_tests): When there is exactly one value, wrap it inside an array
3521 to match the convention assumed elsewhere.
3522 * tests/api-report.js: Added a test case.
3524 2013-05-26 Ryosuke Niwa <rniwa@webkit.org>
3526 SafariPerfMonitor shows popups for points outside of the visible region.
3528 Rubber-stamped by Simon Fraser.
3530 * public/index.html:
3531 (Chart.closestItemForPageXRespectingPlotOffset): renamed from closestItemForPageX.
3532 (Chart.attach): Always use closestItemForPageXRespectingPlotOffset to work around the fact flot
3533 may return an item underneath y-axis labels.
3535 2013-05-26 Ryosuke Niwa <rniwa@webkit.org>
3537 Tweak the CSS a little to avoid the test name overlapping with the summary table.
3539 * public/index.html:
3541 2013-05-26 Ryosuke Niwa <rniwa@webkit.org>
3543 Unreviewed. Fix the typo. The anchor element should wrap the svg element, not the other way around.
3545 * public/index.html:
3547 2013-05-26 Ryosuke Niwa <rniwa@webkit.org>
3549 <rdar://problem/13992266> Should be a toggle to show entire Y-axis range
3550 <rdar://problem/13992271> Should scale Y axis to include error ranges
3552 Reviewed by Ricky Mondello.
3554 Add the feature. Also made adjust y-axis respect confidence interval delta so that the gray shade behind
3555 the main graph doesn't go outside the graph even when the y-axis is adjusted.
3557 * database/config.json:
3558 * public/index.html:
3559 (Chart): Add a SVG arrow to toggle y-axis mode, and bind click on the arrow to toggleYAxis().
3560 (Chart.attachMainPlot): Respect shouldStartYAxisAtZero.
3561 (Chart.toggleYAxis): Toggle the y-axis mode of this chart by toggling shouldStartYAxisAtZero and calling
3563 * public/js/helper-classes.js:
3564 (PerfTestResult.confidenceIntervalDelta):
3565 (PerfTestResult.unscaledConfidenceIntervalDelta): Extracted.
3566 (PerfTestRuns.min): Take confidence interval delta into account.
3567 (PerfTestRuns.max): Ditto.
3568 (PerfTestRuns.hasConfidenceInterval): Not sure why this function was checking the typeof. Just use isNaN.
3570 2013-04-26 Ryosuke Niwa <rniwa@webkit.org>
3572 A build fix of the previous. Don't look for a test with NULL parent because NULL != NULL in our beloved SQL.
3574 * public/api/report.php:
3575 (ReportProcessor::recursively_ensure_tests):
3576 * tests/api-report.js: Added a test.
3578 2013-04-26 Ryosuke Niwa <rniwa@webkit.org>
3580 Unreviewed build fixes.
3582 * public/api/report.php:
3583 (ReportProcessor::process): Explicitly exit with error when builder name or build time is missing.
3584 Also, tolerate reports without any revision information.
3586 (ReportProcessor::recursively_ensure_tests): When looking for a test, don't forget to compare its
3589 * tests/api-report.js: Added few test cases.
3591 2013-04-26 Ryosuke Niwa <rniwa@webkit.org>
3593 Commit another change that was supposed to be committed in r50331.
3596 (TestEnvironment.this.postJSON):
3597 (TestEnvironment.this.httpGet):
3600 2013-04-09 Ryosuke Niwa <rniwa@webkit.org>
3602 Commit the remaining files.
3604 * public/admin/regenerate-manifest.php:
3605 * public/include/admin-header.php:
3606 * public/include/json-header.php:
3607 * public/include/manifest.php:
3609 (TestEnvironment.this.postJSON):
3610 (TestEnvironment.this.httpGet):
3613 2013-03-15 Ryosuke Niwa <rniwa@webkit.org>
3615 SafariPerfMonitor: Add some tests for admin/regenerate-manifest.
3617 Reviewed by Ricky Mondello.
3619 Added some tests for admin/regenerate-manifest.
3621 * public/admin/regenerate-manifest.php: Use require_once instead of require.
3622 * public/include/admin-header.php: Ditto.
3623 * public/include/json-header.php: Ditto.
3625 * public/include/manifest.php:
3626 (ManifestGenerator::builders): Removed a reference to a non-existent variable.
3627 When there are no builders, simply return an empty array.
3630 (TestEnvironment.postJSON):
3631 (TestEnvironment.httpGet): Added.
3632 (sendHttpRequest): Renamed from postHttpRequest as it now takes method as an argument.
3634 * tests/admin-regenerate-manifest.js: Added with a bunch of test cases.
3636 2013-03-14 Ryosuke Niwa <rniwa@webkit.org>
3638 Unreviewed. Added more tests for api/report to ensure it creates tests, metrics, test_runs,
3639 and run_iterations. Also fixed a typo in report.php found by new tests.
3641 * public/api/report.php:
3642 (main): Fix a bug in the regular expression to wrap numbers with double quotations.
3643 * tests/api-report.js: Added more test cases.
3645 2013-03-12 Ryosuke Niwa <rniwa@webkit.org>
3647 <rdar://problem/13399038> SafariPerfMonitor: Need integration tests
3649 Reviewed by Ricky Mondello.
3651 Add a test runner script and some simple test cases.