From 4a6f959ab8f2928225a055d9dc62647c78df5bbe Mon Sep 17 00:00:00 2001 From: Mark Chao Date: Thu, 8 Aug 2019 13:18:57 +0000 Subject: Record usage on snippet usage Generalize wiki page counter for other page types to extend to. --- app/services/update_snippet_service.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/services/update_snippet_service.rb') diff --git a/app/services/update_snippet_service.rb b/app/services/update_snippet_service.rb index 15bc1046a4e..2969c360de5 100644 --- a/app/services/update_snippet_service.rb +++ b/app/services/update_snippet_service.rb @@ -25,6 +25,8 @@ class UpdateSnippetService < BaseService snippet.assign_attributes(params) spam_check(snippet, current_user) - snippet.save + snippet.save.tap do |succeeded| + Gitlab::UsageDataCounters::SnippetCounter.count(:update) if succeeded + end end end -- cgit v1.2.1