diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-04 03:08:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-04 03:08:19 +0300 |
commit | da37005e4575681fbdecaed11cf9528b2673b6ea (patch) | |
tree | edd418d904576a1caf28ba7cf0aff3f4c6f0466f /spec/lib/gitlab/usage_data_spec.rb | |
parent | 71c3596b1dfda5dca5d25357fe92f442647a8f5b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/usage_data_spec.rb')
-rw-r--r-- | spec/lib/gitlab/usage_data_spec.rb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb index a2461545a56..53d7e3c1eac 100644 --- a/spec/lib/gitlab/usage_data_spec.rb +++ b/spec/lib/gitlab/usage_data_spec.rb @@ -1044,16 +1044,12 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures, feature_category: :servic let(:time) { Time.current } before do - counter = Gitlab::UsageDataCounters::TrackUniqueEvents - merge_request = Event::TARGET_TYPES[:merge_request] - design = Event::TARGET_TYPES[:design] - - counter.track_event(event_action: :commented, event_target: merge_request, author_id: 1, time: time) - counter.track_event(event_action: :opened, event_target: merge_request, author_id: 1, time: time) - counter.track_event(event_action: :merged, event_target: merge_request, author_id: 2, time: time) - counter.track_event(event_action: :closed, event_target: merge_request, author_id: 3, time: time) - counter.track_event(event_action: :opened, event_target: merge_request, author_id: 4, time: time - 3.days) - counter.track_event(event_action: :created, event_target: design, author_id: 5, time: time) + Gitlab::UsageDataCounters::HLLRedisCounter.track_event(:merge_request_action, values: 1, time: time) + Gitlab::UsageDataCounters::HLLRedisCounter.track_event(:merge_request_action, values: 1, time: time) + Gitlab::UsageDataCounters::HLLRedisCounter.track_event(:merge_request_action, values: 2, time: time) + Gitlab::UsageDataCounters::HLLRedisCounter.track_event(:merge_request_action, values: 3, time: time) + Gitlab::UsageDataCounters::HLLRedisCounter.track_event(:merge_request_action, values: 4, time: time - 3.days) + Gitlab::UsageDataCounters::HLLRedisCounter.track_event(:design_action, values: 5, time: time) end it 'returns the distinct count of users using merge requests (via events table) within the specified time period' do |