Add fixtures for code suggestion usage
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
- 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)
- Run the seed script
FILTER=ai_usage_stats bundle exec rake db:seed_fu
- 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