Commit 6c2bd3a6 authored by Stan Hu's avatar Stan Hu

Merge branch '52855-use-monotonic-time-in-webhooks' into 'master'

Use monotonic time in computing web hook execution time

Closes #52855

See merge request gitlab-org/gitlab-ce!22448
parents 80351981 a61da802
...@@ -22,7 +22,7 @@ class WebHookService ...@@ -22,7 +22,7 @@ class WebHookService
end end
def execute def execute
start_time = Time.now start_time = Gitlab::Metrics::System.monotonic_time
response = if parsed_url.userinfo.blank? response = if parsed_url.userinfo.blank?
make_request(hook.url) make_request(hook.url)
...@@ -35,7 +35,7 @@ class WebHookService ...@@ -35,7 +35,7 @@ class WebHookService
url: hook.url, url: hook.url,
request_data: data, request_data: data,
response: response, response: response,
execution_duration: Time.now - start_time execution_duration: Gitlab::Metrics::System.monotonic_time - start_time
) )
{ {
...@@ -49,7 +49,7 @@ class WebHookService ...@@ -49,7 +49,7 @@ class WebHookService
url: hook.url, url: hook.url,
request_data: data, request_data: data,
response: InternalErrorResponse.new, response: InternalErrorResponse.new,
execution_duration: Time.now - start_time, execution_duration: Gitlab::Metrics::System.monotonic_time - start_time,
error_message: e.to_s error_message: e.to_s
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment