diff options
Diffstat (limited to 'lib/gitlab/usage_data_counters')
-rw-r--r-- | lib/gitlab/usage_data_counters/hll_redis_counter.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb | 42 | ||||
-rw-r--r-- | lib/gitlab/usage_data_counters/known_events.yml | 28 |
3 files changed, 69 insertions, 4 deletions
diff --git a/lib/gitlab/usage_data_counters/hll_redis_counter.rb b/lib/gitlab/usage_data_counters/hll_redis_counter.rb index 53bf6daea4c..eb132ef0967 100644 --- a/lib/gitlab/usage_data_counters/hll_redis_counter.rb +++ b/lib/gitlab/usage_data_counters/hll_redis_counter.rb @@ -72,7 +72,8 @@ module Gitlab events_names = events_for_category(category) event_results = events_names.each_with_object({}) do |event, hash| - hash[event] = unique_events(event_names: event, start_date: 7.days.ago.to_date, end_date: Date.current) + hash["#{event}_weekly"] = unique_events(event_names: event, start_date: 7.days.ago.to_date, end_date: Date.current) + hash["#{event}_monthly"] = unique_events(event_names: event, start_date: 4.weeks.ago.to_date, end_date: Date.current) end if eligible_for_totals?(events_names) diff --git a/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb b/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb index fc1b5a59487..b1ce46a1ff5 100644 --- a/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb +++ b/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb @@ -3,14 +3,26 @@ module Gitlab module UsageDataCounters module IssueActivityUniqueCounter - ISSUE_TITLE_CHANGED = 'g_project_management_issue_title_changed' - ISSUE_DESCRIPTION_CHANGED = 'g_project_management_issue_description_changed' + ISSUE_CATEGORY = 'issues_edit' + ISSUE_ASSIGNEE_CHANGED = 'g_project_management_issue_assignee_changed' + ISSUE_CREATED = 'g_project_management_issue_created' + ISSUE_CLOSED = 'g_project_management_issue_closed' + ISSUE_DESCRIPTION_CHANGED = 'g_project_management_issue_description_changed' + ISSUE_ITERATION_CHANGED = 'g_project_management_issue_iteration_changed' + ISSUE_LABEL_CHANGED = 'g_project_management_issue_label_changed' ISSUE_MADE_CONFIDENTIAL = 'g_project_management_issue_made_confidential' ISSUE_MADE_VISIBLE = 'g_project_management_issue_made_visible' - ISSUE_CATEGORY = 'issues_edit' + ISSUE_MILESTONE_CHANGED = 'g_project_management_issue_milestone_changed' + ISSUE_REOPENED = 'g_project_management_issue_reopened' + ISSUE_TITLE_CHANGED = 'g_project_management_issue_title_changed' + ISSUE_WEIGHT_CHANGED = 'g_project_management_issue_weight_changed' class << self + def track_issue_created_action(author:, time: Time.zone.now) + track_unique_action(ISSUE_CREATED, author, time) + end + def track_issue_title_changed_action(author:, time: Time.zone.now) track_unique_action(ISSUE_TITLE_CHANGED, author, time) end @@ -31,6 +43,30 @@ module Gitlab track_unique_action(ISSUE_MADE_VISIBLE, author, time) end + def track_issue_closed_action(author:, time: Time.zone.now) + track_unique_action(ISSUE_CLOSED, author, time) + end + + def track_issue_reopened_action(author:, time: Time.zone.now) + track_unique_action(ISSUE_REOPENED, author, time) + end + + def track_issue_label_changed_action(author:, time: Time.zone.now) + track_unique_action(ISSUE_LABEL_CHANGED, author, time) + end + + def track_issue_milestone_changed_action(author:, time: Time.zone.now) + track_unique_action(ISSUE_MILESTONE_CHANGED, author, time) + end + + def track_issue_iteration_changed_action(author:, time: Time.zone.now) + track_unique_action(ISSUE_ITERATION_CHANGED, author, time) + end + + def track_issue_weight_changed_action(author:, time: Time.zone.now) + track_unique_action(ISSUE_WEIGHT_CHANGED, author, time) + end + private def track_unique_action(action, author, time) diff --git a/lib/gitlab/usage_data_counters/known_events.yml b/lib/gitlab/usage_data_counters/known_events.yml index 25e7f858bb1..9bbf804d87c 100644 --- a/lib/gitlab/usage_data_counters/known_events.yml +++ b/lib/gitlab/usage_data_counters/known_events.yml @@ -206,3 +206,31 @@ category: issues_edit redis_slot: project_management aggregation: daily +- name: g_project_management_issue_created + category: issues_edit + redis_slot: project_management + aggregation: daily +- name: g_project_management_issue_closed + category: issues_edit + redis_slot: project_management + aggregation: daily +- name: g_project_management_issue_reopened + category: issues_edit + redis_slot: project_management + aggregation: daily +- name: g_project_management_issue_label_changed + category: issues_edit + redis_slot: project_management + aggregation: daily +- name: g_project_management_issue_milestone_changed + category: issues_edit + redis_slot: project_management + aggregation: daily +- name: g_project_management_issue_iteration_changed + category: issues_edit + redis_slot: project_management + aggregation: daily +- name: g_project_management_issue_weight_changed + category: issues_edit + redis_slot: project_management + aggregation: daily |