summaryrefslogtreecommitdiff
path: root/app/services/web_hook_service.rb
diff options
context:
space:
mode:
authorHeinrich Lee Yu <hleeyu@gmail.com>2018-10-18 17:23:24 +0800
committerHeinrich Lee Yu <hleeyu@gmail.com>2018-10-18 17:23:24 +0800
commita61da802081ad644d630d1f590ef818d010fa795 (patch)
treee62b4baafe61bcf85101b7684421455b7d542c61 /app/services/web_hook_service.rb
parentc5d8e7fcee6bb15376902e8f1336f1ed368b9da8 (diff)
downloadgitlab-ce-a61da802081ad644d630d1f590ef818d010fa795.tar.gz
Use monotonic time in computing web hook execution time
Diffstat (limited to 'app/services/web_hook_service.rb')
-rw-r--r--app/services/web_hook_service.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/web_hook_service.rb b/app/services/web_hook_service.rb
index 34724e0250d..144d738dfd2 100644
--- a/app/services/web_hook_service.rb
+++ b/app/services/web_hook_service.rb
@@ -22,7 +22,7 @@ class WebHookService
end
def execute
- start_time = Time.now
+ start_time = Gitlab::Metrics::System.monotonic_time
response = if parsed_url.userinfo.blank?
make_request(hook.url)
@@ -35,7 +35,7 @@ class WebHookService
url: hook.url,
request_data: data,
response: response,
- execution_duration: Time.now - start_time
+ execution_duration: Gitlab::Metrics::System.monotonic_time - start_time
)
{
@@ -49,7 +49,7 @@ class WebHookService
url: hook.url,
request_data: data,
response: InternalErrorResponse.new,
- execution_duration: Time.now - start_time,
+ execution_duration: Gitlab::Metrics::System.monotonic_time - start_time,
error_message: e.to_s
)