summaryrefslogtreecommitdiff
path: root/app/controllers/instance_statistics/cohorts_controller.rb
blob: 77d09c198c8eba26a638727d4cfb014ee62184c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
class InstanceStatistics::CohortsController < InstanceStatistics::ApplicationController
  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