summaryrefslogtreecommitdiff
path: root/lib/gitlab/usage_data.rb
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-01-30 11:28:15 +0000
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-02-28 10:46:19 +0000
commita7b3f11edd626b7ba2fe4101951d2c9fe884b04a (patch)
treed3f63140f355976608830af8ea9c2b4f16ba1330 /lib/gitlab/usage_data.rb
parent4371f845649deaf6bf31f0a675b33f1d58f64de4 (diff)
downloadgitlab-ce-a7b3f11edd626b7ba2fe4101951d2c9fe884b04a.tar.gz
Adds get all medians to Cycle Analytics model
Diffstat (limited to 'lib/gitlab/usage_data.rb')
-rw-r--r--lib/gitlab/usage_data.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb
index 9d13d1d781f..1fa000e933c 100644
--- a/lib/gitlab/usage_data.rb
+++ b/lib/gitlab/usage_data.rb
@@ -9,6 +9,7 @@ module Gitlab
license_usage_data.merge(system_usage_data)
.merge(features_usage_data)
.merge(components_usage_data)
+ .merge(cycle_analytics_usage_data)
end
def to_json(force_refresh: false)
@@ -71,6 +72,12 @@ module Gitlab
}
end
+ def cycle_analytics_usage_data
+ projects = Project.sorted_by_activity.limit(Gitlab::CycleAnalytics::UsageData::PROJECTS_LIMIT)
+
+ Gitlab::CycleAnalytics::UsageData.new(projects, { from: 7.days.ago }).to_json
+ end
+
def features_usage_data
features_usage_data_ce
end