2022-02-22 12:14:09 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module UsageDataCounters
|
|
|
|
module WorkItemActivityUniqueCounter
|
2022-02-24 18:19:04 +00:00
|
|
|
WORK_ITEM_CREATED = 'users_creating_work_items'
|
2022-02-22 12:14:09 +00:00
|
|
|
WORK_ITEM_TITLE_CHANGED = 'users_updating_work_item_title'
|
2022-08-10 21:09:39 +00:00
|
|
|
WORK_ITEM_DATE_CHANGED = 'users_updating_work_item_dates'
|
2022-02-22 12:14:09 +00:00
|
|
|
|
|
|
|
class << self
|
2022-02-24 18:19:04 +00:00
|
|
|
def track_work_item_created_action(author:)
|
|
|
|
track_unique_action(WORK_ITEM_CREATED, author)
|
|
|
|
end
|
|
|
|
|
2022-02-22 12:14:09 +00:00
|
|
|
def track_work_item_title_changed_action(author:)
|
|
|
|
track_unique_action(WORK_ITEM_TITLE_CHANGED, author)
|
|
|
|
end
|
|
|
|
|
2022-08-10 21:09:39 +00:00
|
|
|
def track_work_item_date_changed_action(author:)
|
|
|
|
track_unique_action(WORK_ITEM_DATE_CHANGED, author)
|
|
|
|
end
|
|
|
|
|
2022-02-22 12:14:09 +00:00
|
|
|
private
|
|
|
|
|
|
|
|
def track_unique_action(action, author)
|
|
|
|
return unless author
|
|
|
|
|
|
|
|
Gitlab::UsageDataCounters::HLLRedisCounter.track_event(action, values: author.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2022-07-14 15:08:22 +00:00
|
|
|
|
|
|
|
# rubocop:disable Layout/LineLength
|
|
|
|
Gitlab::UsageDataCounters::WorkItemActivityUniqueCounter.prepend_mod_with('Gitlab::UsageDataCounters::WorkItemActivityUniqueCounter')
|
|
|
|
# rubocop:enable Layout/LineLength
|