Add median line to cycle analytics duration chart
Description
Add median line to cycle analytics duration chart
This is a follow up issue from !14996 (merged)
In order to calculate a rolling median, we need to fetch a dataset which is offset by the number of days which we will be displaying i.e. if we are showing 30 days worth of data on the chart, we'll need to fetch 60 days worth of data. The first 30 days worth of data will be used for computing the rolling median and the second 30 days worth of data will need to be used to compute the plottable points on the duration chart.
The median line data needs to be fetched in a separate series of API requests in order to avoid slowing down displaying the duration chart.
All logic and API requests for the median line will be placed behind a feature flag cycle_analytics_scatterplot_median_enabled
Adding a limit to the date range which is selectable will be handled in a separate issue #119111 (closed)
From original issue
https://gitlab.com/gitlab-org/gitlab/issues/12183
Let's have a scatterplot with the specific day of completion on the x-axis and number of days it took from
X
toY
as our first attempt to answer the question as to whether people are getting better with time. The chart should contain a trend line (rolling median - 30 days?)+ 25-75% quantile bands. We should have a dropdown where a user can select which stage they want to look at and they should be able to select more than one, so that the trend line will be the sum of days for those stages selected. We can have different color dots representing the different stages. If this looks too messy, we can combine the stages in 1 dot.
Based on the above extract, we agreed on a single plottable point per stage and only a rolling median line.