diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-12-19 19:40:43 +0100 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-12-20 17:49:43 +0100 |
commit | ed715b7926c31fddb1c835823d509672663e23e6 (patch) | |
tree | 0feb93b84820bd8b6ce25581d9b87701fe6c2fdb | |
parent | 3c545133e8f23b57698046bae8be23e2bc457aca (diff) | |
download | gitlab-ce-ed715b7926c31fddb1c835823d509672663e23e6.tar.gz |
use in_milliseconds rails helper
-rw-r--r-- | lib/gitlab/metrics/method_call.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/metrics/transaction.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/metrics/method_call.rb b/lib/gitlab/metrics/method_call.rb index a030092df37..bb39b1d5462 100644 --- a/lib/gitlab/metrics/method_call.rb +++ b/lib/gitlab/metrics/method_call.rb @@ -27,7 +27,7 @@ module Gitlab @transaction = transaction @name = name @labels = { module: @module_name, method: @method_name } - @real_time_seconds = 0 + @real_time_seconds = 0.0 @cpu_time = 0 @call_count = 0 end @@ -53,7 +53,7 @@ module Gitlab end def real_time_milliseconds - (real_time_seconds * 1000.0).to_i + real_time_seconds.in_milliseconds.to_i end # Returns a Metric instance of the current method call. diff --git a/lib/gitlab/metrics/transaction.rb b/lib/gitlab/metrics/transaction.rb index 16f0969ab74..e7975c023a9 100644 --- a/lib/gitlab/metrics/transaction.rb +++ b/lib/gitlab/metrics/transaction.rb @@ -36,7 +36,7 @@ module Gitlab end def duration_milliseconds - (duration * 1000).to_i + duration.in_milliseconds.to_i end def allocated_memory |