Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-19 04:45:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-19 04:45:44 +0300
commit85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch)
tree9160f299afd8c80c038f08e1545be119f5e3f1e1 /app/services/product_analytics
parent15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff)
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'app/services/product_analytics')
-rw-r--r--app/services/product_analytics/build_activity_graph_service.rb13
-rw-r--r--app/services/product_analytics/build_graph_service.rb10
2 files changed, 20 insertions, 3 deletions
diff --git a/app/services/product_analytics/build_activity_graph_service.rb b/app/services/product_analytics/build_activity_graph_service.rb
new file mode 100644
index 00000000000..63108d76afd
--- /dev/null
+++ b/app/services/product_analytics/build_activity_graph_service.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module ProductAnalytics
+ class BuildActivityGraphService < BuildGraphService
+ def execute
+ timerange = @params[:timerange].days
+
+ results = product_analytics_events.count_collector_tstamp_by_day(timerange)
+
+ format_results('collector_tstamp', results.transform_keys(&:to_date))
+ end
+ end
+end
diff --git a/app/services/product_analytics/build_graph_service.rb b/app/services/product_analytics/build_graph_service.rb
index 31f9f093bb9..da54ad4de0e 100644
--- a/app/services/product_analytics/build_graph_service.rb
+++ b/app/services/product_analytics/build_graph_service.rb
@@ -13,15 +13,19 @@ module ProductAnalytics
results = product_analytics_events.count_by_graph(graph, timerange)
+ format_results(graph, results)
+ end
+
+ private
+
+ def format_results(name, results)
{
- id: graph,
+ id: name,
keys: results.keys,
values: results.values
}
end
- private
-
def product_analytics_events
@project.product_analytics_events
end