summaryrefslogtreecommitdiff
path: root/lib/gitlab/usage_data_counters
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2019-08-16 17:56:33 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2019-08-16 18:54:42 +0200
commit71691d935e849196cb93e0be101ecbd3e9c245ef (patch)
treee52a508f1c698d44150daeb3fff0bcf228c713e7 /lib/gitlab/usage_data_counters
parent535c2d3c71c1cc623958a48f429a88ecaafb2702 (diff)
downloadgitlab-ce-71691d935e849196cb93e0be101ecbd3e9c245ef.tar.gz
Count comments on notes and merge requests
This extends our existing `Gitlab::UsageDataCounters::NoteCounter` to also count notes on commits and merge requests
Diffstat (limited to 'lib/gitlab/usage_data_counters')
-rw-r--r--lib/gitlab/usage_data_counters/note_counter.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/usage_data_counters/note_counter.rb b/lib/gitlab/usage_data_counters/note_counter.rb
index e93a0bcfa27..672450ec82b 100644
--- a/lib/gitlab/usage_data_counters/note_counter.rb
+++ b/lib/gitlab/usage_data_counters/note_counter.rb
@@ -4,7 +4,7 @@ module Gitlab::UsageDataCounters
class NoteCounter < BaseCounter
KNOWN_EVENTS = %w[create].freeze
PREFIX = 'note'
- COUNTABLE_TYPES = %w[Snippet].freeze
+ COUNTABLE_TYPES = %w[Snippet Commit MergeRequest].freeze
class << self
def redis_key(event, noteable_type)
@@ -24,9 +24,9 @@ module Gitlab::UsageDataCounters
end
def totals
- {
- snippet_comment: read(:create, 'Snippet')
- }
+ COUNTABLE_TYPES.map do |countable_type|
+ [:"#{countable_type.underscore}_comment", read(:create, countable_type)]
+ end.to_h
end
private