Skip to content
Snippets Groups Projects
Commit a61da802 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu
Browse files

Use monotonic time in computing web hook execution time

parent c5d8e7fc
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Loading
Loading
@@ -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)
Loading
Loading
@@ -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
)
 
{
Loading
Loading
@@ -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
)
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment