debian-mirror-gitlab/app/controllers/admin/cohorts_controller.rb

29 lines
592 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2020-11-24 15:15:51 +05:30
class Admin::CohortsController < Admin::ApplicationController
2021-09-04 01:27:46 +05:30
include Analytics::UniqueVisitsHelper
2021-02-22 17:27:13 +05:30
feature_category :devops_reports
2021-01-03 14:25:43 +05:30
2017-08-17 22:00:37 +05:30
def index
2021-09-04 01:27:46 +05:30
@cohorts = load_cohorts
track_cohorts_visit
end
private
def load_cohorts
cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do
CohortsService.new.execute
end
CohortsSerializer.new.represent(cohorts_results)
end
def track_cohorts_visit
if request.format.html? && request.headers['DNT'] != '1'
track_visit('i_analytics_cohorts')
end
2017-08-17 22:00:37 +05:30
end
end