From 79558da92f627da9e310160c89acdeba8b92b359 Mon Sep 17 00:00:00 2001 From: Ahmad Sherif Date: Wed, 16 Nov 2016 14:09:33 +0200 Subject: Add instrumentation to push hooks Related to #22053 --- lib/gitlab_custom_hook.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/gitlab_custom_hook.rb') diff --git a/lib/gitlab_custom_hook.rb b/lib/gitlab_custom_hook.rb index 4edb48b..6f2e901 100644 --- a/lib/gitlab_custom_hook.rb +++ b/lib/gitlab_custom_hook.rb @@ -1,4 +1,5 @@ require 'open3' +require_relative 'gitlab_metrics' class GitlabCustomHook attr_reader :vars @@ -11,21 +12,21 @@ class GitlabCustomHook hook = hook_file('pre-receive', repo_path) return true if hook.nil? - call_receive_hook(hook, changes) + GitlabMetrics.measure("pre-receive-hook") { call_receive_hook(hook, changes) } end def post_receive(changes, repo_path) hook = hook_file('post-receive', repo_path) return true if hook.nil? - call_receive_hook(hook, changes) + GitlabMetrics.measure("post-receive-hook") { call_receive_hook(hook, changes) } end def update(ref_name, old_value, new_value, repo_path) hook = hook_file('update', repo_path) return true if hook.nil? - system(vars, hook, ref_name, old_value, new_value) + GitlabMetrics.measure("update-hook") { system(vars, hook, ref_name, old_value, new_value) } end private -- cgit v1.2.1