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

27 lines
549 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-30 23:02:18 +05:30
include RedisTracking
2021-09-04 01:27:46 +05:30
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
2021-09-30 23:02:18 +05:30
track_unique_redis_hll_event('i_analytics_cohorts') if trackable_html_request?
2017-08-17 22:00:37 +05:30
end
end