Commit 7e03aa0e authored by Adam Hegyi's avatar Adam Hegyi

Fix usage trends fixtures

This change prevents generating dummy data for the billable_users
metric in Usage Trends. Generating random values can cause problems when
adding a license in GDK.

Additional change: remove EXPERIMENTAL_IDENTIFIERS unused constant
parent 615be423
...@@ -5,8 +5,6 @@ module Analytics ...@@ -5,8 +5,6 @@ module Analytics
class Measurement < ApplicationRecord class Measurement < ApplicationRecord
self.table_name = 'analytics_instance_statistics_measurements' self.table_name = 'analytics_instance_statistics_measurements'
EXPERIMENTAL_IDENTIFIERS = %i[pipelines_succeeded pipelines_failed pipelines_canceled pipelines_skipped].freeze
enum identifier: { enum identifier: {
projects: 1, projects: 1,
users: 2, users: 2,
......
...@@ -9,7 +9,8 @@ Gitlab::Seeder.quiet do ...@@ -9,7 +9,8 @@ Gitlab::Seeder.quiet do
model_class = Analytics::UsageTrends::Measurement model_class = Analytics::UsageTrends::Measurement
measurements = model_class.identifiers.flat_map do |_, id| # Skip generating data for billable_users, to avoid license check problems
measurements = model_class.identifiers.except(:billable_users).each_value.flat_map do |id|
recorded_at = 60.days.ago recorded_at = 60.days.ago
current_count = rand(1_000_000) current_count = rand(1_000_000)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment