diff options
Diffstat (limited to 'spec/migrations/20230302811133_re_migrate_redis_slot_keys_spec.rb')
-rw-r--r-- | spec/migrations/20230302811133_re_migrate_redis_slot_keys_spec.rb | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/spec/migrations/20230302811133_re_migrate_redis_slot_keys_spec.rb b/spec/migrations/20230302811133_re_migrate_redis_slot_keys_spec.rb index 4c6d4907c29..b4146761aa2 100644 --- a/spec/migrations/20230302811133_re_migrate_redis_slot_keys_spec.rb +++ b/spec/migrations/20230302811133_re_migrate_redis_slot_keys_spec.rb @@ -9,17 +9,14 @@ RSpec.describe ReMigrateRedisSlotKeys, :migration, feature_category: :service_pi let(:known_events) do [ { - redis_slot: 'analytics', - aggregation: 'daily', - name: 'users_viewing_analytics_group_devops_adoption' + redis_slot: 'management', + name: 'g_project_management_epic_closed' }, { - aggregation: 'weekly', - name: 'wiki_action' - }, { - aggregation: 'weekly', + name: 'incident_management_incident_assigned' # weekly event + }, + { name: 'non_existing_event' }, { - aggregation: 'weekly', name: 'event_without_expiry' } ] @@ -30,17 +27,17 @@ RSpec.describe ReMigrateRedisSlotKeys, :migration, feature_category: :service_pi allow(Gitlab::UsageDataCounters::HLLRedisCounter).to receive(:known_events) .and_return(known_events) - expiry_daily = Gitlab::UsageDataCounters::HLLRedisCounter::DEFAULT_DAILY_KEY_EXPIRY_LENGTH - expiry_weekly = Gitlab::UsageDataCounters::HLLRedisCounter::DEFAULT_WEEKLY_KEY_EXPIRY_LENGTH + expiry_daily = 29.days + expiry_weekly = described_class::KEY_EXPIRY_LENGTH default_slot = Gitlab::UsageDataCounters::HLLRedisCounter::REDIS_SLOT - old_slot_a = "#{date}-users_viewing_{analytics}_group_devops_adoption" - old_slot_b = "{wiki_action}-#{week}" + old_slot_a = "#{date}-g_project_{management}_epic_closed" + old_slot_b = "{incident_management_incident_assigned}-#{week}" old_slot_without_expiry = "{event_without_expiry}-#{week}" - new_slot_a = "#{date}-{#{default_slot}}_users_viewing_analytics_group_devops_adoption" - new_slot_b = "{#{default_slot}}_wiki_action-#{week}" + new_slot_a = "#{date}-{#{default_slot}}_g_project_management_epic_closed" + new_slot_b = "{#{default_slot}}_incident_management_incident_assigned-#{week}" new_slot_without_expiry = "{#{default_slot}}_event_without_expiry-#{week}" Gitlab::Redis::HLL.add(key: old_slot_a, value: 1, expiry: expiry_daily) |