diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-09-08 15:03:38 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-09-08 15:03:38 +0530 |
commit | 9901c3df41d37e5d5650e28a5287a8ddf0aa754e (patch) | |
tree | 0f10ce6cfa414a45aeb3d260eb4f70b44cbe2774 /app/models/cycle_analytics.rb | |
parent | f5b9837c19f48255237eca1e618fc632a45b58b5 (diff) | |
download | gitlab-ce-9901c3df41d37e5d5650e28a5287a8ddf0aa754e.tar.gz |
Add a JSON version of the `CycleAnalytics` page.
Diffstat (limited to 'app/models/cycle_analytics.rb')
-rw-r--r-- | app/models/cycle_analytics.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/cycle_analytics.rb b/app/models/cycle_analytics.rb index a52b5aff559..9444f1f31a8 100644 --- a/app/models/cycle_analytics.rb +++ b/app/models/cycle_analytics.rb @@ -6,6 +6,13 @@ class CycleAnalytics @from = from end + def as_json(options = {}) + { + issue: issue, plan: plan, code: code, test: test, + review: review, staging: staging, production: production + } + end + def issue calculate_metric(Queries::issues(@project, created_after: @from), -> (data_point) { data_point[:issue].created_at }, |