Skip to content

Extend redis hll metrics for github import

What does this MR do and why?

This is the second part of the implementation of Instrument all the end states of imports with G... (#381500)

We still keep existing Redis HLL Metrics to track import statuses, but additionally adding for cancel and partially completed. Also the existing redis_hll_counters.importer.github_import_project_success_monthly/weekly will count the only fully completed imports

Newly added metrics:

  • 'redis_hll_counters.importer.github_import_project_partially_completed_monthly',
  • 'redis_hll_counters.importer.github_import_project_cancelled_monthly',
  • 'redis_hll_counters.importer.github_import_project_partially_completed_weekly',
  • 'redis_hll_counters.importer.github_import_project_cancelled_weekly'

Screenshots or screen recordings

When the project import was canceled:

Screen_Recording_2023-03-07_at_11.54.12

When the project import was partially completed:

Screen_Recording_2023-03-07_at_12.20.11-1

How to set up and validate locally

  1. Initiate GitHub import from UI or using API.
  2. Cancel running import from UI or using API.
  3. In the rails console check if counter was changed for the particular event github_import_project_cancelled
     Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: 'github_import_project_cancelled', start_date: Date.current.beginning_of_week, end_date: Date.current.next_week)

MR acceptance checklist

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

Edited by Kristina Doskich

Merge request reports