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
|
2022-09-08 18:10:47 +00:00
|
|
|
include ProductAnalyticsTracking
|
2021-06-16 15:10:08 +00:00
|
|
|
|
2020-11-19 15:09:13 +00:00
|
|
|
feature_category :devops_reports
|
2020-10-05 21:08:47 +00:00
|
|
|
|
2022-03-04 18:20:01 +00:00
|
|
|
urgency :low
|
|
|
|
|
2022-09-08 18:10:47 +00:00
|
|
|
track_custom_event :index,
|
|
|
|
name: 'i_analytics_cohorts',
|
|
|
|
action: 'perform_analytics_usage_action',
|
|
|
|
label: 'redis_hll_counters.analytics.analytics_total_unique_counts_monthly',
|
|
|
|
destinations: %i[redis_hll snowplow]
|
|
|
|
|
2017-04-05 10:24:15 +00:00
|
|
|
def index
|
2021-06-16 15:10:08 +00:00
|
|
|
@cohorts = load_cohorts
|
|
|
|
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
|
|
|
|
|
2022-09-08 18:10:47 +00:00
|
|
|
def tracking_namespace_source
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
def tracking_project_source
|
|
|
|
nil
|
2017-04-05 10:24:15 +00:00
|
|
|
end
|
|
|
|
end
|