diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-08-16 17:56:33 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-08-16 18:54:42 +0200 |
commit | 71691d935e849196cb93e0be101ecbd3e9c245ef (patch) | |
tree | e52a508f1c698d44150daeb3fff0bcf228c713e7 /lib | |
parent | 535c2d3c71c1cc623958a48f429a88ecaafb2702 (diff) | |
download | gitlab-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')
-rw-r--r-- | lib/gitlab/usage_data_counters/note_counter.rb | 8 |
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 |