2018-07-25 15:36:08 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-08-21 18:10:24 +00:00
|
|
|
class Admin::CohortsController < Admin::ApplicationController
|
2020-06-22 15:09:27 +00:00
|
|
|
include Analytics::UniqueVisitsHelper
|
|
|
|
|
|
|
|
track_unique_visits :index, target_id: 'i_analytics_cohorts'
|
|
|
|
|
2017-04-05 10:24:15 +00:00
|
|
|
def index
|
2018-02-02 18:39:55 +00:00
|
|
|
if Gitlab::CurrentSettings.usage_ping_enabled
|
2017-04-06 12:12:12 +00:00
|
|
|
cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do
|
2017-04-05 10:24:15 +00:00
|
|
|
CohortsService.new.execute
|
|
|
|
end
|
2017-04-06 12:12:12 +00:00
|
|
|
|
|
|
|
@cohorts = CohortsSerializer.new.represent(cohorts_results)
|
2017-04-05 10:24:15 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|