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

20 lines
501 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
2020-07-28 23:09:34 +05:30
include Analytics::UniqueVisitsHelper
track_unique_visits :index, target_id: 'i_analytics_cohorts'
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
2018-03-17 18:26:18 +05:30
if Gitlab::CurrentSettings.usage_ping_enabled
2017-08-17 22:00:37 +05:30
cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do
CohortsService.new.execute
end
@cohorts = CohortsSerializer.new.represent(cohorts_results)
end
end
end