Skip to content

Add fixtures for code suggestion usage

Adam Hegyi requested to merge ag-add-cs-usage-fixtures into master

What does this MR do and why?

This MR adds development fixtures for the AI usage service metrics.

How to set up and validate locally

  1. Make sure ClickHouse is configured (https://docs.gitlab.com/ee/development/database/clickhouse/clickhouse_within_gitlab.html#configure-your-rails-application) and FFs are enabled:
    Feature.enable(:clickhouse_data_collection)
    Feature.enable(:event_sync_worker_for_click_house)
    Feature.enable(:code_suggestion_events_in_click_house)
  2. Run the seed script
    FILTER=ai_usage_stats bundle exec rake db:seed_fu
  3. Try loading some stats from rails console (payload should return a number):
    Analytics::AiAnalytics::CodeSuggestionUsageRateService.new(User.all.sample, namespace: Group.all.sample, from: 2.months.ago, to: Date.today).execute
Edited by Ezekiel Kigbo

Merge request reports