diff options
author | Douwe Maan <douwe@gitlab.com> | 2019-08-20 19:05:58 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-08-20 19:05:58 +0300 |
commit | 011c5cebfcdf9c3911d061fef51ed689a83bfc91 (patch) | |
tree | 0ea967a1cc20e9518fdfdc2608e4e0e9dcc9423d /lib | |
parent | 31b508e820376713131c6c3ac459f86377d45b06 (diff) | |
parent | 71691d935e849196cb93e0be101ecbd3e9c245ef (diff) |
Merge branch 'bvl-mr-commit-note-counter' into 'master'
Count notes for commits and merge requests
See merge request gitlab-org/gitlab-ce!31912
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 |