Skip to content

Draft: PoC: Implement tracking of govern-related page visits

Martin Čavoj requested to merge 415677-poc-for-govern-smau-metric into master

What does this MR do and why?

This MR is a PoC for a spike, where we investigated how to implement aggregated tracking of page visits for govern-related pages. See also #414757 (comment 1445737289) for more context.

How to set up and validate locally

  1. Visit one of the pages or perform any of the actions described in Govern SMAU Metric (#414757 - closed)
  2. In the rails console, check for a non-zero counter value for the aggregated metric:
    Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: 'users_visiting_govern_pages', start_date: Date.current.beginning_of_week, end_date: Date.current.next_week)
  3. You run the service ping worker with GitlabServicePingWorker.new.perform('triggered_from_cron' => false)
  4. Check for the weekly and monthly aggregated metric:
    [5] pry(main)> RawUsageData.last.payload['redis_hll_counters']['govern']
    => {"users_visiting_govern_pages_weekly"=>5, "users_visiting_govern_pages_monthly"=>5}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #415677 (closed)

Edited by Martin Čavoj

Merge request reports