blob: b99c9ebb24f5c49e999c0302dbed5d5ca4948a8a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# frozen_string_literal: true
module Gitlab
module UsageDataCounters
module WorkItemActivityUniqueCounter
WORK_ITEM_CREATED = 'users_creating_work_items'
WORK_ITEM_TITLE_CHANGED = 'users_updating_work_item_title'
WORK_ITEM_DATE_CHANGED = 'users_updating_work_item_dates'
WORK_ITEM_LABELS_CHANGED = 'users_updating_work_item_labels'
WORK_ITEM_MILESTONE_CHANGED = 'users_updating_work_item_milestone'
class << self
def track_work_item_created_action(author:)
track_unique_action(WORK_ITEM_CREATED, author)
end
def track_work_item_title_changed_action(author:)
track_unique_action(WORK_ITEM_TITLE_CHANGED, author)
end
def track_work_item_date_changed_action(author:)
track_unique_action(WORK_ITEM_DATE_CHANGED, author)
end
def track_work_item_labels_changed_action(author:)
track_unique_action(WORK_ITEM_LABELS_CHANGED, author)
end
def track_work_item_milestone_changed_action(author:)
track_unique_action(WORK_ITEM_MILESTONE_CHANGED, author)
end
private
def track_unique_action(action, author)
return unless author
Gitlab::UsageDataCounters::HLLRedisCounter.track_event(action, values: author.id)
end
end
end
end
end
# rubocop:disable Layout/LineLength
Gitlab::UsageDataCounters::WorkItemActivityUniqueCounter.prepend_mod_with('Gitlab::UsageDataCounters::WorkItemActivityUniqueCounter')
# rubocop:enable Layout/LineLength
|