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'
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|