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: d5cd9c554228df29f57f30cf187774a9c1feeb39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class Admin::CohortsController < Admin::ApplicationController
  include Analytics::UniqueVisitsHelper

  track_unique_visits :index, target_id: 'i_analytics_cohorts'

  feature_category :instance_statistics

  def index
    if Gitlab::CurrentSettings.usage_ping_enabled
      cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do
        CohortsService.new.execute
      end

      @cohorts = CohortsSerializer.new.represent(cohorts_results)
    end
  end
end