Add the possibility to chart "time to merge" for MRs

Ideally, we should be able to show multiple percentile on the same charts, e.g.

Screen_Shot_2019-04-29_at_11.04.46

    - title: Cycle time of merge requests
      type: line
      query:
        issuable_type: merge_request
        issuable_state: merged
        metric: time_to_merge # currently defaults to "self"
        calculation: percentile # currently defaults to "count"
        collection_percentiles:
          - p50
          - p95
        group_by: week
        period_limit: 104

Notes:

  1. Introduced query.metric which currently defaults to self which means that we count the matching records, but would be set to time_to_merge in this case, meaning that we would use mr.time_to_merge to perform a calculation.
  2. Introduced query.calculation which currently default to count, but would be set to percentile in this case.
  3. Reused the collection_labels concept and changed to collection_percentiles to keep changes minimal.
Assignee Loading
Time tracking Loading