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

cohorts_controller.rb « admin « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 468a1077694eff6758e28c6fb6abf2c2c1497c97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true

class Admin::CohortsController < Admin::ApplicationController
  include RedisTracking

  feature_category :devops_reports

  urgency :low

  def index
    @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
    track_unique_redis_hll_event('i_analytics_cohorts') if trackable_html_request?
  end
end