2018-07-25 11:36:08 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-08-21 14:10:24 -04:00
|
|
|
class Admin::CohortsController < Admin::ApplicationController
|
2021-07-19 23:08:21 -04:00
|
|
|
include RedisTracking
|
2021-06-16 11:10:08 -04:00
|
|
|
|
2020-11-19 10:09:13 -05:00
|
|
|
feature_category :devops_reports
|
2020-10-05 17:08:47 -04:00
|
|
|
|
2017-04-05 06:24:15 -04:00
|
|
|
def index
|
2021-06-16 11:10:08 -04:00
|
|
|
@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
|
2021-07-19 23:08:21 -04:00
|
|
|
track_unique_redis_hll_event('i_analytics_cohorts') if trackable_html_request?
|
2017-04-05 06:24:15 -04:00
|
|
|
end
|
|
|
|
end
|