summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-10-18 16:56:09 +0000
committerStan Hu <stanhu@gmail.com>2018-10-18 16:56:09 +0000
commit6c2bd3a609d9c27fccc4e42b11abd0fda2909af8 (patch)
tree424937b05983a00d03a647c611d7e55249b1c577 /app/services
parent80351981d244911716ac1283c3c0c77b7a205899 (diff)
parenta61da802081ad644d630d1f590ef818d010fa795 (diff)
downloadgitlab-ce-6c2bd3a609d9c27fccc4e42b11abd0fda2909af8.tar.gz
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
Diffstat (limited to 'app/services')
-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
)