Commit graph

8 commits

Author SHA1 Message Date
Timothy Andrew
331080bca6 Fetch cycle analytics data for a specific date range.
1. Supported date ranges are 30 / 90 days ago. The default is 90 days
   ago.

2. All issues created before "x days ago" are filtered out, even if they
   have other related data (test runs, merge requests) within the filter
   range.
2016-08-26 16:28:20 +05:30
Timothy Andrew
df6c9c33b6 Scope Cycle Analytics queries to a project 2016-08-26 16:28:20 +05:30
Timothy Andrew
ebc03833f2 Allow multiple queries for each cycle analytics section.
1. Pass in an array of queries - the first to return a value will be
   used. This makes it easier to add more heuristics later.

2. Convert all queries with 'or' in the title to two separate queries.

3. Rename all `mr_` methods to `merge_request_`
2016-08-26 16:28:20 +05:30
Timothy Andrew
fc92d06635 Add the "Test" cycle analytics section. 2016-08-26 16:28:20 +05:30
Timothy Andrew
3d5729a700 Add the "Production" cycle analytics section.
1. Rewrite the `Queries` module to work off a `data_point` hash, with
   `issue` and `merge_request` as keys. The "production" query needs
   both an issue and a merge request to make it's calculation, so it
   makes sense to keep things consistent and provide the same
   data (issue + merge request) for all queries.
2016-08-26 16:28:20 +05:30
Timothy Andrew
d3fef0fb18 Add the "Staging" cycle analytics section. 2016-08-26 16:28:20 +05:30
Timothy Andrew
14d6317ebc Add the "Review" cycle analytics section. 2016-08-26 16:28:20 +05:30
Timothy Andrew
487906b386 Add the "Code" Cycle Analytics section.
1. Record the `wip_flag_first_removed_at` and
   `first_assigned_to_user_other_than_author` metrics for a merge
   request. Use a `merge_request_metrics` table, similar to the one for
   `issues`. Metrics are recorded `after_save`.

2. Move larger queries to a `CycleAnalytics::Queries` module.
2016-08-26 16:28:20 +05:30