summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorAdam Hegyi <ahegyi@gitlab.com>2019-08-14 16:12:12 +0000
committerBob Van Landuyt <bob@gitlab.com>2019-08-14 16:12:12 +0000
commitc5cb5da4ac4b414fb0d46412f80a686130a69e19 (patch)
treee8ab44f4cb0e0e265f756f93e267ce12041b8e8d /app/controllers
parent25f8e99a21ae1357403d1c2b96037b3cc80f254a (diff)
downloadgitlab-ce-c5cb5da4ac4b414fb0d46412f80a686130a69e19.tar.gz
Track page views for cycle analytics show page
This change adds a new counter 'cycle_analytics_views' to the usage data metrics to count the page views for cycle analytics show page.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/cycle_analytics_controller.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/projects/cycle_analytics_controller.rb b/app/controllers/projects/cycle_analytics_controller.rb
index 2d46a71bf99..3b0abecf2c9 100644
--- a/app/controllers/projects/cycle_analytics_controller.rb
+++ b/app/controllers/projects/cycle_analytics_controller.rb
@@ -14,8 +14,14 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController
@cycle_analytics_no_data = @cycle_analytics.no_stats?
respond_to do |format|
- format.html
- format.json { render json: cycle_analytics_json }
+ format.html do
+ Gitlab::UsageDataCounters::CycleAnalyticsCounter.count(:views)
+
+ render :show
+ end
+ format.json do
+ render json: cycle_analytics_json
+ end
end
end