2015-02-20 Ryosuke Niwa Unreviewed test fixes after r179037, r179591, and r179763. * tests/admin-regenerate-manifest.js: * tests/admin-reprocess-report.js: 2015-02-19 Ryosuke Niwa Relationship between A/B testing results are unclear https://bugs.webkit.org/show_bug.cgi?id=141810 Reviewed by Andreas Kling. Show a "reference chart" indicating which two points have been tested in each test group pane. Now the chart shown at the top of an analysis task page is called the "overview pane", and we use the pane and the domain used in this chart to show charts in each test group. Also renamed an array of revisions used in the A/B test results tables from 'revisions' to 'revisionList'. * public/v2/analysis.js: (App.TestGroup._fetchTestResults): Renamed from _fetchChartData. Set 'testResults' instead of 'chartData' since this is the results of A/B testing results, not the data for charts shown next to them. * public/v2/app.css: Added CSS rules for reference charts. * public/v2/app.js: (App.AnalysisTaskController.paneDomain): Set 'overviewPane' and 'overviewDomain' on each test group pane. (App.TestGroupPane._populate): Updated per 'chartData' to 'testResults' rename. (App.TestGroupPane._updateReferenceChart): Get the chart data via the overview pane and find points that identically matches root sets. If one of configuration used a set of revisions for which no measurement was made in the original chart, don't show the reference chart as that would be misleading / confusing. (App.TestGroupPane._computeRepositoryList): Updated per 'chartData' to 'testResults' rename. (App.TestGroupPane._createConfigurationSummary): Ditto. Also renamed 'revisions' to 'revisionList'. In addition, renamed 'buildNumber' to 'buildLabel' and prefixed it with "Build ". * public/v2/data.js: (Measurement.prototype.revisionForRepository): Added. (Measurement.prototype.commitTimeForRepository): Cleanup. (TimeSeries.prototype.findPointByRevisions): Added. Finds a point based on a set of revisions. * public/v2/index.html: Added the reference chart. Streamlined the status label for each build request by including the build number in the title attribute instead of in the markup. * public/v2/interactive-chart.js: (App.InteractiveChartComponent._updateDomain): Fixed a typo introduced as a consequence of r179913. (App.InteractiveChartComponent._computeYAxisDomain): Expand the y-axis to show the highlighted points. (App.InteractiveChartComponent._highlightedItemsChanged): Adjust the y-axis as needed. 2015-02-18 Ryosuke Niwa Analysis task pages are unusable https://bugs.webkit.org/show_bug.cgi?id=141786 Reviewed by Andreas Kling. This patch makes following improvements to analysis task pages: 1. Making the main chart interactive. This change required the use of App.Pane as well as moving the code to compute the data for the details pane from PaneController. 2. Moving the form to add a new test group to the top of test groups instead of the bottom of them. 3. Grouping the build requests in each test group by root sets instead of the order by which they were ran. This change required the creation of App.TestGroupPane as well as its methods. 4. Show a box plot for each root set configuration as well as each build request. This change required App.BoxPlotComponent. 5. Show revisions of each repository (e.g. WebKit) for each root set and build request. * public/api/build-requests.php: (main): Update per the rename of BuildRequestsFetcher::root_sets to BuildRequestsFetcher::root_sets_by_id. * public/api/test-groups.php: (main): Include root sets and roots in the response. (format_test_group): * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::root_sets_by_id): Renamed from root_sets. (BuildRequestsFetcher::root_sets): Added. (BuildRequestsFetcher::roots): Added. (BuildRequestsFetcher::fetch_roots_for_set): Takes a boolean argument $resolve_ids. This flag is only set to true in /api/build-requests/ (as done prior to this patch) to use repository names as identifiers since tools/sync-with-buildbot.py can't convert repository names to their ids. * public/v2/analysis.js: (App.Root): Added. (App.RootSet): Added. (App.RootSet.revisionForRepository): Added. (App.TestGroup.rootSets): Deleted the code to compute root set ids from build requests now that the JSON response at /api/test-groups will include them. (App.BuildRequest): Ditto. Also deleted 'configLetter' property, which has been moved to a proxy created by _createConfigurationSummary. (App.BuildRequest.statusLabel): Use 'Completed' as the human readable label for 'completed' status. (App.BuildRequest.aggregateStatuses): Added. Generates a human readable status for a set of build requests. * public/v2/app.css: Updated style rules for analysis task pages. * public/v2/app.js: (App.Pane): This class is now used in analysis task pages to make the main chart interactive. (App.Pane._updateDetails): Moved from App.PaneController. (App.PaneController._updateCanAnalyze): Updated the code per the move of selectedPoints. (App.AnalysisTaskController): Added 'details'. (App.AnalysisTaskController._taskUpdated): (App.AnalysisTaskController.paneDomain):Renamed from _fetchedRuns. (App.AnalysisTaskController.updateTestGroupPanes): Added. Creates App.TestGroupPane for each test group. (App.AnalysisTaskController.actions.toggleShowRequestList): Added. (App.TestGroupPane): Added. (App.TestGroupPane._populate): Added. Group build requests by root sets and create a summary for each group. (App.TestGroupPane._computeRepositoryList): Added. Returns a sorted list of repositories which is the union of all repositories appearing in root sets and builds associated with A/B testing results. (App.TestGroupPane._groupRequestsByConfigurations): Added. Groups build requests by root sets. (App.TestGroupPane._createConfigurationSummary): Added. Creates a summary for a group of build requests that use the same root set. We start by wrapping "raw" build requests in a proxy with formatted values, build numbers, etc... obtained from the fetched chart data. The list of revisions shown in the group summary is a union of revisions in the root set and the first build request in the group. We null-out revision info for a build request if it is identical to the one in the summary. The range of values is expanded as needed by the values in the group as well as 95% percentile confidence interval. (App.BoxPlotComponent): Added. Controls a box plot shown for each test group summary and build request. (App.BoxPlotComponent.didInsertElement): Added. Inserts a SVG element as well as two indicator rects to show the mean and the confidence interval. (App.BoxPlotComponent._updateBars): Added. Updates the dimensions of the indicator rects. (App.BoxPlotComponent.valueChanged): Added. Computes the relative dimensions of the indicator rects and calls _updateBars to update the rects. * public/v2/chart-pane.css: Added some style rules to be used in the details pane in analysis task pages. * public/v2/data.js: (Measurement.prototype.formattedRevisions): (Measurement.formatRevisionRange): Renamed from Measurement.prototype._formatRevisionRange so that it can be called in _createConfigurationSummary. * public/v2/index.html: Updated the templates for analysis task pages. Moved the form to create a new test group above all test groups, and replaced the list of data points by "details" pane used in the charts page. Also made the fetching of chartData no longer block showing of test groups. * public/v2/interactive-chart.js: (App.InteractiveChartComponent._updateDomain): Added an early exit to fix a newly revealed race condition. (App.InteractiveChartComponent._domainChanged): Ditto. (App.InteractiveChartComponent._updateSelectionToolbar): Made it respect 'zoomable' boolean property. * public/v2/js/statistics.js: (Statistics.min): Added. (Statistics.max): Added. * public/v2/manifest.js: (App.Manifest.fetchRunsWithPlatformAndMetric): Added formatWithDeltaAndUnit to be used in _createConfigurationSummary. 2015-02-14 Ryosuke Niwa Build URL on new perf dashboard doesn't resolve $builderName https://bugs.webkit.org/show_bug.cgi?id=141583 Reviewed by Darin Adler. Support $builderName in the build URL template. * public/js/helper-classes.js: (TestBuild.buildUrl): Replaced $builderName with the builder name. * public/v2/manifest.js: (App.Metric.fullName): Fixed the typo. We need &ni, not &in. (App.BuilderurlFromBuildNumber): Replaced $builderName with the builder name. 2015-02-13 Ryosuke Niwa Unreviewed build fix after r179591. * public/api/commits.php: 2015-02-13 Ryosuke Niwa The status of a A/B testing request always eventually becomes "Failed" https://bugs.webkit.org/show_bug.cgi?id=141523 Reviewed by Andreas Kling. The bug was caused by /api/build-requests always setting the status of a build request to 'failed' when 'failedIfNotCompleted' was sent by the buildbot sync'er. Fixed the bug by only setting the status to 'failed' if it wasn't set to 'completed'. * public/api/build-requests.php: (main): 2015-02-13 Csaba Osztrogonác Unreviewed, remove empty directories. * public/data: Removed. 2015-02-12 Ryosuke Niwa Perf dashboard should show the results of A/B testing https://bugs.webkit.org/show_bug.cgi?id=141500 Reviewed by Chris Dumez. Added the support for fetching test_runs for a specific test group in /api/runs/, and used it in the analysis task page to fetch results for each test group. Merged App.createChartData into App.Manifest.fetchRunsWithPlatformAndMetric so that App.BuildRequest can use the formatter. * public/api/runs.php: (fetch_runs_for_config_and_test_group): Added. (fetch_runs_for_config): Just return the fetched rows since main will format them with RunsGenerator. (main): Use fetch_runs_for_config_and_test_group to fetch rows when a test group id is specified. Also use RunsGenerator to format results. (RunsGenerator): Added. (RunsGenerator::__construct): Added. (RunsGenerator::add_runs): Added. (RunsGenerator::format_run): Moved. (RunsGenerator::parse_revisions_array): Moved. * public/v2/analysis.js: (App.TestGroup): Fixed a typo. The property on a test group that refers to an analysis task is "task". (App.TestGroup._fetchChartData): Added. Fetches all A/B testing results for this group. (App.BuildRequest.configLetter): Renamed from config since this returns a letter that identifies the configuration associated with this build request such as "A" and "B". (App.BuildRequest.statusLabel): Added the missing label for failed build requests. (App.BuildRequest.url): Added. Returns the URL associated with this build request. (App.BuildRequest._meanFetched): Added. Retrieve the mean and the build number for this request via _fetchChartData. * public/v2/app.js: (App.Pane._fetch): Set chartData directly here. (App.Pane._updateMovingAverageAndEnvelope): Renamed from _computeChartData. No longer sets chartData now that it's done in App.Pane._fetch. (App.AnalysisTaskController._fetchedRuns): Updated per createChartData merge. * public/v2/data.js: (Measurement.prototype.buildId): Added. (TimeSeries.prototype.findPointByBuild): Added. * public/v2/index.html: Fixed a bug that build status URL was broken. We can't use link-to helper since url is not an Ember routed path. * public/v2/manifest.js: (App.Manifest.fetchRunsWithPlatformAndMetric): Takes testGroupId as the third argument. Merged App.createChartData here so that App.BuildRequest can use the formatter 2015-02-12 Ryosuke Niwa v2 UI should adjust the number of ticks on dashboards based on screen size https://bugs.webkit.org/show_bug.cgi?id=141502 Reviewed by Chris Dumez. * public/v2/interactive-chart.js: (App.InteractiveChartComponent._updateDimensionsIfNeeded): Compute the number of ticks based on the content size. 2015-02-11 Ryosuke Niwa New perf dashboard shows too much space around interesting data points https://bugs.webkit.org/show_bug.cgi?id=141487 Reviewed by Chris Dumez. Revise the y-axis range adjustment algorithm in r179913. Instead of showing the entire moving average, show the current time series excluding points in the series outside the moving average envelope. * public/v2/app.js: (App.Pane._computeChartData): Don't deal with missing moving average or enveloping strategy here. (App.Pane._computeMovingAverageAndOutliers): Set isOutliner to true on all data points in the current time series if the point lies outside the moving average envelope. Don't expose the moving average or the envelope computed for this purpose if they're not set by the user. * public/v2/data.js: (TimeSeries.prototype.minMaxForTimeRange): Takes a boolean argument, ignoreOutlier. When the flag is set to true, min/max computation will ignore any point in the series with non-falsy "isOutliner" property. * public/v2/interactive-chart.js: (App.InteractiveChartComponent._constructGraphIfPossible): Unsupport hideMovingAverage and hideEnvelope. (App.InteractiveChartComponent._computeYAxisDomain): Removed the commented out code. Also moved the code to deal with showFullYAxis here. (App.InteractiveChartComponent._minMaxForAllTimeSeries): Rewrote the code. Takes ignoreOutliners as an argument instead of directly inspecting showFullYAxis. 2015-02-10 Ryosuke Niwa New perf dashboard shouldn't always show outliners https://bugs.webkit.org/show_bug.cgi?id=141445 Reviewed by Chris Dumez. Use the simple moving average with an average difference envelope to compute the y-axis range to show to avoid expanding it spuriously to show one off outlier. * public/v2/app.js: (App.Pane): Don't show the full y-axis range by default. (App.Pane._computeChartData): Use the first strategies for the moving average and the enveloping if one is not specified by the user but without showing them in the charts. (App.Pane._computeMovingAverage): Takes moving average and enveloping strategies as arguments instead of retrieving via chosenMovingAverageStrategy and chosenEnvelopingStrategy. (App.ChartsController._parsePaneList): Added showFullYAxis as a query string argument to each pane. (App.ChartsController._serializePaneList): Ditto. * public/v2/chart-pane.css: Added a CSS rule for when y-axis is clickable. * public/v2/index.html: Pass in showFullYAxis as an argument to the main interactive chart. * public/v2/interactive-chart.js: (App.InteractiveChartComponent._constructGraphIfPossible): Add an event listener on y-axis labels when the chart is interactive so that toggle showFullYAxis. Also hide the moving average and/or the envelope if they are not specified by the user (i.e. only used to adjust y-axis range). (App.InteractiveChartComponent._updateDomain): Don't exit early if y-axis domains are different even if x-axis domain remained the same. Without this change, the charts would never redraw. (App.InteractiveChartComponent._minMaxForAllTimeSeries): Use the moving average instead of the current time series to compute the y-axis range if showFullYAxis is false. When showFullYAxis is true, expand y-axis all the way down to 0 or the minimum value in the current time series whichever is smaller. * public/v2/js/statistics.js: (Statistics.MovingAverageStrategies): Use a wider window in Simple Moving Average by default. 2015-02-10 Ryosuke Niwa Unreviewed build fix. * public/v2/app.js: (set get App.Pane.Ember.Object.extend): 2015-02-10 Ryosuke Niwa New perf dashboard should have the ability to overlay moving average with an envelope https://bugs.webkit.org/show_bug.cgi?id=141438 Reviewed by Andreas Kling. This patch adds three kinds of moving average strategies and two kinds of enveloping strategies: Simple Moving Average - The moving average x̄_i of x_i is computed as the arithmetic mean of values from x_(i - n) though x_(i + m) where n is a non-negative integer and m is a positive integer. It takes n, backward window size, and m, forward window size, as an argument. Cumulative Moving Average - x̄_i is computed as the arithmetic mean of all values x_0 though x_i. That is, x̄_1 = x_1 and x̄_i = ((i - 1) * M_(i - 1) + x_i) / i for all i > 1. Exponential Moving Average - x̄_i is computed as the weighted average of x_i and x̄_(i - 1) with α as an argument specifying x_i's weight. To be precise, x̄_1 = x_1 and x̄_i = α * x_i + (α - 1) x̄_(i-1). Average Difference - The enveloping delta d is computed as the arithmetic mean of the difference between each x_i and x̄_i. Moving Average Standard Deviation - d is computed like the standard deviation except the deviation for each term is measured from the moving average instead of the sample arithmetic mean. i.e. it uses the average of (x_i - x̄_i)^2 as the "sample variance" instead of the conventional (x_i - x̄)^2 where x̄ is the sample mean of all x_i's. This change was necessary since our time series is non-stationary. Each strategy is cloned for an App.Pane instance so that its parameterList can be configured per pane. The configuration of the currently chosen strategies is saved in the query string for convenience. Also added the "stat pane" to choose a moving average strategy and a enveloping strategy in each pane. * public/v2/app.css: Specify the fill color for all SVG groups in the pane toolbar icons. * public/v2/app.js: (App.Pane._fetch): Delegate the creation of 'chartData' to _computeChartData. (App.Pane.updateStatisticsTools): Added. Clones moving average and enveloping strategies for this pane. (App.Pane._cloneStrategy): Added. Clones a strategy for a new pane. (App.Pane._configureStrategy): Added. Finds and configures a strategy from the configuration retrieved from the query string via ChartsController. (App.Pane._computeChartData): Added. Creates chartData from fetchedData. (App.Pane._computeMovingAverage): Added. Computes the moving average and the envelope. (App.Pane._executeStrategy): Added. (App.Pane._updateStrategyConfigIfNeeded): Pushes the strategy configurations to the query string via ChartsController. (App.ChartsController._parsePaneList): Merged the query string arguments for the range and point selections, and added two new arguments for the moving average and the enveloping configurations. (App.ChartsController._serializePaneList): Ditto. (App.ChartsController._scheduleQueryStringUpdate): Observes strategy configurations. (App.PaneController.actions.toggleBugsPane): Hides the stat pane. (App.PaneController.actions.toggleSearchPane): Hides the stat pane. (App.PaneController.actions.toggleStatPane): Added. * public/v2/chart-pane.css: Added CSS rules for the new stat pane. Also added .foreground class for the current (as opposed to baseline and target) time series for when it's the most foreground graph without moving average and its envelope overlapping on top of it. * public/v2/index.html: Added the templates for the stat pane and the corresponding icon (Σ). * public/v2/interactive-chart.js: (App.InteractiveChartComponent.chartDataDidChange): Unset _totalWidth and _totalHeight to avoid exiting early inside _updateDimensionsIfNeeded when chartData changes after the initial layout. (App.InteractiveChartComponent.didInsertElement): Attach event listeners here instead of inside _constructGraphIfPossible since that could be called multiple times on the same SVG element. (App.InteractiveChartComponent._constructGraphIfPossible): Clear down the old SVG element we created but don't bother removing individual paths and circles. Added the code to show the moving average time series when there is one. Also add "foreground" class on SVG elements for the current time series when we're not showing the moving average. chart-pane.css has been updated to "dim down" the current time series when "foreground" is not set. (App.InteractiveChartComponent._minMaxForAllTimeSeries): Take the moving average time series into account when computing the y-axis range. (App.InteractiveChartComponent._brushChanged): Removed 'selectionIsLocked' argument as it's useless. * public/v2/js/statistics.js: (Statistics.MovingAverageStrategies): Added. (Statistics.EnvelopingStrategies): Added. 2015-02-06 Ryosuke Niwa The delta value in the chart pane sometimes doens't show '+' for a positive delta https://bugs.webkit.org/show_bug.cgi?id=141340 Reviewed by Andreas Kling. The bug was caused by computeStatus prefixing the value delta with '+' if it's greater than 0 after it had already been formatted. Fixed the bug by using a formatter that always emits a sign symbol. * public/v2/app.js: (App.Pane.computeStatus): (App.createChartData): 2015-02-06 Ryosuke Niwa Unreviewed build fix. currentPoint wasn't defined when selectedPoints was used to find points. * public/v2/app.js: (App.PaneController._updateDetails): 2015-02-06 Ryosuke Niwa Unreviewed. Commit the forgotten change. * public/include/manifest.php: 2015-02-06 Ryosuke Niwa New perf dashboard should have multiple dashboard pages https://bugs.webkit.org/show_bug.cgi?id=141339 Reviewed by Chris Dumez. Added the support for multiple dashboard pages. Also added the status of the latest data point. e.g. "5% better than target" * public/v2/app.css: Tweaked the styles to work around the fact Ember.js creates empty script elements. Also hid the border lines around charts on the dashboard page for a cleaner look. * public/v2/app.js: (App.IndexRoute): Added. Navigate to /dashboard/ once the manifest.json is loaded. (App.IndexRoute.beforeModel): Added. (App.DashboardRoute): Added. (App.DashboardRoute.model): Added. Return the dashboard specified by the name. (App.CustomDashboardRoute): Added. This route is used for a customized dashboard specified by "grid". (App.CustomDashboardRoute.model): Create a dashboard model from "grid" query parameter. (App.CustomDashboardRoute.renderTemplate): Use the dashboard template. (App.DashboardController): Renamed from App.IndexController. (App.DashboardController.modelChanged): Renamed from gridChanged. Removed the code to deal with "grid" and "defaultDashboard" as these are taken care of by newly added routers. (App.DashboardController.computeGrid): Renamed from updateGrid. No longer updates "grid" since this is now done in actions.toggleEditMode. (App.DashboardController.actions.toggleEditMode): Navigate to CustomDashboardRoute when start editing an existing dashboard. (App.Pane.computeStatus): Moved from App.PaneController so that to be called in App.Pane.latestStatus. Also moved the code to compute the delta with respect to the previous data point from _updateDetails. (App.Pane._relativeDifferentToLaterPointInTimeSeries): Ditto. (App.Pane.latestStatus): Added. Used by the dashboard template to show the status of the latest result. (App.createChartData): Added deltaFormatter to show less significant digits for differences. (App.PaneController._updateDetails): Updated per changes to computeStatus. * public/v2/chart-pane.css: Added style rules for the status labels on the dashboard. * public/v2/data.js: (TimeSeries.prototype.lastPoint): Added. * public/v2/index.html: Prefetch manifest.json as soon as possible, show the latest data points' status on the dashboard, and enumerate all predefined dashboards. * public/v2/interactive-chart.js: (App.InteractiveChartComponent._relayoutDataAndAxes): Slightly adjust the offset at which we show unit for the dashboard page. * public/v2/manifest.js: (App.Dashboard): Inherit from App.NameLabelModel now that each predefined dashboard has a name. (App.MetricSerializer.normalizePayload): Parse all predefined dashboards instead of a single dashboard. IDs are generated for each dashboard for forward compatibility. (App.Manifest): (App.Manifest.dashboardByName): Added. (App.Manifest.defaultDashboardName): Added. (App.Manifest._fetchedManifest): Create dashboard model objects for all predefined ones. 2015-02-05 Ryosuke Niwa Move commits viewer to the end of details view https://bugs.webkit.org/show_bug.cgi?id=141315 Rubber-stamped by Andreas Kling. Show the difference instead of the old value per kling's request. * public/v2/app.js: (App.PaneController._updateDetails): * public/v2/index.html: 2015-02-05 Ryosuke Niwa Move commits viewer to the end of details view https://bugs.webkit.org/show_bug.cgi?id=141315 Reviewed by Andreas Kling. Improved the way list of commits are shown per kling's request. * public/v2/app.js: (App.PaneController._updateDetails): Always show the old value even when a single point is selected. * public/v2/chart-pane.css: Updated the style for the commits viewer. * public/v2/commits-viewer.js: (App.CommitsViewerComponent): Added "visible" property to hide the list of commits. (App.CommitsViewerComponent.actions.toggleVisibility): Added. Toggles "visible" property. * public/v2/index.html: Updated the template for commits viewer to support "visible" property. Also moved the commits viewers out of the details tables so that they don't interleave revision data. 2015-02-05 Ryosuke Niwa New perf dashboard should compare results to baseline and target https://bugs.webkit.org/show_bug.cgi?id=141286 Reviewed by Chris Dumez. Compare the selected value against baseline and target values as done in v1. e.g. "5% below target" Also use d3.format to format the selected value to show four significant figures. * public/v2/app.js: (App.Pane.searchCommit): (App.Pane._fetch): Create time series here via createChartData so that _computeStatus can use them to compute the status text without having to recreate them. (App.createChartData): Added. (App.PaneController._updateDetails): Use 3d.format on current and old values. (App.PaneController._computeStatus): Added. Computes the status text. (App.PaneController._relativeDifferentToLaterPointInTimeSeries): Added. (App.AnalysisTaskController._fetchedManifest): Use createChartData as done in App.Pane._fetch. Also format the values using chartData.formatter. * public/v2/chart-pane.css: Enlarge the status text. Show the status text in red if it's worse than the baseline and in blue if it's better than the target. * public/v2/data.js: (TimeSeries.prototype.findPointAfterTime): Added. * public/v2/index.html: Added a new tbody for the status text and the selected value. Also fixed the bug that we were not showing the old value's unit. * public/v2/interactive-chart.js: (App.InteractiveChartComponent._constructGraphIfPossible): Use chartData.formatter. Also cleaned up the code to show the baseline and the target lines. * public/v2/manifest.js: (App.Manifest.fetchRunsWithPlatformAndMetric): Added smallerIsBetter. 2015-02-05 Ryosuke Niwa Unreviewed build fix. * public/v2/app.js: (App.IndexController.gridChanged): Use store.createRecord to create a custom dashboard as required by Ember.js 2015-02-04 Ryosuke Niwa New perf dashboard doesn't preserve the number of days when clicking on a dashboard chart https://bugs.webkit.org/show_bug.cgi?id=141280 Reviewed by Chris Dumez. Fixed the bug by passing in "since" as a query parameter to the charts page. Also fixed the styling issue that manifests when a JSON fetching fails on "Dashboard" page. * public/v2/app.css: Fixed CSS rules for error messages shown in the place of charts. * public/v2/app.js: (App.IndexController): Changed the default number of days from one month to one week. (App.IndexController._sharedDomainChanged): Set "since" property on the controller. * public/v2/index.html: Pass in "since" property on the controller as a query parameter. 2015-02-04 Ryosuke Niwa New perf dashboard erroneously clears zoom when poping history items https://bugs.webkit.org/show_bug.cgi?id=141278 Reviewed by Chris Dumez. The bug was caused by _sharedZoomChanged updating overviewSelection without updating mainPlotDomain. Updating overviewSelection resulted in _overviewSelectionChanged, which observes changes to overviewSelection, to schedule a call to propagateZoom, which in turn overrode "sharedZoom" we just parsed from the query string. * public/v2/app.js: (App.PaneController._overviewSelectionChanged): Don't schedule propagateZoom if the selected domain is already shown in the main plot. (App.PaneController._sharedZoomChanged): Set both overviewSelection and mainPlotDomain to avoid overriding "sharedZoom" via propagateZoom inside _overviewSelectionChanged. 2015-02-04 Ryosuke Niwa New perf dashboard shows null as the aggregator name if no aggregation is done https://bugs.webkit.org/show_bug.cgi?id=141256 Reviewed by Chris Dumez. Don't show the aggregator name if there isn't one. * public/v2/manifest.js: (App.Metric.label): 2015-02-04 Ryosuke Niwa Unreviewed build fix after r179611. * public/v2/interactive-chart.js: 2015-02-04 Ryosuke Niwa Perf dashboard doesn’t show the right unit for Safari UI tests https://bugs.webkit.org/show_bug.cgi?id=141238 Reviewed by Darin Adler. Safari UI tests use custom metrics that end with "Time". This patch teaches the perf dashboard how to get the unit for a given metric based on the suffix of the metric name instead of hard-coding the mapping between metrics and their units. * public/js/helper-classes.js: (PerfTestRuns): Use the suffix of the metric name to compute the unit. * public/v2/manifest.js: (App.Manifest.fetchRunsWithPlatformAndMetric): Ditto. Also set "useSI" property iff for "bytes". * public/v2/interactive-chart.js: (App.InteractiveChartComponent._constructGraphIfPossible): Respect useSI. Use toPrecision(3) otherwise. (App.InteractiveChartComponent._relayoutDataAndAxes): Place the unit vertically on the left of ticks. 2015-02-04 Ryosuke Niwa Interactive chart component provides two duplicate API for highlighting points https://bugs.webkit.org/show_bug.cgi?id=141234 Reviewed by Chris Dumez. Prior to this patch, the interactive chart component supported highlightedItems for finding commits on the main charts page and markedPoints to show the two end points in the analysis task page. This patch merges markedPoints into highlightedItems. * public/v2/app.js: (App.AnalysisTaskController._fetchedRuns): Use highlightedItems. * public/v2/chart-pane.css: * public/v2/index.html: Ditto. * public/v2/interactive-chart.js: (App.InteractiveChartComponent._constructGraphIfPossible): Make this._highlights an array instead of array of arrays. Also call _highlightedItemsChanged at the end to fix the bug that we never highlight items if highlightedItems was set before the initial layout. (App.InteractiveChartComponent._relayoutDataAndAxes): (App.InteractiveChartComponent._updateHighlightPositions): Now that highlights are circles instead of vertical lines, just set cx and cy as done for other "dots". (App.InteractiveChartComponent._highlightedItemsChanged): Exit early only if _clippedContainer wasn't already set; i.e. _constructGraphIfPossible hasn't been called. Also updated the logic to accommodate the fact this._highlights is an array of elements instead of an array of arrays of elements. Finally, set the radius of highlight circles here. 2015-02-03 Ryosuke Niwa Don’t use repository names as id’s. https://bugs.webkit.org/show_bug.cgi?id=141226 Reviewed by Chris Dumez. Not using repository names as their id's reduces the need to fetch the entire repositories table. Since names of repositories are available in manifest.json, we can resolve their names in the front end. * Websites/perf.webkit.org/public/api/runs.php: (parse_revisions_array): No longer uses $repository_id_to_name. (main): No longer populates $repository_id_to_name. * Websites/perf.webkit.org/public/api/triggerables.php: (main): Don't resolve repository names. * Websites/perf.webkit.org/public/include/manifest.php: (ManifestGenerator::repositories): Use repositories ids as keys in the result and include their names. (ManifestGenerator::bug_trackers): Don't resolve repository names. * Websites/perf.webkit.org/public/js/helper-classes.js: (TestBuild): Renamed repositoryName to repositoryId. (TestBuild.revision): Ditto. (TestBuild.formattedRevisions): Ditto. Continue to use the repository name in the formatted result since this is the text shown to human. * Websites/perf.webkit.org/public/v2/app.js: (App.pane.searchCommit): Renamed repositoryName to repositoryId. (App.PaneController._updateDetails): Ditto. (App.AnalysisTaskController.updateRoots): Ditto. * Websites/perf.webkit.org/public/v2/data.js: (Measurement): Ditto. (Measurement.prototype.commitTimeForRepository): Ditto. (Measurement.prototype.formattedRevisions): Ditto. * Websites/perf.webkit.org/public/v2/index.html: Use the repository name and the repository id as select element's label and value respectively. 2015-02-03 Ryosuke Niwa Unreviewed build fix. Declare $repository_id_to_name in the global scope. * public/api/runs.php: 2015-02-03 Ryosuke Niwa /api/runs.php should have main function https://bugs.webkit.org/show_bug.cgi?id=141220 Reviewed by Benjamin Poulain. Wrapped the code inside main function for clarity. * public/api/runs.php: 2015-01-27 Ryosuke Niwa Unreviewed build fix. "eta" isn't set on a in-progress build on a newly added builder. * tools/sync-with-buildbot.py: (find_request_updates): 2015-01-23 Ryosuke Niwa Perf dashboard always assigns the result of A/B testing with build request 1 https://bugs.webkit.org/show_bug.cgi?id=140382 Reviewed by Darin Adler. The bug was caused by the expression array_get($report, 'jobId') or array_get($report, 'buildRequest') which always evaluated to 1 when the report contained jobId. Fixed the bug by cascading array_get instead. Also fixed a typo as well as a bug that reports were never associated with builds. * public/include/report-processor.php: (ReportProcessor::process): Don't use "or" to find the non-null value since that always evaluates to 1 instead of the first non-null value. (ReportProcessor::resolve_build_id): Fixed the typo by adding the missing "$this->". (ReportProcessor::commit): Associate the report with the corresponding build as intended. 2015-01-23 Ryosuke Niwa Unreviewed typo fix. The prefix in triggerable_configurations is "trigconfig", not "trigrepo". * public/admin/tests.php: 2015-01-10 Ryosuke Niwa Unreviewed build fix. Removed the stale code. * public/admin/triggerables.php: 2015-01-09 Ryosuke Niwa Perf dashboard should have the ability to post A/B testing builds https://bugs.webkit.org/show_bug.cgi?id=140317 Rubber-stamped by Simon Fraser. This patch adds the support for triggering A/B testing from the perf dashboard. We add a few new tables to the database. "build_triggerables", which represents a set of builders that accept A/B testing. "triggerable_repositories" associates each "triggerable" with a fixed set of repositories for which an arbitrary revision can be specified for A/B testing. "triggerable_configurations" specifies a triggerable available on a given test on a given platform. "roots" table which specifies the revision used in a given root set in each repository. * init-database.sql: Added "build_triggerables", "triggerable_repositories", "triggerable_configurations", and "roots" tables. Added references to "build_triggerables", "platforms", and "tests" tables as well as columns to store status, status url, and creation time to build_requests table. Also made each test group's name unique in a given analysis task as it would be confusing to have multiple test groups of the same name. * public/admin/tests.php: Added the UI and the code to associate a test with a triggerable. * public/admin/triggerables.php: Added. Manages the list of triggerables as well as repositories for which a specific revision can be set in an A/B testing on a given triggerable. * public/api/build-requests.php: Added. Returns the list of open build requests on a specified triggerable. Also updates the status' and the status urls of specified build requests when buildRequestUpdates is provided in the raw POST data. (main): * public/api/runs.php: (fetch_runs_for_config): Don't include results associated with a build request, meaning they are results of an A/B testing. * public/api/test-groups.php: (main): Use the newly added BuildRequestsFetcher. Also merged fetch_test_groups_for_task back. * public/api/triggerables.php: Added. (main): Returns a list of triggerables or a triggerable associated with a given analysis task. * public/include/admin-header.php: * public/include/build-requests-fetcher.php: Added. Extracted from public/api/test-groups.php. (BuildRequestsFetcher): This class abstracts the process of fetching a list of builds requests and root sets used in those requests.D (BuildRequestsFetcher::__construct): (BuildRequestsFetcher::fetch_for_task): (BuildRequestsFetcher::fetch_for_group): (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): (BuildRequestsFetcher::has_results): (BuildRequestsFetcher::results): (BuildRequestsFetcher::results_with_resolved_ids): (BuildRequestsFetcher::results_internal): (BuildRequestsFetcher::root_sets): (BuildRequestsFetcher::fetch_roots_for_set): * public/include/db.php: (Database::prefixed_column_names): Don't return "$prefix_" when there are no columns. (Database::insert_row): Support taking an empty array for values. This is useful in "root_sets" table since it only has the primary key, id, column. (Database::select_or_insert_row): (Database::update_or_insert_row): (Database::update_row): Added. (Database::_select_update_or_insert_row): Takes an extra argument specifying whether a new row should be inserted when no row matches the specified criteria. This is used while updating build_requests' status and url in public/api/build-requests.php since we shouldn't be inserting new build requests in that API. (Database::select_rows): Also use "1 == 1" in the select query when the query criteria is empty. This is used in public/api/triggerables.php when no analysis task is specified. * public/include/json-header.php: (find_triggerable_for_task): Added. Finds a triggerable available on a given test. We return the triggerable associated with the closest ancestor of the test. Since issuing a new query for each ancestor test is expensive, we retrieve triggerable for all ancestor tests at once and manually find the closest ancestor with a triggerable. * public/include/report-processor.php: (ReportProcessor::process): (ReportProcessor::resolve_build_id): Associate a build request with the newly created build if jobId or buildRequest is specified. * public/include/test-name-resolver.php: (TestNameResolver::map_metrics_to_tests): Store the entire metric row instead of its name so that test_exists_on_platform can use it. The last diff in public/admin/tests.php adopts this change. (TestNameResolver::test_exists_on_platform): Added. Returns true iff the test has ever run on a given platform. * public/include/test-path-resolver.php: Added. (TestPathResolver): This class abstracts the ancestor chains of a test. It retrieves the entire "tests" table to do this since there could be arbitrary number of ancestors for a given test. This class is a lot more lightweight than TestNameResolver, which retrieves a whole bunch of tables in order to compute full test metric names. (TestPathResolver::__construct): (TestPathResolver::ancestors_for_test): Returns the ordered list of ancestors from the closest to the highest (a test without a parent). (TestPathResolver::path_for_test): Returns a test "path", the ordered list of test names from the highest ancestor to the test itself. (TestPathResolver::ensure_id_to_test_map): Fetches "tests" table to construct id_to_test_map. * public/privileged-api/create-test-group.php: Added. An API to create A/B testing groups. (main): (commit_sets_from_root_sets): Given a dictionary of repository names to a pair of revisions for sets A and B respectively, returns a pair of arrays, each of which contains the corresponding set of "commits" for sets A and B respectively. e.g. {"WebKit": [1, 2], "Safari": [3, 4]} will result in [[WebKit commit at r1, Safari commit at r3], [WebKit commit at r2, Safari commit at r4]]. * public/v2/analysis.js: (App.AnalysisTask.testGroups): Takes arguments so that set('testGroups') will invalidate the cache. (App.AnalysisTask.triggerable): Added. Retrieves the triggerable associated with the task lazily. (App.TestGroup.rootSets): Added. Returns the list of root set ids used in this A/B testing group. (App.TestGroup.create): Added. Creates a new A/B testing group. (App.Triggerable): Added. (App.TriggerableAdapter): Added. (App.TriggerableAdapter.buildURL): Added. (App.BuildRequest.testGroup): Renamed from group. (App.BuildRequest.orderLabel): Added. One-based index to be used in labels. (App.BuildRequest.config): Added. Returns either 'A' or 'B' depending on the configuration used in this build request. (App.BuildRequest.status): Added. (App.BuildRequest.statusLabel): Added. Returns a human friendly label for the current status. (App.BuildRequest): Removed buildNumber, buildBuilder, as well as buildTime as they're unused. * public/v2/app.js: (App.AnalysisTaskController.testGroups): Added. (App.AnalysisTaskController.possibleRepetitionCounts): Added. (App.AnalysisTaskController.updateRoots): Renamed from roots. This is also no longer a property but an observer that updates "roots" property. Filter out the repositories that are not accepted by the associated triggerable as they will be ignored. (App.AnalysisTaskController.actions.createTestGroup): Added. * public/v2/index.html: Updated the UI, and added a form element to trigger createTestGroup action. * tools/sync-with-buildbot.py: Added. This scripts posts new builds on buildbot and reports back the status of those builds to the perf dashboard. A similar script can be written to support other continuous builds systems. (main): Fetches the list of pending builds as well as currently running or completed builds from a buildbot, and report new statuses of builds requests to the perf dashboard. It will then schedule a single new build on each builder with no pending builds, and marks the set of open build requests that have been scheduled to run on the buildbot but not found in the first step as stale. (load_config): Loads a JSON that contains the configurations for each builder. e.g. [ { "platform": "mac-mavericks", "test": ["Parser", "html5-full-render.html"], "builder": "Trunk Syrah Production Perf AB Tests", "arguments": { "forcescheduler": "force-mac-mavericks-release-perf", "webkit_revision": "$WebKit", "jobid": "$buildRequest" } } ] (find_request_updates): Return a list of build request status updates to make based on the pending builds as well as in-progress and completed builds on each builder on the buildbot. When a build is completed, we use the special status "failedIfNotCompleted" which results in "failed" status only if the build request had not been completed. This is necessary because a failed build will not report its failed-ness back to the perf dashboard in some cases; e.g. lost slave or svn up failure. (update_and_fetch_build_requests): Submit the build request status updates and retrieve the list of open requests the perf dashboard has. (find_stale_request_updates): Compute the list of build requests that have been scheduled on the buildbot but not found in find_request_updates. These build requests are lost. e.g. a master reboot or human canceling a build may trigger such a state. (schedule_request): Schedules a build with the arguments specified in the configuration JSON after replacing repository names with their revisions and buildRequest with the build request id. (config_for_request): Finds a builder for the test and the platform of a build request. (fetch_json): Fetches a JSON from the specified URL, optionally with BasicAuth. (property_value_from_build): Returns the value of a specific property in a buildbot build. (request_id_from_build): Returns the build request id of a given buildbot build if there is one. 2015-01-09 Ryosuke Niwa Cache-control should be set only on api/runs https://bugs.webkit.org/show_bug.cgi?id=140312 Reviewed by Andreas Kling. Some JSON APIs such as api/analysis-tasks can't be cached even for a short period of time (e.g. a few minutes) since they can be modified by the user on demand. Since only api/runs.php takes a long time to generate JSONs, just set cache-control there instead of json-header.php which is used by other JSON APIs. Also set date_default_timezone_set in db.php since we never use non-UTC timezone in our scripts. * public/api/analysis-tasks.php: * public/api/runs.php: Set the cache control headers. * public/api/test-groups.php: * public/include/db.php: Set the default timezone to UTC. * public/include/json-header.php: Don't set the cache control headers. 2015-01-09 Ryosuke Niwa api/report-commit should authenticate with a slave name and password https://bugs.webkit.org/show_bug.cgi?id=140308 Reviewed by Benjamin Poulain. Use a slave name and a password to authenticate new commit reports. * public/api/report-commits.php: (main): * public/include/json-header.php: (verify_slave): Renamed and repurposed from verify_builder in report-commits.php. Now authenticates with a slave name and a password instead of a builder name and a password. * tests/api-report-commits.js: Updated tests. * tools/pull-svn.py: (main): Renamed variables. (submit_commits): Submits slaveName and slavePassword instead of builderName and builderPassword. 2014-12-19 Ryosuke Niwa Perf dashboard should support authentication via a slave password https://bugs.webkit.org/show_bug.cgi?id=139837 Reviewed by Andreas Kling. For historical reasons, perf dashboard conflated builders and build slaves. As a result we ended up having to add multiple builders with the same password when a single build slave is shared among them. This patch introduces the concept of build_slave into the perf dashboard to end this madness. * init-database.sql: Added build_slave table as well as references to it in builds and reports. * public/admin/build-slaves.php: Added. * public/admin/builders.php: Added the support for updating passwords. * public/include/admin-header.php: (update_field): Takes an extra argument when a new value needs to be supplied by the caller instead of being retrieved from $_POST. (AdministrativePage::render_table): Use array_get to retrieve a value out of the database row since the raw may not exist (e.g. new_password). (AdministrativePage::render_form_to_add): Added the support for post_insertion. Don't render the form control here when this flag evaluates to TRUE. * public/include/report-processor.php: (ReportProcessor::process): Added the logic to authenticate with slaveName and slavePassword if those values are present in the report. In addition, try authenticating builderName with slavePassword if builderPassword is not specified. When neither password is specified, exit with BuilderNotFound. Also insert the slave or the builder whichever is missing after we've successfully authenticated. (ReportProcessor::construct_build_data): Takes a builder ID and an optional slave ID instead of a builder row. (ReportProcessor::store_report): Store the slave ID with the report. (ReportProcessor::resolve_build_id): Exit with MismatchingBuildSlave when the slave associated with the matching build is different from what's being reported. * tests/api-report.js: Added a bunch of tests to test the new features of /api/report. (.addSlave): Added. 2014-12-18 Ryosuke Niwa New perf dashboard should not duplicate author information in each commit https://bugs.webkit.org/show_bug.cgi?id=139756 Reviewed by Darin Adler. Instead of each commit having author name and email, make it reference a newly added committers table. Also replace "email" by "account" since some repositories don't use emails as account names. This improves the keyword search performance in commits.php since LIKE now runs on committers table, which only contains as many rows as there are accounts in each repository, instead of commits table which contains every commit ever happened in each repository. To migrate an existing database into match the new schema, run: BEGIN; INSERT INTO committers (committer_repository, committer_name, committer_email) (SELECT DISTINCT commit_repository, commit_author_name, commit_author_email FROM commits WHERE commit_author_email IS NOT NULL); ALTER TABLE commits ADD COLUMN commit_committer integer REFERENCES committers ON DELETE CASCADE; UPDATE commits SET commit_committer = committer_id FROM committers WHERE commit_repository = committer_repository AND commit_author_email = committer_email; ALTER TABLE commits DROP COLUMN commit_author_name CASCADE; ALTER TABLE commits DROP COLUMN commit_author_email CASCADE; COMMIT; * init-database.sql: Added committers table, and replaced author columns in commits table by a foreign reference to committers. Also added the missing drop table statements. * public/api/commits.php: (main): Fetch the corresponding committers row for a single commit. Also wrap a single commit by an array here instead of doing it in format_commit. (fetch_commits_between): Updated queries to JOIN commits with committers. (format_commit): Takes both commit and committers rows. Also don't wrap the result in an array as that is now done in main. * public/api/report-commits.php: (main): Store the reported committer information or update the existing entry if there is one. * tests/admin-regenerate-manifest.js: Fixed tests. * tests/api-report-commits.js: Ditto. Also added a test for updating an existing committer entry. * tools/pull-svn.py: Renamed email to account. (main): (fetch_commit_and_resolve_author): (fetch_commit): (resolve_author_name_from_account): (resolve_author_name_from_email): Deleted. 2014-12-17 Ryosuke Niwa Unreviewed build fix. * public/v2/index.html: Include js files we extracted in r177424. 2014-12-16 Ryosuke Niwa Unreviewed. Adding the forgotten svnprop. * tools/pull-svn.py: Added property svn:executable. 2014-12-16 Ryosuke Niwa Split InteractiveChartComponent and CommitsViewerComponent into separate files https://bugs.webkit.org/show_bug.cgi?id=139716 Rubber-stamped by Benjamin Poulain. Refactored InteractiveChartComponent and CommitsViewerComponent out of app.js into commits-viewer.js and interactive-chart.js respectively since app.js has gotten really large. * public/v2/app.js: * public/v2/commits-viewer.js: Added. * public/v2/interactive-chart.js: Added. 2014-12-02 Ryosuke Niwa New perf dashboard's chart UI is buggy https://bugs.webkit.org/show_bug.cgi?id=139214 Reviewed by Chris Dumez. The bugginess was caused by weird interactions between charts and panes. Rewrote the code to fix it. Superfluous selectionChanged and domainChanged "event" actions were removed from the interactive chart component. This is not how Ember.js components should interact to begin with. The component now exposes selectedPoints and always updates selection instead of sharedSelection. * public/v2/app.js: (App.ChartsController.present): Added. We can't call Date.now() in various points in our code as that would lead to infinite mutual recursions since X-axis domain values wouldn't match up. (App.ChartsController.updateSharedDomain): This function was completely useless. The overview's start and end time should be completely determined by "since" and the present time. (App.ChartsController._startTimeChanged): Ditto. (App.ChartsController._scheduleQueryStringUpdate): (App.ChartsController._updateQueryString): Set "zoom" only if it's different from the shared domain. (App.domainsAreEqual): Moved from InteractiveChartComponent._xDomainsAreSame. (App.PaneController.actions.createAnalysisTask): Use selectedPoints property set by the chart. (App.PaneController.actions.overviewDomainChanged): Removed; only needed to call updateSharedDomain. (App.PaneController.actions.rangeChanged): Removed. _showDetails (renamed to _updateDetails) directly observes the changes to selectedPoints property as it gets updated by the main chart. (App.PaneController._overviewSelectionChanged): This was previously a dead code. Now it's used again with a bug fix. When the overview selection is cleared, we use the same domain in the main chart and the overview chart. (App.PaneController._sharedDomainChanged): Fixed a but that it erroneously updates the overview domain when domain arrays aren't identical. This was causing a subtle race with other logic. (App.PaneController._sharedZoomChanged): Ditto. Also don't set mainPlotDomain here as any changes to overviewSelection will automatically propagate to the main plot's domain as they're aliased. (App.PaneController._currentItemChanged): Merged into _updateDetails (renamed from _showDetails). (App.PaneController._updateDetails): Previously, this function took points and inspected _hasRange to see if those two points correspond to a range or a single data point. Rewrote all that logic by directly observing selectedPoints and currentItem properties instead of taking points and relying on an instance variable, which was a terrible API. (App.PaneController._updateCanAnalyze): Use selectedPoints property. Since this property is only set when the main plot has a selected range, we don't have to check this._hasRange anymore. (App.InteractiveChartComponent._updateDomain): No longer sends domainChanged "event" action. (App.InteractiveChartComponent._sharedSelectionChanged): Removed. This is a dead code. (App.InteractiveChartComponent._updateSelection): (App.InteractiveChartComponent._xDomainsAreSame): Moved to App.domainsAreEqual. (App.InteractiveChartComponent._setCurrentSelection): Update the selection only if needed. Also set selectedPoints property. (App.AnalysisTaskController._fetchedRuns): (App.AnalysisTaskController._rootChangedForTestSet): * public/v2/index.html: Removed non-functional sharedSelection and superfluous selectionChanged and domainChanged actions. 2014-11-21 Ryosuke Niwa Unreviewed. Fixed syntax errors. * init-database.sql: * public/api/commits.php: 2014-11-21 Ryosuke Niwa The dashboard on new perf monitor should be configurable https://bugs.webkit.org/show_bug.cgi?id=138994 Reviewed by Benjamin Poulain. For now, make it configurable via config.json. We should eventually make it configurable via an administrative page but this will do for now. * config.json: Added the empty dashboard configuration. * public/include/manifest.php: Include the dashboard configuration in the manifest file. * public/v2/app.js: (App.IndexController): Removed defaultTable since this is now dynamically obtained via App.Manifest. (App.IndexController.gridChanged): Use App.Dashboard to parse the dashboard configuration. Also obtain the default configuration from App.Manifest. (App.IndexController._normalizeTable): Moved to App.Dashboard. * public/v2/manifest.js: (App.Repository.urlForRevision): Fixed the position of the open curly bracket. (App.Repository.urlForRevisionRange): Ditto. (App.Dashboard): Added. (App.Dashboard.table): Extracted from App.IndexController.gridChanged. (App.Dashboard.rows): Ditto. (App.Dashboard.headerColumns): Ditto. (App.Dashboard._normalizeTable): Moved from App.IndexController._normalizeTable. (App.MetricSerializer.normalizePayload): Synthesize a dashboard record from the configuration. Since there is exactly one dashboard object per app, it's okay to hard code an id here. (App.Manifest._fetchedManifest): Set defaultDashboard to the one and only one dashboard we have. 2014-11-21 Ryosuke Niwa There should be a way to associate bugs with analysis tasks https://bugs.webkit.org/show_bug.cgi?id=138977 Reviewed by Benjamin Poulain. Updated associate-bug.php to match the new database schema. * public/include/json-header.php: (require_format): Removed the call to camel_case_words_separated_by_underscore since the name is already camel-cased in require_existence_of. This makes the function usable elsewhere. * public/privileged-api/associate-bug.php: (main): Changed the API to take run, bugTracker, and number to match the new database schema. Also verify that those values are integers using require_format. * public/v2/analysis.js: (App.AnalysisTask.label): Added. Concatenates the task's name with the bug numbers. (App.Bug.label): Added. (App.BugAdapter): Added. (App.BugAdapter.createRecord): Use PrivilegedAPI instead of the builtin ajax call. (App.BuildRequest): Inherit from newly added App.Model, which is set to DS.Model right now. * public/v2/app.css: Renamed .test-groups to .analysis-group. Also added new rules for the table containing the bug information. * public/v2/app.js: (App.InteractiveChartComponent._rangesChanged): Added label to range bar objects. (App.AnalysisTaskRoute): (App.AnalysisTaskController): Replaced the functionality of App.AnalysisTaskViewModel. (App.AnalysisTaskController._fetchedManifest): Added. (App.AnalysisTaskController.actions.associateBug): Added. * public/v2/chart-pane.css: Renamed .bugs-pane to .analysis-pane. * public/v2/data.js: (Measurement.prototype.associateBug): Deleted. * public/v2/index.html: Renamed .bugs-pane to .analysis-pane and .test-groups to .analysis-group. Added a table show the bug information. Also hide the chart until chartData is available. * public/v2/manifest.js: (App.Model): Added. 2014-11-20 Ryosuke Niwa Fix misc bugs and typos in app.js https://bugs.webkit.org/show_bug.cgi?id=138946 Reviewed by Benjamin Poulain. * public/v2/app.js: (App.DashboardPaneProxyForPicker._platformOrMetricIdChanged): (App.ChartsController.init): (App.buildPopup): Renamed from App.BuildPopup. (App.InteractiveChartComponent._constructGraphIfPossible): Fixed the bug that we were calling remove() on the wrong object (an array as opposed to elements in the array). (App.InteractiveChartComponent._highlightedItemsChanged): Check the length of _highlights as _highlights is always an array and evalutes to true. 2014-11-20 Ryosuke Niwa New perf dashboard should provide UI to create a new analysis task https://bugs.webkit.org/show_bug.cgi?id=138910 Reviewed by Benjamin Poulain. This patch reverts some parts of r175006 and re-introduces bugs associated with analysis tasks. I'll add UI to show and edit bug numbers associated with an analysis task in a follow up patch. With this patch, we can create a new analysis task by selection a range of points and opening "analysis pane" (renamed from "bugs pane"). Each analysis task created is represented by a yellow bar in the chart hyperlinked to the analysis task. * init-database.sql: Redefined the bugs to be associated with an analysis task instead of a test run. * public/api/analysis-tasks.php: Added the support for querying analysis tasks for a specific metric on a specific platform. Also retrieve and return all bugs associated with analysis tasks. (main): (fetch_and_push_bugs_to_tasks): Added. Fetches all bugs associated with an array of analysis tasks and adds the associated bugs to each task in the array. (format_task): * public/api/runs.php: Reverted changes made in r175006. (fetch_runs_for_config): (format_run): * public/api/test-groups.php: (fetch_test_groups_for_task): Use the newly added Database::select_rows. * public/include/db.php: (Database::select_first_or_last_row): (Database::select_rows): Extracted from select_first_or_last_row. * public/v2/analysis.js: (App.AnalysisTask): Added "bugs" property. (App.Bug): Added now that bugs are regular data store objects. * public/v2/app.js: (App.Pane._fetch): Calls this.fetchAnalyticRanges to fetch analysis tasks as well as test runs. (App.Pane.fetchAnalyticRanges): Added. Fetches analysis tasks for the current metric on the current platform that are associated with a specific range of runs. (App.PaneController.actions.toggleBugsPane): Updated per showingBugsPane to showingAnalysisPane rename. (App.PaneController.actions.associateBug): Deleted. (App.PaneController.actions.createAnalysisTask): Replaced the pre-condition checks with assertions as this action should never be triggered when the pre-condition is not met. Also re-fetch analysis tasks once we've created one. (App.PaneController.toggleSearchPane): Updated per showingBugsPane to showingAnalysisPane rename. (App.PaneController._detailsChanged): Ditto. Removed selectedSinglePoint since it's no longer used. (App.PaneController._showDetails): Call _updateCanAnalyze to update the status of "Analyze" button. (App.PaneController._updateBugs): Deleted. (App.PaneController._updateMarkedPoints): Deleted. (App.PaneController._updateCanAnalyze): Added. Disables the button to create an analysis task when the name is missing or when at most one point is selected. (App.InteractiveChartComponent._constructGraphIfPossible): Update the locations of range rects. (App.InteractiveChartComponent._relayoutDataAndAxes): Ditto. (App.InteractiveChartComponent._mousePointInGraph): Don't return a point unless the mouse cursor is on our svg element to avoid locking the current item when a bar shown for an analysis task is clicked. (App.InteractiveChartComponent._rangesChanged): Added. Creates an array of objects representing clickable bars for analysis tasks. (App.InteractiveChartComponent._updateRangeBarRects): Computes the inline style used by each clickable bar for analysis tasks to place them at the right location. (App.InteractiveChartComponent.actions.openRange): Added. Forwards the action to the parent controller. * public/v2/chart-pane.css: (.chart .extent): Use the same color as the vertical indicator in the highlight behind the selection. (.chart .rangeBar): Added. * public/v2/data.js: (TimeSeries.prototype.nextPoint): Added. Used by _rangesChanged. * public/v2/index.html: Renamed "bugs pane" to "analysis pane" and removed the UI to associate bugs. This ability will be reinstated in a follow up patch. Also added a container div and spans for analysis task bars in the interactive chart component. 2014-11-19 Ryosuke Niwa Fix typos in r176203. * public/v2/app.js: (App.ChartsController.actions.addPaneByMetricAndPlatform): (App.AnalysisTaskRoute): 2014-11-18 Ryosuke Niwa Unreviewed. Updated the install instruction. * Install.md: 2014-11-17 Ryosuke Niwa App.Manifest shouldn't use App.__container__.lookup https://bugs.webkit.org/show_bug.cgi?id=138768 Reviewed by Andreas Kling. Removed the hack to find the store object via App.__container__.lookup. Pass around the store object instead. * public/v2/app.js: (App.DashboardRow._createPane): Add "store" property to the pane. (App.DashboardPaneProxyForPicker._platformOrMetricIdChanged): Ditto. (App.IndexController.gridChanged): Ditto. (App.IndexController.actions.addRow): Ditto. (App.IndexController.init): Ditto. (App.Pane._fetch): Ditto. (App.ChartsController._parsePaneList): Ditto. (App.ChartsController._updateQueryString): Ditto. (App.ChartsController.actions.addPaneByMetricAndPlatform): Ditto. (App.BuildPopup): Ditto. (App.AnalysisTaskRoute.model): Ditto. (App.AnalysisTaskViewModel._taskUpdated): Ditto. * public/v2/manifest.js: (App.Manifest.fetch): Removed the code to find the store object. 2014-11-08 Ryosuke Niwa Fix Ember.js warnings the new perf dashboard https://bugs.webkit.org/show_bug.cgi?id=138531 Reviewed by Darin Adler. Fixed various warnings. * public/v2/app.js: (App.InteractiveChartComponent._relayoutDataAndAxes): We can't use "rem". Use this._rem as done for x. * public/v2/data.js: (PrivilegedAPI._post): Removed the superfluous console.log. (CommitLogs.fetchForTimeRange): Ditto. * public/v2/index.html: Added tbody as required by the HTML specification. 2014-11-07 Ryosuke Niwa Fix typos in r175768. * public/v2/app.js: (App.AnalysisTaskViewModel.roots): 2014-11-07 Ryosuke Niwa Introduce the concept of analysis task to perf dashboard https://bugs.webkit.org/show_bug.cgi?id=138517 Reviewed by Andreas Kling. Introduced the concept of an analysis task, which is created for a range of measurements for a given metric on a single platform and used to bisect regressions in the range. Added a new page to see the list of active analysis tasks and a page to view the contents of an analysis task. * init-database.sql: Added a bunch of tables to store information about analysis tasks. analysis_tasks - Represents each analysis task. Associated with a platform and a metric and possibly with two test runs. Analysis tasks not associated with test runs are used for try new patches. analysis_test_groups - A test group in an analysis task represents a bunch of related A/B testing results. root_sets - A root set represents a set of roots (or packages) installed in each A/B testing. build_requests - A build request represents a single pending build for A/B testing. * public/api/analysis-tasks.php: Added. Returns the specified analysis task or all analysis tasks in an array. (main): (format_task): * public/api/test-groups.php: Added. Returns analysis task groups for the specified analysis task or returns the specified analysis task group as well as build requests associated with them. (main): (fetch_test_groups_for_task): (fetch_build_requests_for_task): (fetch_build_requests_for_group): (format_test_group): (format_build_request): * public/include/json-header.php: (remote_user_name): Extracted from compute_token so that we can use it in create-analysis-task.php. (compute_token): * public/privileged-api/associate-bug.php: (main): Fixed a typo. * public/privileged-api/create-analysis-task.php: Added. Creates a new analysis task for a given test run range. (main): (ensure_row_by_id): (ensure_config_from_runs): * public/privileged-api/generate-csrf-token.php: Use remote_user_name. * public/v2/analysis.js: Added. Various Ember data store models to represent analysis tasks and related objects. (App.AnalysisTask): (App.AnalysisTask.create): (App.TestGroup): (App.TestGroupAdapter): (App.AnalysisTaskSerializer): (App.TestGroupSerializer): (App.BuildRequest): * public/v2/app.css: Added style rules for the analysis page. * public/v2/app.js: (App.Pane._fetch): Use fetchRunsWithPlatformAndMetric, which has been refactored into App.Manifest. (App.PaneController.actions.toggleBugsPane): Show bugs pane even when there are no bug trackers or there is not exactly one selected point as we can still create an analysis task. (App.PaneController.actions.associateBug): Renamed singlySelectedPoint to selectedSinglePoint to be more grammatical and also alert'ed the error message when there is one. (App.PaneController.actions.createAnalysisTask): Added. Creates a new analysis task and opens it in a new tab. Since window.open only works during the click, we open the new "window" preemptively and navigates or closes it once XHR request has completed. (App.PaneController._detailsChanged): Changes due to singlySelectedPoint to selectedSinglePoint rename. (App.PaneController._updateBugs): Fixed a bug that we were showing bugs in the previous point when a single point is selected in the details pane. (App.AnalysisRoute): Added. (App.AnalysisTaskRoute): Added. (App.AnalysisTaskViewModel): Added. (App.AnalysisTaskViewModel._taskUpdated): Fetch runs for the associated platform and metric. (App.AnalysisTaskViewModel._fetchedRuns): Setup the chart data to show. (App.AnalysisTaskViewModel.testSets): The computed property used to update roots for all repositories/projects. (App.AnalysisTaskViewModel._rootChangedForTestSet): Updates root selections for all repositories/projects when the user selects an option for all roots in A or B configuration. (App.AnalysisTaskViewModel.roots): The computed property used to show root choices for each repository/project. * public/v2/chart-pane.css: Added style rules for details view in the analysis task page. * public/v2/data.js: (Measurement.prototype._formatRevisionRange): Don't prefix a revision number with "At " when there is no previous point so that we can use it in App.AnalysisTaskViewModel.roots. (TimeSeries.prototype.findPointByMeasurementId): Added. (TimeSeries.prototype.seriesBetweenPoints): Added. * public/v2/index.html: Use Metric.fullName since the same value is needed in the analysis task page. Also added a button to create an analysis task, and made bugs pane button always enabled since we can an analysis task even when multiple points are selected. Finally, added a new template for the analysis task page. * public/v2/manifest.js: (App.Metric.fullName): Added to share code between the charts page and the analysis task page. (App.Manifest.fetchRunsWithPlatformAndMetric): Extracted from App.Pane._fetch to be reused in App.AnalysisTaskViewModel._taskUpdated. 2014-10-28 Ryosuke Niwa Remove App.PaneController.bugsChangeCount in the new perf dashboard https://bugs.webkit.org/show_bug.cgi?id=138111 Reviewed by Darin Adler. * public/v2/app.js: (App.PaneController.bugsChangeCount): Removed. (App.PaneController.actions.associateBug): Call _updateMarkedPoints instead of incrementing bugsChangeCount. (App.PaneController._updateMarkedPoints): Extracted from App.InteractiveChartComponent._updateDotsWithBugs. Finds the list of current run's points that are associated with bugs. (App.InteractiveChartComponent._updateMarkedDots): Renamed from _updateDotsWithBugs. * public/v2/chart-pane.css: (.chart .marked): Renamed from .hasBugs. * public/v2/index.html: Specify chartPointRadius and markedPoints. 2014-10-27 Ryosuke Niwa REGRESSION: commit logs are not shown sometimes on the new dashboard UI https://bugs.webkit.org/show_bug.cgi?id=138099 Reviewed by Benjamin Poulain. The bug was caused by _currentItemChanged not passing the previous point in the list of points and also _showDetails inverting the order of the current and old measurements. * public/v2/app.js: (App.PaneController._currentItemChanged): Pass in the previous point to _showDetails when there is one. (App.PaneController._showDetails): Since points are ordered chronologically, the last point is the current (latest) measurement and the first point is the oldest measurement. (App.CommitsViewerComponent.commitsChanged): Don't show a single measurement as a range for clarity. 2014-10-18 Ryosuke Niwa Perf dashboard should provide a way to associate bugs with a test run https://bugs.webkit.org/show_bug.cgi?id=137857 Reviewed by Andreas Kling. Added a "privileged" API, /privileged-api/associate-bug, to associate a bug with a test run. /privileged-api/ is to be protected by an authentication mechanism such as DigestAuth over https by the Apache configuration. The Cross Site Request (CSRF) Forgery prevention for privileged APIs work as follows. When a user is about to make a privileged API access, the front end code obtains a CSRF token generated by POST'ing to privileged-api/generate-csrf-token; the page sets a randomly generated salt and an expiration time via the cookie and returns a token computed from those two values as well as the remote username. The font end code then POST's the request along with the returned token. The server side code verifies that the specified token can be generated from the salt and the expiration time set in the cookie, and the token hasn't expired. * init-database.sql: Added bug_url to bug_trackers table, and added bugs table. Each bug tracker will have zero or exactly one bug associated with a test run. * public/admin/bug-trackers.php: Added the support for editing bug_url. * public/api/runs.php: (fetch_runs_for_config): Modified the query to fetch bugs associated with test_runs. (parse_bugs_array): Added. Parses the aggregated bugs and creates a dictionary that maps a tracker id to an associated bug if there is one. (format_run): Calls parse_bugs_array. * public/include/json-header.php: Added helper functions to deal for CSRF prevention. (ensure_privileged_api_data): Added. Dies immediately if the request's method is not POST or doesn't have a valid JSON payload. (ensure_privileged_api_data_and_token): Ditto. Also checks that the CSRF prevention token is valid. (compute_token): Computes a CSRF token using the REMOTE_USER (e.g. set via BasicAuth), the salt, and the expiration time stored in the cookie. (verify_token): Returns true iff the specified token matches what compute_token returns from the cookie. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Include bug_url as bugUrl in the manifest. Also use tracker_id instead of tracker_name as the key in the manifest. This requires changes to both v1 and v2 front end. * public/index.html: (Chart..showTooltipWithResults): Updated for the manifest format changed mentioned above. * public/privileged-api/associate-bug.php: Added. (main): Added. Associates or dissociates a bug with a test run inside a transaction. It prevent a CSRF attack via ensure_privileged_api_data_and_token, which calls verify_token. * public/privileged-api/generate-csrf-token.php: Added. Generates a CSRF token valid for one hour. * public/v2/app.css: (.disabled .icon-button:hover g): Used by the "bugs" icon when a range of points or no points are selected in a chart. * public/v2/app.js: (App.PaneController.actions.toggleBugsPane): Added. Toggles the visibility of the bugs pane when exactly one point is selected in the chart. Also hides the search pane when making the bugs pane visible since they would overlap on each other if both of them are shown. (App.PaneController.actions.associateBug): Makes a privileged API request to associate the specified bug with the currently selected point (test run). Updates the bug information in "details" and colors of dots in the charts to reflect new states. Because chart data objects aren't real Ember objects for performance reasons, we have to use a dirty hack of modifying a dummy counter bugsChangeCount. (App.PaneController.actions.toggleSearchPane): Renamed from toggleSearch. Also hides the bugs pane when showing the search pane. (App.PaneController.actions.rangeChanged): Takes all selected points as the second argument instead of taking start and end points as the second and the third arguments so that _showDetails can enumerate all bugs in the selected range. (App.PaneController._detailsChanged): Added. Hide the bugs pane whenever a new point is selected. Also update singlySelectedPoint, which is used by toggleBugsPane and associateBug. (App.PaneController._currentItemChanged): Updated for the _showDetails change. (App.PaneController._showDetails): Takes an array of selected points in place of old arguments. Simplified the code to compute the revision information. Calls _updateBugs to format the associated bugs. (App.PaneController._updateBugs): Sets details.bugTrackers to a dictionary that maps a bug tracker id to a bug tracker proxy with an array of (bugNumber, bugUrl) pairs and also editedBugNumber, which is used by the bugs pane to associate or dissociate a bug number, if exactly one point is selected. (App.InteractiveChartComponent._updateDotsWithBugs): Added. Sets hasBugs class on dots as needed. (App.InteractiveChartComponent._setCurrentSelection): Finds and passes all points in the selected range to selectionChanged action instead of just finding the first and the last points. * public/v2/chart-pane.css: Updated the style. * public/v2/data.js: (PrivilegedAPI): Added. A wrapper for privileged APIs' CSRF tokens. (PrivilegedAPI.sendRequest): Makes a privileged API call. Fetches a new CSRF token if needed. (PrivilegedAPI._generateTokenInServerIfNeeded): Makes a request to privileged-api/generate-csrf-token if we haven't already obtained a CSRF token or if the token has already been expired. (PrivilegedAPI._post): Makes a single POST request to /privileged-api/* with a JSON payload. (Measurement.prototype.bugs): Added. (Measurement.prototype.hasBugs): Returns true iff bugs has more than one bug number. (Measurement.prototype.associateBug): Associates a bug with a test run via privileged-api/associate-bug. * public/v2/index.html: Added the bugs pane. Also added a list of bugs associated with the current run in the details. * public/v2/manifest.js: (App.BugTracker.bugUrl): (App.BugTracker.newBugUrl): Added. (App.BugTracker.repositories): Added. This was a missing back reference to repositories. (App.MetricSerializer.normalizePayload): Now parses/loads the list of bug trackers from the manifest. (App.Manifest.repositoriesWithReportedCommits): Now initialized to an empty array instead of null. (App.Manifest.bugTrackers): Added. (App.Manifest._fetchedManifest): Sets App.Manifest.bugTrackers. Also sorts the list of repositories by their respective ids to make the ordering stable. 2014-10-14 Ryosuke Niwa Remove unused jobs table https://bugs.webkit.org/show_bug.cgi?id=137724 Reviewed by Daniel Bates. Removed jobs table in the database as well as related code. * init-database.sql: * public/admin/jobs.php: Removed. * public/admin/tests.php: * public/include/admin-header.php: 2014-10-13 Ryosuke Niwa New perf dashboard should have an ability to search commits by a keyword https://bugs.webkit.org/show_bug.cgi?id=137675 Reviewed by Geoffrey Garen. /api/commits/ now accepts query parameters to search a commit by a keyword. Its output format changed to include "authorEmail" and "authorName" directly as columns instead of including an "author" object. This API change allows fetch_commits_between to generate results without processing Postgres query results. In the front end side, we've added a search pane in pane controller, and the interactive chart component now has a concept of highlighted items which is used to indicate commits found by the search pane. * public/api/commits.php: (main): Extract query parameters: keyword, from, and to and use that to fetch appropriate commits. (fetch_commits_between): Moved some code from main. Now takes a search term as the third argument. We look for a commit if its author name or email contains the keyword or if its revision matches the keyword. (format_commit): Renamed from format_commits. Now only formats one commit. * public/include/db.php: (Database::query_and_fetch_all): Now returns array() when the query results is empty (instead of false). * public/v2/app.css: Renamed .close-button to .icon-button since it's used by a search button as well. * public/v2/app.js: (App.Pane.searchCommit): Added. Finds the commits by a search term and assigns 'highlightedItems', which is a hash table that contains highlighted items' measurements' ids as keys. (App.PaneController.actions.toggleSearch): Toggles the visibility of the search pane. Also sets the default commit repository. (App.PaneController.actions.searchCommit): Delegates the work to App.Pane.searchCommit. (App.InteractiveChartComponent._constructGraphIfPossible): Fixed a bug that we weren't removing old this._dots. Added the code to initialize this._highlights. (App.InteractiveChartComponent._updateDimensionsIfNeeded): Updates dimensions of highlight lines. (App.InteractiveChartComponent._updateHighlightPositions): Added. Ditto. (App.InteractiveChartComponent._highlightedItemsChanged): Adds vertical lines for highlighted items and deletes the existing lines for the old highlighted items. (App.CommitsViewerComponent.commitsChanged): Updated the code per JSON API change mentioned above. Also fixed a bug that the code tries to update the commits viewer even if the viewer had already been destroyed. * public/v2/chart-pane.css: Added style for the search pane and the search button. * public/v2/data.js: Turned FetchCommitsForTimeRange into a class: CommitLogs. (CommitLogs): Added. (CommitLogs.fetchForTimeRange): Renamed from FetchCommitsForTimeRange. Takes a search term as an argument. (CommitLogs._cachedCommitsBetween): Extracted from FetchCommitsForTimeRange. (CommitLogs._cacheConsecutiveCommits): Ditto. (FetchCommitsForTimeRange._cachedCommitsByRepository): Deleted. (Measurement.prototype.commitTimeForRepository): Extracted from formattedRevisions. (Measurement.prototype.formattedRevisions): Uses formattedRevisions. Deleted the unused code for commitTime. * public/v2/index.html: Added the search pane and the search button. Also removed the unused attribute binding for showingDetails since this property is no longer used. * public/v2/manifest.js: (App.Manifest.repositories): Added. (App.Manifest.repositoriesWithReportedCommits): Ditto. Used by App.PaneController.actions.toggleSearch to find the default repository to search. (App.Manifest._fetchedManifest): Populates repositories and repositoriesWithReportedCommits. 2014-10-13 Ryosuke Niwa Unreviewed build fix after r174555. * public/include/manifest.php: (ManifestGenerator::generate): Assign an empty array to $repositories_with_commit when there are no commits. * tests/admin-regenerate-manifest.js: Fixed the test case. 2014-10-09 Ryosuke Niwa New perf dashboard UI tries to fetch commits all the time https://bugs.webkit.org/show_bug.cgi?id=137592 Reviewed by Andreas Kling. Added hasReportedCommits boolean to repository meta data in manifest.json, and used that in the front end to avoid issuing HTTP requests to fetch commit logs for repositories with no reported commits as they are all going to fail. Also added an internal cache to FetchCommitsForTimeRange in the front end to avoid fetching the same commit logs repeatedly. There are two data structures we cache: commitsByRevision which maps a given commit revision/hash to a commit object; and commitsByTime which is an array of commits sorted chronologically by time. * public/include/manifest.php: * public/v2/app.js: (App.CommitsViewerComponent.commitsChanged): * public/v2/data.js: (FetchCommitsForTimeRange): (FetchCommitsForTimeRange._cachedCommitsByRepository): * public/v2/manifest.js: (App.Repository): 2014-10-08 Ryosuke Niwa Another unreviewed build fix after r174477. Don't try to insert a duplicated row into build_commits as it results in a database constraint error. This has been caught by a test in /api/report. I don't know why I thought all tests were passing. * public/include/report-processor.php: 2014-10-08 Ryosuke Niwa Unreviewed build fix after r174477. * init-database.sql: Removed build_commits_index since it's redundant with build_commit's primary key. Also fixed a syntax error that we were missing "," after line that declared build_commit column. * public/api/runs.php: Fixed the query so that test_runs without commits data will be retrieved. This is necessary for baseline and target values manually added via admin pages. 2014-10-08 Ryosuke Niwa Add v2 UI for the perf dashboard https://bugs.webkit.org/show_bug.cgi?id=137537 Rubber-stamped by Andreas Kling. * public/v2: Added. * public/v2/app.css: Added. * public/v2/app.js: Added. * public/v2/chart-pane.css: Added. * public/v2/data.js: Added. * public/v2/index.html: Added. * public/v2/js: Added. * public/v2/js/d3: Added. * public/v2/js/d3/LICENSE: Added. * public/v2/js/d3/d3.js: Added. * public/v2/js/d3/d3.min.js: Added. * public/v2/js/ember-data.js: Added. * public/v2/js/ember.js: Added. * public/v2/js/handlebars.js: Added. * public/v2/js/jquery.min.js: Added. * public/v2/js/statistics.js: Added. * public/v2/manifest.js: Added. * public/v2/popup.js: Added. 2014-10-08 Ryosuke Niwa Remove superfluously duplicated code in public/api/report-commits.php. 2014-10-08 Ryosuke Niwa Perf dashboard should store commit logs https://bugs.webkit.org/show_bug.cgi?id=137510 Reviewed by Darin Adler. For the v2 version of the perf dashboard, we would like to be able to see commit logs in the dashboard itself. This patch replaces "build_revisions" table with "commits" and "build_commits" relations to store commit logs, and add JSON APIs to report and retrieve them. It also adds a tools/pull-svn.py to pull commit logs from a subversion directory. The git version of this script will be added in a follow up patch. In the new database schema, each revision in each repository is represented by exactly one row in "commits" instead of one row for each build in "build_revisions". "commits" and "builds" now have a proper many-to-many relationship via "build_commits" relations. In order to migrate an existing instance of this application, run the following SQL commands: BEGIN; INSERT INTO commits (commit_repository, commit_revision, commit_time) (SELECT DISTINCT ON (revision_repository, revision_value) revision_repository, revision_value, revision_time FROM build_revisions); INSERT INTO build_commits (commit_build, build_commit) SELECT revision_build, commit_id FROM commits, build_revisions WHERE commit_repository = revision_repository AND commit_revision = revision_value; DROP TABLE build_revisions; COMMIT; The helper script to submit commit logs can be used as follows: python ./tools/pull-svn.py "WebKit" https://svn.webkit.org/repository/webkit/ https://perf.webkit.org feeder-slave feeder-slave-password 60 "webkit-patch find-users" The above command will pull the subversion server at https://svn.webkit.org/repository/webkit/ every 60 seconds to retrieve at most 10 commits, and submits the results to https://perf.webkit.org using "feeder-slave" and "feeder-slave-password" as the builder name and the builder password respectively. The last, optional, argument is the shell command to convert a subversion account to the corresponding username. e.g. "webkit-patch find-users rniwa@webkit.org" yields "Ryosuke Niwa" in the stdout. * init-database.sql: Replaced "build_revisions" relation with "commits" and "build_commits" relations. * public/api/commits.php: Added. Retrieves a list of commits based on arguments in its path of the form /api/commits//. The behavior of this API depends on as follows: - Not specified - It returns every single commit for a given repository. - Matches "oldest" - It returns the commit with the oldest timestamp. - Matches "latest" - It returns the commit with the latest timestamp. - Matches "last-reported" - It returns the commit with the latest timestamp added via report-commits.php. - Is entirely alphanumeric - It returns the commit whose revision matches the filter. - Is of the form : or - - It retrieves the list of commits added via report-commits.php between two timestamps retrieved from commits whose revisions match the two alphanumeric values specified. Because it retrieves commits based on their timestamps, the list may contain commits that do not appear as neither hash's ancestor in git/mercurial. (main): (commit_from_revision): (fetch_commits_between): (format_commits): * public/api/report-commits.php: Added. A JSON API to report new subversion, git, or mercurial commits. See tests/api-report-commits.js for examples on how to use this API. * public/api/runs.php: Updated the query to use "commit_builds" and "commits" relations instead of "build_revisions". Regrettably, the new query is 20% slower but I'm going to wait until the new UI is ready to optimize this and other JSON APIs. * public/include/db.php: (Database::select_or_insert_row): (Database::update_or_insert_row): Added. (Database::_select_update_or_insert_row): Extracted from select_or_insert_row. Try to update first and then insert if the update fails for update_or_insert_row. Preserves the old behavior when $should_update is false. (Database::select_first_row): (Database::select_last_row): Added. (Database::select_first_or_last_row): Extracted from select_first_row. Fixed a bug that we were asserting $order_by to be not alphanumeric/underscore. Retrieve the last row instead of the first if $descending_order. * public/include/report-processor.php: (ReportProcessor::resolve_build_id): Store commits instead of build_revisions. We don't worry about the race condition for adding "build_commits" rows since we shouldn't have a single tester submitting the same result concurrently. Even if it happened, it will only result in a PHP error and the database will stay consistent. * run-tests.js: (pathToTests): Don't call path.resolve with "undefined" testName; It throws an exception in the latest node.js. * tests/api-report-commits.js: Added. * tests/api-report.js: Fixed a test per build_revisions to build_commits/commits replacement. * tools: Added. * tools/pull-svn.py: Added. See above for how to use this script. (main): (determine_first_revision_to_fetch): (fetch_revision_from_dasbhoard): (fetch_commit_and_resolve_author): (fetch_commit): (textContent): (resolve_author_name_from_email): (submit_commits): 2014-09-30 Ryosuke Niwa Update Install.md for Mavericks and fix typos https://bugs.webkit.org/show_bug.cgi?id=137276 Reviewed by Benjamin Poulain. Add the instruction to copy php.ini to enable the Postgres extension in PHP. Also use perf.webkit.org as the directory name instead of WebKitPerfMonitor. Finally, init-database.sql is no longer located inside database directory. * Install.md: 2014-08-11 Ryosuke Niwa Report run id's in api/runs.php for the new dashboard UI https://bugs.webkit.org/show_bug.cgi?id=135813 Reviewed by Andreas Kling. Include run_id in the generated JSON. * public/api/runs.php: (fetch_runs_for_config): Don't sort results by time since that has been done in the front end for ages now. (format_run): 2014-08-11 Ryosuke Niwa Merging platforms mixes baselines and targets into reported data https://bugs.webkit.org/show_bug.cgi?id=135260 Reviewed by Andreas Kling. When merging two platforms, move test configurations of a different type (baseline, target) as well as of different metric (Time, Runs). Also avoid fetching the entire table of runs just to see if there are no remaining runs. It's sufficient to detect one such test_runs object. * public/admin/platforms.php: (merge_platforms): 2014-07-30 Ryosuke Niwa Merging platforms mixes baselines and targets into reported data https://bugs.webkit.org/show_bug.cgi?id=135260 Reviewed by Geoffrey Garen. Make sure two test configurations we're merging are of the same type (e.g. baseline, target, current). Otherwise, we'll erroneously mix up runs for baseline, target, and current (reported values). * public/admin/platforms.php: 2014-07-23 Ryosuke Niwa Build fix after r171361. * public/js/helper-classes.js: (.this.formattedBuildTime): 2014-07-22 Ryosuke Niwa Perf dashboard spends 2s processing JSON data during the page loads https://bugs.webkit.org/show_bug.cgi?id=135152 Reviewed by Andreas Kling. In the Apple internal dashboard, we were spending as much as 2 seconds converting raw JSON data into proper JS objects while loading the dashboard. This caused the apparent unresponsiveness of the dashboard despite of the fact charts themselves updated almost instantaneously. * public/index.html: * public/js/helper-classes.js: (TestBuild): Compute the return values of formattedTime and formattedBuildTime lazily as creating new Date objects and running string replace is expensive. (TestBuild.formattedTime): (TestBuild.formattedBuildTime): (PerfTestRuns.setResults): Added. Pushing each result was the biggest bottle neck. (PerfTestRuns.addResult): Deleted. 2014-07-18 Ryosuke Niwa Perf dashboard shouldn't show the full git hash https://bugs.webkit.org/show_bug.cgi?id=135083 Reviewed by Benjamin Poulain. Detect Git/Mercurial hash by checking the length. If it's a hash, use the first 8 characters in the label while retaining the full length to be used in hyperlinks. * public/js/helper-classes.js: (.this.formattedRevisions): (TestBuild): 2014-05-29 Ryosuke Niwa Add an instruction on how to backup the database. https://bugs.webkit.org/show_bug.cgi?id=133391 Rubber-stamped by Andreas Kling. * Install.md: 2014-04-08 Ryosuke Niwa Build fix after r166479. 'bytes' is now abbreviated as 'B'. * public/js/helper-classes.js: (PerfTestRuns.smallerIsBetter): 2014-04-08 Ryosuke Niwa Some CSS teaks. * public/common.css: (#title): * public/index.html: (#charts .pane): (#charts .arrow): 2014-04-03 Ryosuke Niwa WebKitPerfMonitor: There should be a way to add all metrics of a suite without also adding subtests https://bugs.webkit.org/show_bug.cgi?id=131157 Reviewed by Andreas Kling. Split "all metrics" into all metrics of a test suite and all subtests of the suite. This allows, for example, adding all metrics such as Arithmetic and Geometric for a given test suite without also adding its subtests. * public/index.html: (init.showCharts): (init): 2014-04-03 Ryosuke Niwa WebKitPerfMonitor: Tooltips cannot be pinned after using browser's back button https://bugs.webkit.org/show_bug.cgi?id=131155 Reviewed by Andreas Kling. The bug was caused by Chart.attach binding event listeners on plot container on each call. This resulted in the click event handler toggling the visiblity of the tooltip twice upon click when attach() has been called even number of times, keeping the tooltip invisible. Fixed the bug by extracting the code to bind event listeners outside of Chart.attach as a separate function, bindPlotEventHandlers, and calling it exactly once when Chart.attach is called for the first time. * public/index.html: (Chart.attach): (Chart..bindPlotEventHandlers): 2014-04-03 Ryosuke Niwa WebKitPerfMonitor: Tooltips can be cut off at the top https://bugs.webkit.org/show_bug.cgi?id=130960 Reviewed by Andreas Kling. * public/common.css: (#title): Removed the gradients, box shadows, and border from the header. (#title h1): Reduce the font size. (#title ul): Use line-height to vertically align the navigation bar instead of specifying a padding atop. * public/index.html: (.tooltop:before): Added. Identical to .tooltop:after except it's upside down (arrow facing up). (.tooltip.inverted:before): Show the arrow facing up when .inverted is set. (.tooltip.inverted:before): Hide the arrow facing down when .inverted is set. * public/js/helper-classes.js: (Tooltip.show): Show the tooltip below the point if placing it above the point results in the top of the tooltip extending above y=0. 2014-04-03 Ryosuke Niwa WebKitPerfMonitor: Y-axis adjustment is too aggressive https://bugs.webkit.org/show_bug.cgi?id=130937 Reviewed by Andreas Kling. Previously, adjusted min. and max. were defined as the two standards deviations away from EWMA of measured results. This had two major problems: 1. Two standard deviations can be too small to show the confidence interval for results. 2. Sometimes baseline and target can be more than two standards deviations away. Fixed the bug by completely rewriting the algorithm to compute the interval. Instead of blindly using two standard deviations as margins, we keep adding quarter the standard deviation on each side until more than 90% of points lie in the interval or we've expanded 4 standard deviations. Once this condition is met, we reduce the margin on each side separately to reduce the empty space on either side. A more rigorous approach would involve computing least squared value of results with respect to intervals but that seems like an overkill for a simple UI problem; it's also computationally expensive. * public/index.html: (Chart..adjustedIntervalForRun): Extracted from computeYAxisBoundsToFitLines. (Chart..computeYAxisBoundsToFitLines): Compute the min. and max. adjusted intervals out of adjusted intervals for each runs (current, baseline, and target) so that at least one point from each set of results is shown. We wouldn't see the difference between measured values versus baseline and target values otherwise. * public/js/helper-classes.js: (PerfTestResult.unscaledConfidenceIntervalDelta): Returns the default value if the confidence interval delta cannot be computed. (PerfTestResult.isInUnscaledInterval): Added. Returns true iff the confidence intervals lies within the given interval. (PerfTestRuns..filteredResults): Extracted from unscaledMeansForAllResults now that PerfTestRuns.min and PerfTestRuns.max need to use both mean and confidence interval delta for each result. (PerfTestRuns..unscaledMeansForAllResults): (PerfTestRuns.min): Take the confidence interval delta into account. (PerfTestRuns.max): Ditto. (PerfTestRuns.countResults): Returns the number of results in the given time frame (> minTime). (PerfTestRuns.countResultsInInterval): Returns the number of results whose confidence interval lie within the given interval. (PerfTestRuns.exponentialMovingArithmeticMean): Fixed the typo so that it actually computes the EWMA. 2014-03-31 Ryosuke Niwa Some CSS tweaks after r166477 and r166479, * public/index.html: 2014-03-30 Ryosuke Niwa WebKitPerfMonitor: Sometimes text inside panes overlap https://bugs.webkit.org/show_bug.cgi?id=130956 Reviewed by Gyuyoung Kim. Revamped the pane UI. Now build info uses table element instead of plane text with BRs. The computed status of the latest result against baseline/target such as "3% until target" is now shown above the current value. This reduces the total height of the pane and fits more information per screen capita on the dashboard. * public/index.html: Updated and added a bunch of CSS rules for the new look. (.computeStatus): Don't append the build info here. The build info is constructed as a separate table now. (.createSummaryRowMarkup): Use th instead of td for "Current", "Baseline", and "Target" in the summary table. (.buildLabelWithLinks): Construct table rows instead of br separated lines of text. This streamlines the look of the build info shown in a chart pane and a tooltip. (Chart): Made .status a table. (Chart.populate): Prepend status.text, which contains text such as "3% until target", into the summary rows right above "Current" value, and populate .status with buildLabelWithLinks manually instead of status.text now that status.text no longer contains it. (Chart..showTooltipWithResults): Wrap buildLabelWithLinks with a table element. * public/js/helper-classes.js: (TestBuild.formattedRevisions): Don't include repository names in labels since repository names are now added by buildLabelWithLinks inside th elements. Also place spaces around '-' between two different OS X versions. e.g. "OS X 10.8 - OS X 10.9" instead of "OS X 10.8-OS X 10.9". (PerfTestRuns): Use "/s" for "runs/s" and "B" for "bytes" to make text shorter in .status and .summaryTable. (PerfTestRuns..computeScalingFactorIfNeeded): Avoid placing a space between 'M' and a unit starting with a capital letter; e.g. "MB" instead of "M B". 2014-03-30 Ryosuke Niwa WebKitPerfMonitor: Header and number-of-days slider takes up too much space https://bugs.webkit.org/show_bug.cgi?id=130957 Reviewed by Gyuyoung Kim. Moved the slider into the header. Also reduced the spacing between the header and platform names. This reclaims 50px × width of the screen real estate. * public/common.css: (#title): Reduced the space below the header from 20px to 10px. * public/index.html: (#numberOfDaysPicker): Removed the rounded border around the number-of-days slider. (#dashboard > tbody > tr > td): Added a 1.5em padding at the bottom. (#dashboard > thead th): That allows us to remove the padding at the top here. This reduces the wasted screen real estate between the header and the platform names. 2014-03-10 Zoltan Horvath Update the install guidelines for perf.webkit.org https://bugs.webkit.org/show_bug.cgi?id=129895 Reviewed by Ryosuke Niwa. The current install guideline for perf.webkit.org discourages the use of the installed Server application. I've actualized the documentation for Mavericks, and modified the guideline to include the instructions for Server.app also. * Install.md: 2014-03-08 Zoltan Horvath Update perf.webkit.org json example https://bugs.webkit.org/show_bug.cgi?id=129907 Reviewed by Andreas Kling. The current example is not valid json syntax. I fixed the syntax errors and indented the code properly. * ReadMe.md: 2014-01-31 Ryosuke Niwa Merge database-common.js and utility.js into run-tests.js. Reviewed by Matthew Hanson. Now that run-tests is the only node.js script, merged database-common.js and utility.js into it. Also moved init-database.sql out of the database directory and removed the directory entirely. * database: Removed. * database/database-common.js: Removed. * database/utility.js: Removed. * init-database.sql: Moved from database/init-database.sql. * run-tests.js: (connect): Moved from database-common.js. (pathToDatabseSQL): Extracted from pathToLocalScript. (pathToTests): Moved from database-common.js. (config): Ditto. (TaskQueue): Ditto. (SerializedTaskQueue): Ditto. (main): (initializeDatabase): (TestEnvironment.it): (TestEnvironment.queryAndFetchAll): (sendHttpRequest): 2014-01-30 Ryosuke Niwa Remove the dependency on node.js from the production code. Reviewed by Ricky Mondello. Work towards Upstream SafariPerfMonitor. Removed node.js dependency from TestRunsGenerator. It was really a design mistake to invoke node.js from php. It added so much complexity with only theoretical extensibility of adding aggregators. It turns out that many aggregators we'd like to add are a lot more complicated than ones that could be written under the current infrastructure, and we need to make the other aspects (e.g. the level of aggregations) a lot more extensible. Removing and simplifying TestRunsGenerator allows us to implement such extensions in the future. Also removed the js files that are no longer used. * config.json: Moved from database/config.json. * database/aggregate.js: Removed. No longer used. * database/database-common.js: Removed unused functions, and updated the path to config.json. * database/process-jobs.js: Removed. No longer used. * database/sample-data.sql: Removed. We have a much better corpus of data now. * database/schema.graffle: Removed. It's completely obsolete. * public/include/db.php: Updated the path to config.json. * public/include/evaluator.js: Removed. * public/include/report-processor.php: (TestRunsGenerator::aggregate): Directly aggregate values via newly added aggregate_values method instead of storing values into $expressions and calling evaluate_expressions_by_node. (TestRunsGenerator::aggregate_values): Added. (TestRunsGenerator::compute_caches): Directly compute the caches. 2014-01-30 Ryosuke Niwa Build fix. Don't fail the platform merges even if there are no test configurations to be moved to the new platform. * public/admin/platforms.php: * public/include/db.php: 2014-01-30 Ryosuke Niwa Zoomed y-axis view is ununsable when the last result is an outlier. Reviewed by Stephanie Lewis. Show two standard deviations from the exponential moving average with alpha = 0.3 instead of the mean of the last result so that the graph looks sane if the last result was an outlier. However, always show the last result's mean even if it was an outlier. * public/index.html: * public/js/helper-classes.js: (unscaledMeansForAllResults): Extracted from min/max/sampleStandardDeviation. Also added the ability to cache the unscaled means to avoid recomputation. (PerfTestRuns.min): Refactored to use unscaledMeansForAllResults. (PerfTestRuns.max): Ditto. (PerfTestRuns.sampleStandardDeviation): Ditto. (PerfTestRuns.exponentialMovingArithmeticMean): Added. 2014-01-30 Ryosuke Niwa Minor fixes. * public/admin/tests.php: * public/js/helper-classes.js: 2014-01-29 Ryosuke Niwa Use two standard deviations instead as I mentioned in the mailing list. * public/index.html: 2014-01-28 Ryosuke Niwa The performance dashboard erroneously shows upward arrow for combined metrics. A single outlier can ruin the zoomed y-axis view. Rubber-stamped by Antti Koivisto. * public/index.html: (computeYAxisBoundsToFitLines): Added adjustedMax and adjustedMin, which are pegged at 4 standard deviations from the latest results' mean. (Chart): Renamed shouldStartYAxisAtZero to shouldShowEntireYAxis. (Chart.attachMainPlot): Use the adjusted max and min when we're not showing the entire y-axis. (Chart.toggleYAxis): * public/js/helper-classes.js: (PerfTestRuns.sampleStandardDeviation): Added. (PerfTestRuns.smallerIsBetter): 'Combined' is a smaller is better metric. 2014-01-28 Ryosuke Niwa Don't include the confidence interval when computing the y-axis. Rubber-stamped by Simon Fraser. * public/js/helper-classes.js: (PerfTestRuns.min): (PerfTestRuns.max): 2014-01-25 Ryosuke Niwa Tiny CSS tweak for tooltips. * public/index.html: 2014-01-25 Ryosuke Niwa Remove the erroneously repeated code. * public/admin/test-configurations.php: 2014-01-24 Ryosuke Niwa perf dashboard should show baseline numbers Reviewed by Stephanie Lewis. * public/admin/bug-trackers.php: (associated_repositories): Return an array of HTMLs instead of echo'ing as expected by AdministrativePage. Also fixed a typo. * public/admin/platforms.php: (merge_list): Ditto. * public/admin/test-configurations.php: Added. (add_run): Adds a "synthetic" test run and a corresponding build. It doesn't create run_iterations and build_revisions as they're not meaningful for baseline / target numbers. (delete_run): Deletes a synthetic test run and its build. It verifies that the specified build has exactly one test run so that we don't accidentally delete a reported test run. (generate_rows_for_configurations): Generates rows of configuration IDs and types. (generate_rows_for_test_runs): Ditto for test runs. It also emits the form to add new "synthetic" test runs and delete existing ones. * public/admin/tests.php: We wrongfully assumed there is exactly one test configuration for each metric on each platform; there could be configurations of distinct types such as "current" and "baseline". Thus, update all test configurations for a given metric when updating config_is_in_dashboard. * public/api/runs.php: Remove the NotImplemented when we have multiple test configurations. (fetch_runs_for_config): "Synthetic" test runs created on test-configurations page are missing revision data so we need to left-outer-join (instead of inner-join) build_revisions. To avoid making the query unreadable, don't join revision_repository here. Instead, fetch the list of repositories upfront and resolve names in parse_revisions_array. This actually reduces the query time by ~10%. (parse_revisions_array): Skip an empty array created for "synthetic" test runs. * public/include/admin-header.php: (AdministrativePage::render_table): Now custom columns support sub columns. e.g. a configuration column may have id and type sub columns, and each custom column could generate multiple rows. Any table with sub columns now generates two rows for thead. We generate td's in in the first row without sub columns with rowspan of 2, and generate ones with sub columns with colspan set to the sub column count. We then proceed to generate the second header row with sub column names. When generating the actual content, we first generate all custom columns as they may have multiple rows in which case regular columns need rowspan set to the maximum number of rows. Once we've generated the first row, we proceed to generate subsequent rows for those custom columns that have multiple rows. (AdministrativePage::render_custom_cells): Added. This function is responsible for generating table cells for a given row in a given custom column. It generates an empty td when the custom column doesn't have enough rows. It also generates empty an td when it doesn't have enough columns in some rows except when the entire row consists of exactly one cell for a custom column with sub columns, in which case the cell is expanded to occupy all sub columns. * public/include/manifest.php: (ManifestGenerator::platforms): Don't add the metric more than once. * public/include/test-name-resolver.php: (TestNameResolver::__construct): We had wrongfully assumed that we have exactly one test configuration on each platform for each metric like tests.php. Fixed that. Also fetch the list of aggregators to compute the full metric name later. (TestNameResolver::map_metrics_to_tests): Populate $this->id_to_metric. (TestNameResolver::test_id_for_full_name): Simplified the code using array_get. (TestNameResolver::full_name_for_test): Added. (TestNameResolver::full_name_for_metric): Added. (TestNameResolver::configurations_for_metric_and_platform): Renamed as it returns multiple configurations. * public/js/helper-classes.js: (TestBuild): Use the build time as the maximum time when revision information is missing for "synthetic" test runs created to set baseline and target points. 2014-01-24 Ryosuke Niwa Build fix after r57928. Removed a superfluous close parenthesis. * public/api/runs.php: 2014-01-24 Ryosuke Niwa Unreviewed build & typo fixes. * public/admin/platforms.php: * tests/admin-platforms.js: 2014-01-24 Ryosuke Niwa perf dashboard should show baseline numbers Rubber-stamped by Antti Koivisto. Organize some code into functions in runs.php. Also added back $paths that was erroneously removed in r57925 from json-header.php. * public/api/runs.php: (fetch_runs_for_config): Extracted. (format_run): Ditto. 2014-01-23 Ryosuke Niwa Merge the upstream json-shared.php as of https://trac.webkit.org/r162693. * database/config.json: * public/admin/reprocess-report.php: * public/api/report.php: * public/api/runs.php: * public/include/json-header.php: 2014-01-23 Ryosuke Niwa Commit yet another forgotten change. Something went horribly wrong with my merge :( * database/init-database.sql: 2014-01-23 Ryosuke Niwa Commit one more forgotten change. Sorry for making a mess here. 2014-01-23 Ryosuke Niwa Commit the forgotten files. * public/admin/platforms.php: Added. * tests/admin-platforms.js: Added. 2014-01-23 Ryosuke Niwa SafariPerfMonitor: there should be a way to merge and hide platforms Reviewed by Stephanie Lewis. Added /admin/platforms/ page to hide and merge platforms. Merging two platforms is tricky because we need to migrate test runs as well as some test configurations. Recall that each test (e.g. Dromaeo) can have many "test metrics" (e.g. MaxAllocations, EndAllocations), and they have a distinct "test configuration" for each platform (e.g. MaxAllocation on Mountain Lion), and each test configuration a distinct "test run" for each build. In order to merge platform A into platform B, we must migrate all test runs that belong to platform A via their test configurations into platform B. Suppose we're migrating a test run R for test configuration T_A in platform A for metric M. Since M exists independent of platforms, R should continue to relate to M through some test configuration. Unfortunately, we can't simply move T_A into platform B since we may already have a test configuration T_B for metric M in platform B, in which case R should relate to T_B instead. Thus, we first migrate all test runs for which we already have corresponding test configurations in the new platform. We then migrate the test configurations of the remaining test runs. * database/init-database.sql: Added platform_hidden. * public/admin/platforms.php: Added. (merge_platforms): Added. Implements the algorithm described above. (merge_list): Added. * public/admin/tests.php: Disable the checkbox to show a test configuration on the dashboard if its platform is hidden since it doesn't do anything. * public/include/admin-header.php: Added the hyperlink to /admin/platforms. (update_field): Don't bail out if the newly added "update-column" is set to the field name even if $_POST is missing it since unchecked checkbox doesn't set the value in $_POST. (AdministrativePage::render_form_control_for_column): Added the support for boolean edit mode. Also used switch statement instead of repeated if's. (AdministrativePage::render_table): Emit "update-column" for update_field. * public/include/db.php: Disable warnings when we're not in the debug mode. * public/include/manifest.php: (ManifestGenerator::platforms): Skip platforms that have been hidden. * run-tests.js: (TestEnvironment.postJSON): (TestEnvironment.httpGet): (TestEnvironment.httpPost): Added. (sendHttpRequest): Set the content type if specified. * tests/admin-platforms.js: Added tests. 2014-01-22 Ryosuke Niwa Extract the code to compute full test names from tests.php. Reviewed by Stephanie Lewis. Extracted TestNameResolver out of tests.php. This reduces the number of global variables in tests.php and paves our way to re-use the code in other pages. * public/admin/tests.php: * public/include/db.php: (array_set_default): Renamed from array_item_set_default and moved from tests.php as it's used in both tests.php and test-name-resolver.php. * public/include/test-name-resolver.php: Added. (TestNameResolver::__construct): (TestNameResolver::compute_full_name): Moved from tests.php. (TestNameResolver::map_metrics_to_tests): Ditto. (TestNameResolver::sort_tests_by_full_name): Ditto. (TestNameResolver::tests): Added. (TestNameResolver::test_id_for_full_name): Ditto. (TestNameResolver::metrics_for_test_id): Ditto. (TestNameResolver::child_metrics_for_test_id): Ditto. (TestNameResolver::configuration_for_metric_and_platform): Ditto. 2014-01-21 Ryosuke Niwa Perf dashboard is erroneously associating reported results with old revisions Reviewed by Stephanie Lewis. Add the ability to reprocess reports so that I can re-associate wrongfully associated reports. Added public/admin/reprocess-report.php. It doesn't have any nice UI to find reports and it returns JSON but that's sufficient to correct the wrongfully processed reports for now. * public/admin/reprocess-report.php: Added. Takes a report id in $_GET or $_POST and process the report. We should eventually add a nice UI to find and reprocess reports. * public/api/report.php: ReportProcessor and TestRunsGenerator have been removed. * public/include/db.php: Added the forgotten call to prefixed_column_names. * public/include/report-processor.php: Copied from public/api/report.php. (ReportProcessor::__construct): Fetch the list of aggregators here for simplicity. (ReportProcessor::process): Optionally takes $existing_report_id. When this value is specified, we don't create a new report or authenticate the builder password (the password is never stored in the report). Also use select_first_row instead of query_and_fetch_all to find the builder for simplicity. (ReportProcessor::construct_build_data): Extracted from store_report_and_get_build_data. (ReportProcessor::store_report): Ditto. * tests/admin-reprocess-report.js: Added. 2014-01-21 Ryosuke Niwa Perf dashboard is erroneously associating reported results with old revisions Reviewed by Ricky Mondello. The bug was caused by a build fix r57645. It attempted to treat multiple reports from the same builder for the same build number as a single build by ignoring build time. This was necessary to associate multiple reports by a single build - e.g. for different performance test suites - because the scripts we use to submit results computed its own "build time" when they're called. An unintended consequence of this change was revealed when we moved a buildbot master to the new machine last week; new reports were wrongfully associated with old build numbers. Fixed the bug by not allowing reports made more than 1 day after the initial build time to be assigned to the same build. Instead, we create a new build object for those reports. Since the longest set of tests we have only take a couple of hours to run, 24 hours should be more than enough. * database/init-database.sql: We can no longer constrain that each build number is unique to a builder or that build number and build time pair is unique. Instead, constrain the uniqueness of the tuple (builder, build number, build time). * public/api/report.php: (ReportProcessor::resolve_build_id): Look for any builds made within the past one day. Create a new build when no such build exists. This prevents a report from being associated with a very old build of the same build number. Also check that revision numbers or hashes match when we're adding revision info. This will let us catch a similar bug in the future sooner. * tests/api-report.js: Added three test cases. 2014-01-20 Ryosuke Niwa Merged the upstream changes to db.php See http://trac.webkit.org/browser/trunk/Websites/test-results/public/include/db.php * public/include/db.php: 2014-01-20 Ryosuke Niwa Update other scripts and tests per previous patch. * public/include/manifest.php: * tests/admin-regenerate-manifest.js: 2014-01-20 Ryosuke Niwa Remove metrics_unit. Reviewed by Ricky Mondello. This column is no longer used by the front-end code since r48360. * database/init-database.sql: * public/admin/tests.php: 2014-01-16 Ryosuke Niwa Unreviewed build fix. * public/api/report.php: 2014-01-15 Ryosuke Niwa Automate DoYouEvenBench (124497) Reviewed by Ricky Mondello. Support a new alternative format for aggregated results where we have raw values as well as the list aggregators so that instead of "metrics": {"Time": ["Arithmetic"]} we can have "metrics": {"Time": { "aggregators" : ["Arithmetic"], "current": [300, 310, 320, 330] }} This allows single JSON generated by run-perf-tests in WebKit to be shared between the perf dashboard and the generated results page, which doesn't know how to aggregate values. We need to keep the support for the old format because all other existing performance tests all rely on the old format. Even if we updated the tests, we need the dashboard to support the old format during the transition. * public/api/report.php: (ReportProcessor::recursively_ensure_tests): Support the new format in addition to the old one. (ReportProcessor::aggregator_list_if_exists): Replaced is_list_of_aggregators. * tests/api-report.js: Updated one of aggregator test cases to test the new format. 2013-05-31 Ryosuke Niwa Unreviewed; Tweak the CSS so that chart panes align vertically. * public/index.html: 2013-05-31 Ryosuke Niwa SafariPerfMonitor should support Combined metric. * public/js/helper-classes.js: (PerfTestRuns): Added 'Combined' metric. In general, it could be used for smaller-is-better value as well but assume it to be greater-is-better for now. 2013-05-30 Ryosuke Niwa Commit the forgotten init-database change to add iteration_relative_time. * database/init-database.sql: 2013-05-30 Ryosuke Niwa SafariPerfMonitor: Support accepting (relative time, value) pairs Reviewed by Ricky Mondello. Add the support for each value to have a relative time. This is necessary for frame rate history since a frame rate needs to be associated with a time it was sampled. * database/init-database.sql: Added iteration_relative_time to run_iterations. * public/api/report.php: (TestRunsGenerator::test_value_list_to_values_by_iterations): Reject any non-numeral values here. This code is used to aggregate values but it doesn't make sense to aggregate iteration values with relative time since taking the average of two frame rates for two subtests taken at two different times doesn't make any sense. (TestRunsGenerator::compute_caches): When we encounter an array value while computing sum, mean, etc..., use the second element since we assume values are of the form (relative time, frame rate). Also exit early with an error if the number of elements in the array is not a pair. (TestRunsGenerator::commit): Store the relative time and the frame rate as needed. * tests/api-report.js: Added a test case. Also modified existing test cases to account for iteration_relative_time. 2013-05-27 Ryosuke Niwa SafariPerfMonitor: Support accepting single-value results Reviewed by Ricky Mondello. Support that. It's one line change. * public/api/report.php: (ReportProcessor.recursively_ensure_tests): When there is exactly one value, wrap it inside an array to match the convention assumed elsewhere. * tests/api-report.js: Added a test case. 2013-05-26 Ryosuke Niwa SafariPerfMonitor shows popups for points outside of the visible region. Rubber-stamped by Simon Fraser. * public/index.html: (Chart.closestItemForPageXRespectingPlotOffset): renamed from closestItemForPageX. (Chart.attach): Always use closestItemForPageXRespectingPlotOffset to work around the fact flot may return an item underneath y-axis labels. 2013-05-26 Ryosuke Niwa Tweak the CSS a little to avoid the test name overlapping with the summary table. * public/index.html: 2013-05-26 Ryosuke Niwa Unreviewed. Fix the typo. The anchor element should wrap the svg element, not the other way around. * public/index.html: 2013-05-26 Ryosuke Niwa Should be a toggle to show entire Y-axis range Should scale Y axis to include error ranges Reviewed by Ricky Mondello. Add the feature. Also made adjust y-axis respect confidence interval delta so that the gray shade behind the main graph doesn't go outside the graph even when the y-axis is adjusted. * database/config.json: * public/index.html: (Chart): Add a SVG arrow to toggle y-axis mode, and bind click on the arrow to toggleYAxis(). (Chart.attachMainPlot): Respect shouldStartYAxisAtZero. (Chart.toggleYAxis): Toggle the y-axis mode of this chart by toggling shouldStartYAxisAtZero and calling attachMainPlot. * public/js/helper-classes.js: (PerfTestResult.confidenceIntervalDelta): (PerfTestResult.unscaledConfidenceIntervalDelta): Extracted. (PerfTestRuns.min): Take confidence interval delta into account. (PerfTestRuns.max): Ditto. (PerfTestRuns.hasConfidenceInterval): Not sure why this function was checking the typeof. Just use isNaN. 2013-04-26 Ryosuke Niwa A build fix of the previous. Don't look for a test with NULL parent because NULL != NULL in our beloved SQL. * public/api/report.php: (ReportProcessor::recursively_ensure_tests): * tests/api-report.js: Added a test. 2013-04-26 Ryosuke Niwa Unreviewed build fixes. * public/api/report.php: (ReportProcessor::process): Explicitly exit with error when builder name or build time is missing. Also, tolerate reports without any revision information. (ReportProcessor::recursively_ensure_tests): When looking for a test, don't forget to compare its parent test. * tests/api-report.js: Added few test cases. 2013-04-26 Ryosuke Niwa Commit another change that was supposed to be committed in r50331. * run-tests.js: (TestEnvironment.this.postJSON): (TestEnvironment.this.httpGet): (sendHttpRequest): 2013-04-09 Ryosuke Niwa Commit the remaining files. * public/admin/regenerate-manifest.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/manifest.php: * run-tests.js: (TestEnvironment.this.postJSON): (TestEnvironment.this.httpGet): (sendHttpRequest): 2013-03-15 Ryosuke Niwa SafariPerfMonitor: Add some tests for admin/regenerate-manifest. Reviewed by Ricky Mondello. Added some tests for admin/regenerate-manifest. * public/admin/regenerate-manifest.php: Use require_once instead of require. * public/include/admin-header.php: Ditto. * public/include/json-header.php: Ditto. * public/include/manifest.php: (ManifestGenerator::builders): Removed a reference to a non-existent variable. When there are no builders, simply return an empty array. * run-tests.js: (TestEnvironment.postJSON): (TestEnvironment.httpGet): Added. (sendHttpRequest): Renamed from postHttpRequest as it now takes method as an argument. * tests/admin-regenerate-manifest.js: Added with a bunch of test cases. 2013-03-14 Ryosuke Niwa Unreviewed. Added more tests for api/report to ensure it creates tests, metrics, test_runs, and run_iterations. Also fixed a typo in report.php found by new tests. * public/api/report.php: (main): Fix a bug in the regular expression to wrap numbers with double quotations. * tests/api-report.js: Added more test cases. 2013-03-12 Ryosuke Niwa SafariPerfMonitor: Need integration tests Reviewed by Ricky Mondello. Add a test runner script and some simple test cases. * database/config.json: Added the configuration for "testServer". * database/database-common.js: (pathToTests): Added. * run-tests.js: Added. (main): (confirmUserWantsDatabaseToBeInitializedIfNeeded): Checks whether there are any non-empty tables, and if there are, asks the user if it’s okay to delete all of the data contained therein. (confirmUserWantsDatabaseToBeInitializedIfNeeded.findNonEmptyTable): Find a table with non-zero number of rows. (confirmUserWantsDatabaseToBeInitializedIfNeeded.fetchTableNames): Fetch the list of all tables in the current database using PostgreSQL's information_schema. (askYesOrNoQuestion): (initializeDatabase): Executes init-database.sql. It drops all tables and creates them again. (TestEnvironment): The global object exposed in tests. Provides various utility functions. (TestEnvironment.assert): Exposes assert to tests. (TestEnvironment.console): Exposes console to tests. (TestEnvironment.describe): Adds a description. (TestEnvironment.it): Adds a test case. (TestEnvironment.postJSON): (TestEnvironment.queryAndFetchAll): (TestEnvironment.sha256): (TestEnvironment.notifyDone): Ends the current test case. (postHttpRequest): (TestContext): An object created for each test case. Conceptually, this object is always on "stack" when a test case is running. TestEnvironment and an uncaughtException handler accesses this object via currentTestContext. (TestContext.description): (TestContext.done): (TestContext.logError): * tests: Added. * tests/api-report.js: Added some basic tests for /api/report.php. 2013-03-08 Ryosuke Niwa Unreviewed administrative page fix. Make it possible to remove all configuration from dashboard. The problem was that we were detecting whether we're updating dashboard or not by checking the existence of metric_configurations in $_POST but this key doesn't exist when we're removing all configurations. Use separate 'dashboard' action to execute the code even when metric_configurations is empty. * public/admin/tests.php: 2013-03-08 Ryosuke Niwa SafariPerfMonitor: Extract a class to aggregate and store values from ReportProcessor. Reviewed by Ricky Mondello. This patch extracts TestRunsGenerator, which aggregates and compute caches of values, from ReportProcessor as a preparation to replace deprecated aggregate.js. * public/api/report.php: (ReportProcessor::exit_with_error): Moved. (ReportProcessor::process): Use the extracted TestRunsGenerator. (TestRunsGenerator): Added. (TestRunsGenerator::exit_with_error): Copied from ReportProcessor. (TestRunsGenerator::add_aggregated_metric): Moved. (TestRunsGenerator::add_values_for_aggregation): Moved. Made public. (TestRunsGenerator::aggregate): Moved. Made public. (TestRunsGenerator::aggregate_current_test_level): Moved. (TestRunsGenerator::test_value_list_to_values_by_iterations): Moved. (TestRunsGenerator::evaluate_expressions_by_node): Moved. (TestRunsGenerator::compute_caches): Moved. Made public. (TestRunsGenerator::add_values_to_commit): Moved. Made public. (TestRunsGenerator::commit): Moved. Made public. Also takes build_id and platform_id. (TestRunsGenerator::rollback_with_error): Moved. 2013-03-08 Ryosuke Niwa SafariPerfMonitor: Administrative pages should update manifest JSON as needed. Reviewed by Remy Demarest. Regenerate the manifest file when updating fields or adding new items that are included in the manifest JSON. * public/admin/bug-trackers.php: * public/admin/builders.php: * public/admin/regenerate-manifest.php: * public/admin/repositories.php: * public/admin/tests.php: * public/include/admin-header.php: (regenerate_manifest): Extracted from regenerate-manifest.php. 2013-03-08 Ryosuke Niwa Unreviewed build fix for memory test results. Make aggregation work in the nested cases. We start from the "leaf" tests and move our ways up, aggregating at each level. * public/api/report.php: (ReportProcessor::recursively_ensure_tests): (ReportProcessor::add_aggregated_metric): Renamed from ensure_aggregated_metric. (ReportProcessor::add_values_for_aggregation): (ReportProcessor::aggregate): (ReportProcessor::aggregate_current_test_level): Extracted from aggregate. 2013-03-02 Ryosuke Niwa Build fixes. iteration_count_cache should be the total number of values in all iteration group, not the number of iteration groups. Also, don't set group number when the entire run belongs a single iteration group. * public/api/report.php: (ReportProcessor::commit): 2013-03-01 Ryosuke Niwa SafariPerfMonitor: Introduce iteration groups Reviewed by Remy Demarest. In WebKit land, we're going to use multiple instances of DumpRenderTree or WebKitTestRunner to amortize the runtime environment variances to get more stable results. And it's desirable to keep track of the instance of DumpRenderTree or WebKitTestRunner used to generate each iteration value. This patch introduces "iteration groups" to keep track of this extra information. Instead of receiving a flat array of iteration values, we can now receive a two dimensional array where the outer array denotes iteration groups and each inner array contains iteration values for each group. * database/init-database.sql: Add iteration_group column. * public/api/report.php: (ReportProcessor::recursively_ensure_tests): Always use the two dimensional array internally. (ReportProcessor::aggregate): test_value_list_to_values_by_iterations now returns an associative array contains the list of values indexed by the iteration order and group sizes. Store the group size so that we can restore the iteration groups before passing it to node.js and restore them later. (ReportProcessor::test_value_list_to_values_by_iterations): Flatten iteration groups into an array of values and construct group_size array to restore the groups later in ReportProcessor::aggregate. Also check that each iteration group in each subtest are consistent with one another. To see why we need to do this, suppose we're aggregating two tests T1 and T2 with the following values. Then it's important that each iteration group in T1 and T2 have the same size: T1 = [[1, 2], [3, 4, 5]] T2 = [[6, 7], [8, 9, 10]] so that the aggregated result (the sum in this case) can have the same groups as in: T = [[7, 9], [11, 13, 15]] If some iteration groups in T1 and T2 had a different size as in: T1 = [[1, 2, 3], [4, 5]] T2 = [[6, 7], [8, 9, 10]] Then iteration groups of the aggregated T is ambiguous. (ReportProcessor::compute_caches): Flatten iteration groups to compute caches (e.g. mean, stdev, etc...) (ReportProcessor::commit): Store iteration_group values. 2013-03-01 Ryosuke Niwa Unreviewed. Delete the migration tool for webkit-perf.appspot.com now that we have successfully migrated to perf.webkit.org. * database/perf-webkit-migrator.js: Removed. 2013-03-01 Ryosuke Niwa Build fix. Don't forget to add metrics of the top level tests e.g. Dromaeo:Time:Arithmetic. * public/index.html: (.showCharts): 2013-03-01 Ryosuke Niwa SafariPerfMonitor: Make it possible to add charts for all subtests or all platforms. Reviewed by Ricky Mondello. It is often desirable to see charts of a given test for all platforms, or to be able to see charts of all subtests on a given platform when trying to triage perf. regressions. Support this use case by adding the ability to do so on the charts page. Also, we used to disable items on the test list based on the platform chosen. This turned out to be a bad UI because in many situations you want to be able to compare results of the same test on multiple platforms. In this new UI, we have three select elements, each of which selects the following: 1. Top-level test - Test suite such as Dromaeo 2. Metric - Pages and subtests under the suite such as www.webkit.org for dom-modify:Runs (where dom-modify is the name of the subtest and Runs is a metric in that subtest) for Dromaeo. 3. Platform - Mountain Lion, Qt, etc... A user can select "all" for metric and platform but we disallow doing both at once since adding all metrics on all platforms tends to add way too many charts and hang the browser. I also can't think of a use case where you want to look at that many charts at once. We can support this later if valid use cases come up. * public/index.html: (.showCharts.addOption): Extracted. (.showCharts): Added "metricList" that shows the list of test and metrics (in the form of relative metrics paths such as "DOMWalk:Time") for each top-level test selected in testList. metricList has onchange handler that enables/disables items on platformList. (init): Sort tests and test metrics here instead of doing that in showCharts. 2013-02-28 Ryosuke Niwa SafariPerfMonitor: tooltip should include a link to build URLs Reviewed by Remy Demarest and Ricky Mondello. Added a hyperlink to build page in tooltips. Repeating the entire build URL in each build was a bad idea because it bloats the resultant JSON file too much. So move the build URL templates to the manifest file instead. Each build now only contains the builder id. * public/api/runs.php: Removed the part of the query that joined builders table. This speeds up the query quite a bit. * public/include/manifest.php: (ManifestGenerator::generate): Generate builders field. (ManifestGenerator::builders): Added. Returns an associative array of builder ids to an associative array that contains name and its build URL template. * public/index.html: (.buildLabelWithLinks.linkifyIfNotNull): Renamed from linkifiedLabel. Take a label and url instead of a revision since this function is used for revisions and build page URLs now. (.buildLabelWithLinks): Include the linkified build number. * public/js/helper-classes.js: (TestBuild.builder): Added. (TestBuild.buildNumber): Added. (TestBuild.buildUrl): Returns the build URL. The variable name in the URL template has been changed from %s to $buildNumber to be more descriptive and consistent with other URL templates. 2013-02-27 Ryosuke Niwa Tooltips interfere with user interactions Rubber-stamped by Simon Fraser. Disable tooltip on the dashboard page since graphs are too small to be useful there. Also, show graphs for only 10 days by default as opposed to 20. Finally, dismiss the hovering tooltip when mouse enters a "pinned" tooltip. * public/index.html: * public/js/helper-classes.js: 2013-02-24 Ryosuke Niwa Fix some serious typo. We're supposed to be using SHA-256, not SHA-1 to hash our passwords, to be compatible with webkit-perf.appspot.com. * public/admin/builders.php: * public/api/report.php: 2013-02-23 Ryosuke Niwa Unreviewed. Add a missing constraint on builds table. For a given builder, there should be exactly one build for a given build number. Also add report_committed_at to reports table to record the time at which a given report was processed and test_runs and run_iterations rows were committed into the database. * database/config.json: * public/api/report.php: 2013-02-22 Ryosuke Niwa Unreviewed. Add more checks for empty SQL query results. * public/include/manifest.php: 2013-02-21 Ryosuke Niwa More build fixes on perf.webkit.org. * public/api/runs.php: Make PostgreSQL happier. * public/include/manifest.php: Don't assume we always have bug trackers. 2013-02-21 Ryosuke Niwa SafariPerfMonitor: index.html duplicates the code in PerfTestRuns to determine smallerIsBetter and fix other miscellaneous UI bugs. Rubber-stamped by Simon Fraser. Removed the code to determine whether smaller value is better or not for a given test in index.html in the favor of using that of PerfTestRuns. * public/include/manifest.php: Fixed a typo. * public/index.html: (Chart): (Chart.attachMainPlot): Fixed a bug to access previousPoint.left even when previousPoint is null. * public/js/helper-classes.js: (PerfTestRuns): Added EndAllocations, MaxAllocations, and MeanAllocations. (PerfTestRuns.computeScalingFactorIfNeeded): When the mean is almost 10,000 units, we may end up using 5 digits instead of 4, resulting in the use of scientific notations. Go up to the next unit at roughly 2,000 units to avoid this. (Tooltip.show): Show the tooltip even when the new content is identical to the previous content. The only thing we can avoid is innerHTML. 2013-02-21 Ryosuke Niwa Another build fix. The path to node is /usr/local/bin/node, not /usr/bin/local/node * public/include/evaluator.js: 2013-02-21 Ryosuke Niwa SafariPerfMonitor: Bug trackers should be configurable Reviewed by Remy Demarest. Made the list of bug trackers configurable. Namely, each bug tracker can be added in admin/bug-trackers.php and can be associated with multiple repositories. The association between bug trackers and repositories (such as WebKit, Safari, etc...) are used to determine the set of bug trackers to show for a given set of blame lists. e.g. if a test regressed due to a change in Safari, then we don't want to show WebKit Bugzilla as a place to file bugs against the regression. F * database/init-database.sql: Added bug_trackers and tracker_repositories. Also drop those tables before creating them (note "DROP TABLE reports" was missing). * public/admin/bug-trackers.php: Added. The administrative interface for adding and managing bug trackers, namely associated repositories. * public/include/admin-header.php: Added a link to bug-trackers.php * public/include/manifest.php: (ManifestGenerator::generate): Include the list of bug trackers in the manifest. Also moved the code to fetch repositories table here from ManifestGenerator::repositories. (ManifestGenerator::repositories): (ManifestGenerator::bug_trackers): Added. Generates an associative array of bug trackers where keys are names of bug trackers and values are associative arrays with keys 'new_bug_url' and 'repositories' where the latter contains the list of associated repository names. * public/index.html: (Chart): Takes bugTrackers as as argument. (Chart.showTooltipWithResults): Removed the hard-coded list. (init): (init.addPlatformsToDashboard): (init.showCharts.createChartFromListPair): (init): Stores the list of bug trackers in the manifest to a local variable. 2013-02-21 Ryosuke Niwa A follow up on the previous build fix. When using proc_open, we need to make evalulator.js executable. * public/include/evaluator.js: 2013-02-21 Ryosuke Niwa SafariPerfMonitor: Extract the code to generate tabular view in administrative pages Reviewed by Remy Demarest. Extracted AdministrativePage to share the code to generate a tabular view of data and a form to insert new row into the database. * public/admin/aggregators.php: Use AdministrativePage. * public/admin/builders.php: Ditto. * public/admin/repositories.php: Ditto. * public/include/admin-header.php: (AdministrativePage): Added. (AdministrativePage::__construct): column_info is an associative array that maps a SQL column name to an associative array that describes the column. - editing_mode: Specifies the type of form ('text', 'url', or 'string') to show for this column. - label: Human readable name of the column. - pre_insertion: Signifies that this column exists only before the row is inserted. e.g. password column exists only before we create password_hash column at the insertion time. (AdministrativePage::name_to_titlecase): Converts an underscored lowercase name to a human readable titlecase (e.g. new_bug is converted to New Bug). (AdministrativePage::column_label): Obtains the label specified in column_info or titlecased column name. (AdministrativePage::render_form_control_for_column): "Renders" a text form control such as input and textarea for a given editing mode ('text', 'url', or 'string'). (AdministrativePage::render_table): Renders a whole SQL table after sorting rows by the specified column. (AdministrativePage::render_form_to_add): Renders a form to insert new row. 2013-02-20 Ryosuke Niwa Build fix. Some systems don't support r+. Use proc_open instead. * public/api/report.php: 2013-02-15 Ryosuke Niwa Build fix. Use the mean data series as supposed to upper or lower confidence bounds when computing the y-axis of data points to show tooltips at. * public/index.html: 2013-02-15 Ryosuke Niwa Unreviewed. Removed .htaccess in favor of directly putting directives in httpd.conf. * Install.md: * public/.htaccess: Removed. 2013-02-14 Ryosuke Niwa Unreviewed. * public/include/manifest.php: Build fix. db is on this. * public/js/statistics.js: (Statistics.confidenceInterval): Added. An utility function for debugging purposes. 2013-02-13 Ryosuke Niwa SafariPerfMonitor doesn't work on perf.webkit.org (Part 2) Reviewed by Anders Carlsson. Rewrote and merged populate-from-report.js into report.php. * database/config.json: Added a path to node.js. * database/init-database.sql: Don't require unit to be always present since it's no longer used by the front end. Once we land this patch and update the administrative pages, we can remove this column. Also add a new reports table to store JSON reported by builders. We used to store everything in jobs table but that table is going away once we remove the node.js backend. * database/populate-from-report.js: Removed. * public/api/report.php: Added. (ReportProcessor): (ReportProcessor.__construct): (ReportProcessor.process): (ReportProcessor.store_report_and_get_build_data): We store the report into the database as soon as it has been verified to be submitted by a known builder. (ReportProcessor.exit_with_error): Store the error message and details in the database if the report had been stored. If not, then notify that to the client via 'failureStored' in the JSON response. (ReportProcessor.resolve_build_id): Insert build and build_revisions rows if needed. We don't do this atomically inside a transaction because there could be multiple reports for a single build, each containing results for different tests. (ReportProcessor.recursively_ensure_tests): Parse a tree of tests and insert tests and test_metrics rows as needed. It also computes the metrics to aggregate and prepares values to commit via ensure_aggregated_metric, add_values_to_commit, and add_values_for_aggregation. (ReportProcessor.is_list_of_aggregators): When a metric is an aggregation, it contains an array of aggregator names, e.g. ["Arithmetic", "Geometric"], instead of a dictionary of configuration types to their values, e.g. {Time: {current: [1, 2, 3,]}}. This function detects the former. (Note that dictionary and list are both array's in PHP). (ReportProcessor.ensure_aggregated_metric): Create a metric with aggregator to add it to the list of metrics to be aggregated in ReportProcessor.aggregate. (ReportProcessor.add_values_for_aggregation): Called by test metrics with aggregated parent test metrics. (ReportProcessor.aggregate): Compute results for aggregated metrics. Consider a matrix with rows representing child tests and columns representing "iterations" for a given aggregated metrics M. Initially, we have values given for each row (child metrics of M). This function extracts each column (iteration) via test_value_list_to_values_by_iterations, and feeds it into evaluate_expressions_by_node to get aggregated values for each column (iteration of M). Finally, it registers those aggregated values to be committed. Note that we don't want to start a new node.js process for each aggregation, so we accumulate all values to be aggregated in node.js in $expressions. Each entry in $expressions is a JSON string that contains code and values to be aggregated. node.js gives us back a list of JSON strings that contain aggregated values. (ReportProcessor.test_value_list_to_values_by_iterations): See above. (ReportProcessor.evaluate_expressions_by_node): See above. (ReportProcessor.compute_caches): Compute cached mean, sum, and square sums for each run we're about to add using evaluate_expressions_by_node. We can't do this before computing aggregated results since those aggregated results also need the said caches. (ReportProcessor.add_values_to_commit): (ReportProcessor.commit): Add test_runs and run_iterations atomically inside a transaction, rolling back the transaction as needed if anything goes wrong. (ReportProcessor.rollback_with_error) (main): * public/include/db.php: (Database.prepare_params): Use $values (instead of $placeholders) to compute the current index since placeholders ($1, $2, etc...) may be split up into multiple arrays given they may not necessarily show up contiguously in a SQL statement. (Database.select_or_insert_row): Added. Selects a row if the attempt to insert the same row fails. It automatically creates a query string from a dictionary of unprefixed column names and table. It returns a column value of the choice. (Database.begin_transaction): Added. (Database.commit_transaction): Added. (Database.rollback_transaction): Added. * public/include/evaluator.js: Added. * public/include/json-header.php: (exit_with_error): Take error details and merge it with "additional details". This allows report.php to provide context under which the request failed. (successful_exit): Merge "additional details". (set_exit_detail): Added. Sets "additional details" to the JSON returned by exit_with_error or successful_exit. (merge_additional_details): 2013-02-12 Ryosuke Niwa SafariPerfMonitor: Add more helper functions to db.php Reviewed by Remy Demarest. Added Database::insert_row and array_get to make common database operations easier. * public/admin/aggregators.php: Use Database::insert_row instead of execute_query_and_expect_one_row_to_be_affected. * public/admin/builders.php: Ditto. * public/admin/tests.php: Ditto; We used to run a separate SELECT query just to get the id after inserting a row. With insert_row, we don't need that. * public/include/admin-header.php: Ditto. * public/include/db.php: (array_get): Added. It returns the value of an array given a key if the key exists; otherwise return the default value (defaults to NULL) if the key doesn't exist. (Database::column_names): Added. Prefixes an array of column names and creates a comma separated list of the names. (Database::prepare_params): Added. Takes an associative array of column names and their values, and builds up arrays for placeholder (e.g. $1, $2, etc...) and values, then returns an array of column names all in the same order. (Database::insert_row): Added. Inserts a new row into the specified table where column names have the given prefix. Values are given in a form of an associative array where keys are unprefixed column names and values are corresponding values. When the row is successfully inserted, it returns the specified column's value (defaults to prefix_id). If NULL is specified, it returns a boolean indicating the success of the insertion. 2013-02-11 Ryosuke Niwa SafariPerfMonitor doesn't work on perf.webkit.org (Part 1) Reviewed by Conrad Shultz. Rewrote the manifest generator in PHP. * database/generate-manifest.js: Removed. * public/admin/regenerate-manifest.php: Added. Use ManifestGenerator to generate and store the manifest. * public/include/db.php: (array_ensure_item_has_array): Added. * public/include/evaluator.js: Added. * public/include/json-header.php: * public/include/manifest.php: Added. 2013-02-11 Ryosuke Niwa Dates on overflow plot are overlapping Rubber-stamped by Simon Fraser. Don't show more than 5 days. * public/index.html: * public/js/helper-classes.js: (TestBuild.UTCtoPST): (TestBuild.now): 2013-02-07 Ryosuke Niwa Show build time as well as commit time on the dashboard and tooltips. Rubber-stamped by Simon Fraser. Include both the maximum commit time and build time in buildLabelWithLinks. Also use ISO format to save the screen real estate. * public/index.html: (buildLabelWithLinks): * public/js/helper-classes.js: (TestBuild): (TestBuild.buildTime): (TestBuild.formattedBuildTime): 2013-02-08 Ryosuke Niwa Unreviewed; Convert metric.name to metric.unit in the front end. * public/js/helper-classes.js: 2013-02-07 Ryosuke Niwa SafariPerfMonitor: Need hyperlinks to file bugs Rubber-stamped by Simon Fraser. This patch adds hyperlinks to file new bugs on Radar and WebKit Bugzilla. Because we want to include information such as the degree of progression or regression and the regression ranges when filing new bugs, broke various label() functions into smaller pieces to be used in both generating tooltips and the hyperlinks. * public/index.html: (.buildLabelWithLinks): Extracted from TestBuild.label. (.showTooltipWithResults): Extracted from Tooltip.show. Also added the code to generate hyperlinks to file new bugs on Radar and WebKit Bugzilla. * public/js/helper-classes.js: (PerfTestResult.metric): Replaced test() as runs.test() no longer exists. (PerfTestResult.isBetterThan): Added. (PerfTestResult.formattedRelativeDifference): Extracted from PerfTestResult.label. (PerfTestResult.formattedProgressionOrRegression): Ditto. Also use "better" and "worse" instead of arrow symbols to indicate progressions or regressions. (PerfTestResult.label): (TestBuild.formattedTime): Added. (TestBuild.platform): Added. (TestBuild.formattedRevisions): Extracted from TestBuild.label. Merged a part of linkifyLabel. (TestBuild.smallerIsBetter): Added. (Tooltip.show): Take a raw markup instead of two results. 2013-02-06 Ryosuke Niwa SafariPerfMonitor: Dashboard can cause excessive horizontal scrolling when there are many platforms Rubber-stamped by Tim Horton. Stack platforms when there are more than 3 of them since making the layout adaptive is tricky since each platform may have a different number of tests to be shown on the dashboard. * public/index.html: 2013-02-05 Ryosuke Niwa Build fix. Don't prefix a SVn revision with 'r' when constructing a changeset / blame URL. * public/js/helper-classes.js: (TestBuild.label): 2013-02-05 Ryosuke Niwa SafariPerfMonitor: repository names or revisions are double-quoted when they contain a space Rubber-stamped by Tim Horton. The bug was in the PHP code that parsed Postgres array. Trim double quotations as needed. Also fixed a bug in TestBuild where we used to show the revision range as r1234-1250 when the revision r1234 was the revision used in the previous build. * public/api/runs.php: (parse_revisions_array): Trim double quotations around repository names and revisions. * public/js/helper-classes.js: (TestBuild.label): 2013-02-05 Ryosuke Niwa SafariPerfMonitor: Tooltip is unusable Rubber-stamped by Tim Horton. * public/index.html: (Chart.attachMainPlot): Disable auto highlighting (circle around a data point that shows up on hover) on the dashboard page as it's way too noisy. (Chart.hideTooltip): Added. Hides the tooltip that shows up on hover. (.toggleClickTooltip): Extracted from the code for "mouseout" bind (now replaced by "mouseleave"). Pins or unpins a tooltip. When pinning a tooltip, we create a tooltip behind the scene and show that so that the tooltip for hover can be reused further. (.closestItemForPageX): Find the closest item given pageX. We iterate data points from left to right, and find the first point that lies on the right of the cursor position. We then compute the midpoint between this and the previous point and pick the closer of the two. It returns an item-like object that has all properties we need since flot doesn't provide an API to retrieve the real item object. (Chart): Call toggleClickTooltip when a (hover) tooltip is clicked. (Chart.attach): In "plothover" bind, call closestItemForPageX when item is not provided by flot on the first or "current" data points (as opposed to target or baseline data points). Also bind the code to clear crosshair and hide tooltips to "mouseleave" instead of "mouseout", and avoid triggering this code when the cursor is still within the plot's rectangle (e.g. when a cursor moves onto a tooltip) to avoid the premature dismissal of a tooltip. * public/js/helper-classes.js: (Tooltip.ensureContainer): Don't automatically close then the user clicks on tooltip. Delegate this work to the client via bindClick. (Tooltip.show): Move tooltip up by 5px. Also added a FIXME to move this offset computation to the client. (Tooltip.bindClick): Added. 2013-02-03 Ryosuke Niwa Yet another build fix. metricId*s*. * public/admin/tests.php: 2013-02-03 Ryosuke Niwa Another build fix. Use the new payload format for the aggregate job. * public/admin/tests.php: 2013-02-03 Ryosuke Niwa Build fixes. * database/aggregate.js: Use variables that actually exist. * database/database-common.js: (ensureConfigurationIdFromList): Add the newly added configuration to the list so that subsequent function calls will find this configuration. 2013-01-31 Ryosuke Niwa SafariPerfMonitor: Add ReadMe Reviewed by Ricky Mondello. Turned InstallManual into a proper markdown document and added ReadMe.md. * InstallManual: Removed. * InstallManual.md: Moved from InstallManual. * ReadMe.md: Added. 2013-01-31 Ryosuke Niwa SafariPerfMonitor: Add baseline and target lines Reviewed by Ricky Mondello. This patch prepares the front end code to process baseline and target results properly. * public/index.html: (fetchTest.createRunAndResults): Extracted. (fetchTest): Call createRunAndResults on current, baseline, and target values of the JSON. Deleted the comment about how sorting will be unnecessary once we start results in the server side since sorting by the maximum revision commit time turned out to be non-trivial in php. 2013-01-29 Ryosuke Niwa SafariPerfMonitor: Use newer version of flot that supports timezone properly Reviewed by Tim Horton. Use flot at https://github.com/flot/flot/commit/ec168da2cb8619ebf59c7e721d12c44a7960ff41. These files are "dynamically linked" to our app. * public/index.html: * public/js/jquery-1.8.2.min.js: Removed. * public/js/jquery.colorhelpers.js: Added. * public/js/jquery.flot.categories.js: Added. * public/js/jquery.flot.crosshair.js: Added. * public/js/jquery.flot.errorbars.js: Added. * public/js/jquery.flot.fillbetween.js: Added. * public/js/jquery.flot.js: Added. * public/js/jquery.flot.min.js: Removed. * public/js/jquery.flot.navigate.js: Added. * public/js/jquery.flot.resize.js: Added. * public/js/jquery.flot.selection.js: Added. * public/js/jquery.flot.stack.js: Added. * public/js/jquery.flot.symbol.js: Added. * public/js/jquery.flot.threshold.js: Added. * public/js/jquery.flot.time.js: Added. * public/js/jquery.js: Added. 2013-01-29 Ryosuke Niwa Return NaN instead of throwing when there aren't enough samples. Reviewed by Sam Weinig. It's better to return NaN when we don't have enough samples so that we can treat it as if we don't have any confidence interval. * public/js/statistics.js: (Statistics.new): 2013-01-28 Ryosuke Niwa Build fix. Apparently Safari sometimes appends / at the end of hash location. Remove that. * public/js/helper-classes.js: (URLState.parseIfNeeded): 2013-01-28 Ryosuke Niwa SafariPerfMonitor: Always use parameterized SQL functions in php code Reviewed by Ricky Mondello. Parameterized execute_query_and_expect_one_row_to_be_affected and updated the code accordingly. * public/admin/aggregators.php: Use heredoc. * public/admin/builders.php: * public/admin/jobs.php: * public/admin/repositories.php: * public/admin/tests.php: Updated the forms to use unprefixed field names to match other pages. This allows us to use update_field when updating test's url and metric's unit. Changed the action to regenerate aggregated matrix from "update" to "add" to simplify the dependencies in if-else. Also removed a stray code to update unit and url simultaneously since it's never used. * public/include/admin-header.php: (execute_query_and_expect_one_row_to_be_affected): Added $params. Also automatically convert empty strings to NULL as it was previously done via $db->quote_string_or_null_if_empty in callers. (update_field): Moved from repositories.php. (add_job): * public/include/db.php: (quote_string_or_null_if_empty): Removed now that nobody uses this function. 2013-01-25 Ryosuke Niwa Build fixes. Treat mean, sum, and square sum as float, not int. Also use 95% confidence interval instead of 90% confidence interval. * public/api/runs.php: * public/js/helper-classes.js: (.this.confidenceIntervalDelta): 2013-01-24 Ryosuke Niwa Add an administrative page to edit repository information. Reviewed by Ricky Mondello. * public/admin/repositories.php: Added. * public/include/admin-header.php: 2013-01-23 Ryosuke Niwa SafariPerfMonitor: Automatically create aggregated metrics from builder reports Reviewed by Ricky Mondello. Auto-create aggregated matrix such as arithmetic means and geometric means as requested and add a job to aggregate results for those matrix in populate-from-report.js. * database/generate-manifest.js: (.): Include aggregator names such as Arithmetic and Geometric in the list of metrics. * database/init-database.sql: Remove an erroneous unique constraint. There could be multiple matrix that share the same test and name (e.g. Dromaeo, Time) with different aggregators (e.g. Arithmetic and Geometric). * database/populate-from-report.js: (main): (getReport): No change even though the diff looks as if it moved. (processReport): Extracted from main. Fetch the list of aggregators, pass that to recursivelyEnsureTestsIdsAndMetricsIds to obtain the list of aggregated metrics (such as arithmetic means) that need to be passed to aggregate.js (scheduleJobs): Extracted from processReport. Add a job to aggregate results. (recursivelyEnsureTestsIdsAndMetricsIds): When a metric is a list of names, assume them as aggregator names, and add corresponding metrics for them. Note we convert those names to ids using the dictionary we obtained in processReport. (ensureMetricId): Take an aggregator id as an argument. * database/process-jobs.js: Support multiple metric ids and build id. Note that aggregate.js aggregates results for all builds when the build id is not specified. * public/admin/tests.php: * public/index.html: Include the aggregator name in the full name since there could be multiple metrics of the same name with different aggregators. 2013-01-22 Ryosuke Niwa Build fix. Don't pass in arguments to in the wrong order. * database/aggregate.js: 2013-01-21 Ryosuke Niwa SafariPerfMonitor: x-axis is messed up Reviewed by Ricky Mondello. Since the version of flot we use doesn't support showing graphs in the current locate or in a specific timezone, convert all timestamps to PST manually (Date's constructor will still treat them as in UTC). We don't want to use the current locate because other websites on webkit.org assume PST. Also append this information to build's label. * public/js/helper-classes.js: (TestBuild): (TestBuild.label): 2013-01-21 Ryosuke Niwa Store test URLs reported by builders. Reviewed by Ricky Mondello. * database/populate-from-report.js: (recursivelyEnsureTestsIdsAndMetricsIds): Pass in the test url. (ensureTestId): Store the URL. 2013-01-20 Ryosuke Niwa Yet another build fix; don't blow up even if we didn't have any test configurations. * public/admin/tests.php: 2013-01-21 Ryosuke Niwa Build fix; don't instantiate Date when a timestamp wasn't provided. * database/populate-from-report.js: 2013-01-18 Ryosuke Niwa Rename SafariPerfDashboard to SafariPerfMonitor and add a install manual. Reviewed by Tim Horton. Added an install manual. * InstallManual: Added. 2012-12-21 Ryosuke Niwa Minor build fix. Don't unset builderPassword when it's not set. * public/api/report.php: 2012-12-18 Ryosuke Niwa Prettify JSON payloads and make very large payloads not explode the table in jobs.php. Reviewed by Ricky Mondello. * public/admin/admin.css: Make a very large payload scrollable. * public/admin/jobs.php: Format JSONs. 2012-12-19 Ryosuke Niwa SafariPerfMonitor: Add ability to report results from bots Reviewed by Ricky Mondello. Add report.php and populate-from-report.js that process JSON files submitted by builders. * database/populate-from-report.js: Added. (main): (getReport): Obtains the payload (the actual report) from "jobs" table. (recursivelyEnsureTestsIdsAndMetricsIds): "reports.tests" contain a tree of tests, test metrics, and their results. This function recursively traverses tests and metrics and ensure their ids. (ensureTestId): (metricToUnit): Maps a metric name to a unit. This should really be done in the client side since there is no point in storing unit given that every metric maps to exactly one unit (i.e. the mapping is a "function" in mathematical sense). (ensureMetricId): (ensureRepositoryIdsForAllRevisions): (getIdOrCreateBuildWithRevisions): (ensureBuildIdAndRevisions): Obtains a build id given a builder name, a build number, and a build time if one already exists. If not, then inserts a new build and corresponding revisions information (e.g. build 123 may contain WebKit revision r456789). We don't retrieve rows for revisions since we don't use it elsewhere. (insertRun): Insert new rows into "test_runs" and "run_iterations" tables, thereby recording the new test results all in a single transaction. This allows us to keep the database consistent in that either a build has been reported or not at least in "test_runs" and "run_iterations" tables. It'll be ideal if we could do the same for "builds" and "build_revisions" but that's not a hard requirement as far as other parts of the application are concerned. (scheduleQueriesToInsertRun): * database/process-jobs.js: Add a call to populate-from-report.js. * public/api/report.php: Added. Adds a new job named "report" to be processed by populate-from-report.js. * public/include/db.php: Support parameterized query. * public/include/json-header.php: Always include 'status' in the response so that builder submitting a test result could confirm that the submission indeed succeeded. 2012-12-18 Ryosuke Niwa Rename get(Id)OrCreate*(Id) to ensure*Id as suggested by Ricky on one of his code reviews. * database/aggregate.js: * database/database-common.js: (selectColumnCreatingRowIfNeeded): (ensureRepositoryId): (ensureConfigurationIdFromList): * database/perf-webkit-migrator.js: (.migrateStat.): (.migrateStat): (getOrCreateBuildId): 2012-12-17 Ryosuke Niwa Extract commonly-used functions from aggregate.js and perf-webkit-migrator.js. Reviewed by Ricky Mondello. As a preparation to add report.js that processes a JSON file submitted by bots, extract various functions and classes from aggregate.js and perf-webkit-migrator.js to be shared. * database/aggregate.js: Extracted TaskQueue and SerializedTaskQueue into utility.js. (main): (processBuild): (saveAggregatedResults): * database/database-common.js: (getIdOrCreatePlatform): Extracted from webkit-perf-migrator.js. (getIdOrCreateRepository): Ditto. (getConfigurationsForPlatformAndMetrics): Renamed from fetchConfigurations. Extracted from aggregator.js. (getIdFromListOrInsertConfiguration): Renamed from getOrInsertConfiguration. Extracted from aggregator.js. * database/perf-webkit-migrator.js: * database/utility.js: Added. (TaskQueue): Extracted from aggregator.js. Fixed a bug that prevented tasks added after start() is called from being executed. (TaskQueue.startTasksInQueue): Execute remaining tasks without serializing them. If the queue is empty, call the callback passed into start(). (TaskQueue.taskCallback): The function each task calls back. Decrement the counter and call statTasksInQueue. (TaskQueue.addTask): (TaskQueue.start): (SerializedTaskQueue): Unlike TaskQueue, this class executes each task sequentially. (SerializedTaskQueue.executeNextTask): (SerializedTaskQueue.addTask): (SerializedTaskQueue.start): 2012-12-18 Ryosuke Niwa Revert erroneously committed changes. * database/config.json: 2012-12-18 Ryosuke Niwa aggregator.js should be able to accept multiple metric ids and a single build id. Reviewed by Ricky Mondello. Make aggregator.js accept multiple ids and generate results for single build when bots are reporting new results. * database/aggregate.js: (parseArgv): Added. Returns an object containing the parsed representation of argv, which currently contains metricIDs and buildIds. (main): Use parseArgv and processConfigurations (processPlatform): Use build ids passed in or obtain all builds for the given platform. (processPlatform.processConfigurations): Extracted. 2012-12-17 Ryosuke Niwa Add an administrative page for builders. Reviewed by Ricky Mondello. We need an administrative page to add and edit builder information. Also renamed "slaves" to "builders" in order to reduce the amount of technical jargon we use. * database/init-database.sql: Renamed slaves table to builders. Drop slave_os and slave_spec since we don't have plans to use those columns in near future. Also make builder_name unique as required by the rest of the app. * public/admin/builders.php: Added. * public/api/runs.php: Updated per the table rename. * public/include/admin-header.php: Added a link to builders.php. 2012-12-14 Ryosuke Niwa Build fixes for r46982. * database/aggregate.js: (fetchConfigurations): Bind i so that it's not always metricIds.length. (fetchBuildsForPlatform): Return run_build as build_id since that's what caller expects. (processBuild): Don't print "." until we've committed transactions. It's misleading. 2012-12-13 Ryosuke Niwa Unreviewed. Move some php files to public/include as suggested by Mark on a code review. * public/admin/aggregators.php: * public/admin/footer.php: Removed. * public/admin/header.php: Removed. * public/admin/index.php: * public/admin/jobs.php: * public/admin/tests.php: * public/api/json-header.php: Removed. * public/api/runs.php: * public/db.php: Removed. * public/include: Added. * public/include/admin-footer.php: Copied from public/admin/footer.php. * public/include/admin-header.php: Copied from public/admin/header.php. * public/include/db.php: Copied from public/db.php. * public/include/json-header.php: Copied from public/api/json-header.php. 2012-12-13 Ryosuke Niwa SafariPerfMonitor: implement naive value aggregation mechanism Reviewed by Ricky Mondello. Added the initial implementation of value aggregation. Also added abilities to configure the dashboard page in tests.php. * database/aggregate.js: Added. (TaskQueue): Added. Execute all tasks at once and waits for those tasks to complete. (TaskQueue.addTask): (TaskQueue.start): (SerializedTaskQueue): Added. Execute tasks sequentially after one another until all of them are completed. (SerializedTaskQueue.addTask): (SerializedTaskQueue.start): (main): (processPlatform): (fetchConfigurations): (fetchBuildsForPlatform): (processBuild): (testsWithDifferentIterationCounts): (aggregateIterationsForMetric): Retrieve run_iterations and aggregate results in memory. (saveAggregatedResults): Insert into test_runs and test_config in transactions. (getOrInsertConfiguration): (fetchAggregators): * database/database-common.js: (fetchTable): Log an error as an error. (getOrCreateId): Extracted from perf-webkit-migrator. (statistics): Added. * database/perf-webkit-migrator.js: (migrateTestConfig): Converted units to respective metric names. Also removed the code to add jobs to update runs JSON since runs JSONs are generated on demand now. (migrateStat): (getOrCreatePlatformId): (getOrCreateTestId): (getOrCreateConfigurationId): (getOrCreateRevisionId): (getOrCreateRepositoryId): (getOrCreateBuildId): * database/process-jobs.js: (processJob): Handle 'aggregate' type. 2012-12-11 Ryosuke Niwa Fix the dashboard after adding test_metrics. Reviewed by Ricky Mondello. Rename test to metrics in various functions and sort tests on the charts page. Also representing whether a test appears or not by setting a flag on dashboard was bogus because test objects are shared by multiple platforms. Instead, store dashboard platform list as intended by the manifest JSON. * public/index.html: (PerfTestRuns): Renamed test to metric. (fetchTest): Ditto. (showCharts): Ditto; also sort metrics' full names before adding them to the select element. (fullName): Moved so that it appears above where it's called. * public/js/helper-classes.js: 2012-12-10 Ryosuke Niwa Update tests.php to reflect recent changes in the database schema. Reviewed by Conrad Shultz. Made the following changes to tests.php: 1. Disallow adding metrics to tests without subtests. 2. Made dashboard configurable by adding checkboxes for each platform on each metric. 3. Linkified tests with subtests instead of showing all them at once. * public/admin/admin.css: (.action-field, .notice): (label): * public/admin/header.php: Specify paths by absolute paths so that tests.php can use PATH_INFO. (execute_query_and_expect_one_row_to_be_affected): Return a boolean. Used in tests.php while adding test_metrics. (add_job): Extracted. * public/admin/tests.php: See above. (array_item_set_default): Added. (array_item_or_default): Renamed from get_value_with_default. (compute_full_name): Extracted. (sort_tests): Ditto. (map_metrics_to_tests): Ditto. 2012-12-06 Ryosuke Niwa SafariPerfMonitor: Linkify test names Reviewed by Simon Fraser. Linkify the headers using metric.test.url when it's provided. * public/index.html: 2012-12-03 Ryosuke Niwa Use parameterized pg_query_params in query_and_fetch_all Reviewed by Conrad Shultz. Address a review comment by Mark by using pg_query_params instead of pg_query in query_and_fetch_all. * public/api/runs.php: * public/db.php: (ctype_alnum_underscore): Added. 2012-12-04 Ryosuke Niwa Update the migration tool to support test_metrics. Reviewed by Mark Rowe. Updated the migration tool from webkit-perf.appspot.com to support test_metrics. Also import run_iteration rows as runs JSON files now include individual values. * database/database-common.js: (addJob): Extracted. * database/perf-webkit-migrator.js: (migrateTestConfig): Interchange the order in which we fetch runs and add configurations so that we can pass in the metric name and unit to getOrCreateConfigurationId. (getOrCreateConfigurationId): Updated to add both test configuration and test metric. (ensureCheckout): 2012-12-03 Ryosuke Niwa Build fix. Suppress "Undefined index" warning. * public/admin/tests.php: 2012-12-03 Ryosuke Niwa Fix a commit error in r46756. api/ should obviously be added under public/ * api: Removed. * api/json-header.php: Removed. * api/runs.php: Removed. * public/api: Copied from api. 2012-12-03 Ryosuke Niwa SafariPerfMonitor: Linkify revisions and revisions range Reviewed by Mark Rowe. Linkify revisions in TestBuild.label. Pass in manifest.repositories to TestBuild's constructor since it needs to know "url" and "blameUrl". Also tweaked the appearance of graphs on charts page to better align graphs when unit names are long. * public/index.html: * public/js/helper-classes.js: (TestBuild): (TestBuild.revision): Renamed from webkitRevision. Now returns an arbitrary revision number. (TestBuild.label): Add labels for all revisions. (TestBuild): (.ensureContainer): 2012-12-03 Ryosuke Niwa Make the generation of "runs" JSON dynamic and support test_metrics. Reviewed by Mark Rowe. It turned out that we can fetch all runs for a given configuration in roughly 100-200ms. Since there could be hundreds, if not thousands, of tests for each configuration and users aren't necessarily interested in looking at all test results, it's much more efficient to generate runs JSON dynamically (i.e. polling) upon a request instead of generating all of them when bots report new results (i.e. pushing). Rewrote the script to generate runs JSON in php and also supported test_metrics table. * api: Added. * api/json-header.php: Added. Sets Content-Type and cache policies (10 minutes by default). (exit_with_error): Added. (successful_exit): Added. * api/runs.php: Added. Ported database/database-common.js. It's much shorter in php! * database/generate-runs.js: Removed. * database/process-jobs.js: No longer supports "runs". * public/.htaccess: Added. Always add MultiView so that api/runs can receive a path info. * public/db.php: Print "Nothing to see here." when it's accessed directly. (ends_with): Added. * public/index.html: Fetch runs JSONs from /api/runs/ instead of data/. 2012-12-03 Ryosuke Niwa Update tests.php and sample-data.sql per addition of test_metrics. Rubber-stamped by Timothy Hatcher. Remove a useless code from tests.php that used to update the unit and the url of a test since it's no longer used, and add the UI and the ability to add a new aggregator to a test. Also update the sample data to reflect the addition of test_metrics. * database/sample-data.sql: * public/admin/tests.php: 2012-11-30 Ryosuke Niwa Share more code between admin pages. Reviewed by Timothy Hatcher. Added notice and execute_query_and_expect_one_row_to_be_affected helper functions to share more code between admin pages. Also moved the code to connect to the database into header.php to be shared. Admin pages just need to check the nullity of global $db now. * public/admin/aggregators.php: * public/admin/header.php: (notice): Added (execute_query_and_expect_one_row_to_be_affected): Added. * public/admin/index.php: * public/admin/jobs.php: * public/admin/tests.php: 2012-11-29 Ryosuke Niwa SafariPerfMonitor: Add admin page to edit aggregators Reviewed by Mark Rowe. Add aggregators.php. It's very simple. We should probably share more code between various admin pages. * public/admin/aggregators.php: Added. * public/admin/header.php: * public/admin/jobs.php: Removed an erroneous hidden input element. 2012-11-28 Ryosuke Niwa Fix a syntax error in init-database.sql and add the missing drop table at the beginning. * database/init-database.sql: 2012-11-28 Ryosuke Niwa SafariPerfMonitor: Allow multiple metrics per test Rubber-stamped by Mark Rowe. Introduce a new table test_metrics. This table represents metrics each test can have such as time, memory allocation, frame rate as well as aggregation such as arithmetic mean and geometric mean. Updated admin/tests.php and index.html accordingly. Also create few indexes based on postgres' "explain analysis" as suggested by Mark. * database/generate-manifest.js: (buildPlatformMapIfPossible): * database/generate-runs.js: (fetchRuns): * database/init-database.sql: * database/schema.graffle: * public/admin/admin.css: (table): (tbody.odd): * public/admin/tests.php: * public/index.html: 2012-11-27 Ryosuke Niwa SafariPerfMonitor: Improve the webkit-perf migration tool Reviewed by Mark Rowe. Make the migrator tool skip runs when fetching runs failed since webkit-perf.appspot.com is unreliable and we don't want to pause the whole importation process until the user comes back to decide whether to retry or not. Also place form controls next to each test in tests.php so that users don't have to scroll all the way down to make modifications. Finally, add unique constraint to (run_config, run_build) in test_runs table in order to optimize a query of the form: "SELECT run_id FROM test_runs WHERE run_config = $1 AND run_build = $2", * database/init-database.sql: * database/perf-webkit-migrator.js: (migrateTestConfig): * database/schema.graffle: * public/admin/admin.css: (table): * public/admin/tests.php: 2012-11-16 Ryosuke Niwa Create a new performance dashboard Rubber-stamped by Mark Rowe. Add the initial implementation of the perf dashboard. * database: Added. * database/config.json: Added. * database/database-common.js: Added. (connect): (fetchTable): (manifestPath): (pathToRunsJSON): (pathToLocalScript): (config): * database/generate-manifest.js: Added. (ensureProperty): (buildTestMap): (buildPlatformMapIfPossible): (generateFileIfPossible): * database/perf-webkit-migrator.js: Added. * database/process-jobs.js: Added. * database/sample-data.sql: Added. * database/schema.graffle: Added. * public: Added. * public/admin: Added. * public/admin/README: Added. * public/admin/admin.css: Added. * public/admin/footer.php: Added. * public/admin/header.php: Added. * public/admin/index.php: Added. * public/admin/jobs.php: Added. * public/admin/tests.php: Added. * public/common.css: Added. * public/data: Added. * public/db.php: Added. * public/index.html: Added. * public/js: Added. * public/js/helper-classes.js: Added. * public/js/jquery-1.8.2.min.js: Added. * public/js/jquery.flot.min.js: Added. * public/js/jquery.flot.plugins.js: Added. * public/js/shared.js: Added. (fileNameFromPlatformAndTest): * public/js/statistics.js: Added.