diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-12-19 17:45:25 +0100 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-12-19 17:45:25 +0100 |
commit | 3c545133e8f23b57698046bae8be23e2bc457aca (patch) | |
tree | 1ace4efa3f3c55ffb121d8dcdcf59ab8dcc84048 /lib | |
parent | a8ebed6016726722a2283458e4176fc9177558af (diff) | |
download | gitlab-ce-3c545133e8f23b57698046bae8be23e2bc457aca.tar.gz |
Fix tests and formatting
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/metrics/influx_db.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/metrics/method_call.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/metrics/system.rb | 1 |
3 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/metrics/influx_db.rb b/lib/gitlab/metrics/influx_db.rb index bdf7910b7c7..153e236d018 100644 --- a/lib/gitlab/metrics/influx_db.rb +++ b/lib/gitlab/metrics/influx_db.rb @@ -38,6 +38,7 @@ module Gitlab # This is memoized since this method is called for every instrumented # method. Loading data from an external cache on every method call slows # things down too much. + # in milliseconds @method_call_threshold ||= settings[:method_call_threshold] end diff --git a/lib/gitlab/metrics/method_call.rb b/lib/gitlab/metrics/method_call.rb index 6fb8f564237..a030092df37 100644 --- a/lib/gitlab/metrics/method_call.rb +++ b/lib/gitlab/metrics/method_call.rb @@ -72,7 +72,7 @@ module Gitlab # Returns true if the total runtime of this method exceeds the method call # threshold. def above_threshold? - real_time >= Metrics.method_call_threshold + real_time_milliseconds >= Metrics.method_call_threshold end def call_measurement_enabled? diff --git a/lib/gitlab/metrics/system.rb b/lib/gitlab/metrics/system.rb index b31cc6236d1..4852017bf38 100644 --- a/lib/gitlab/metrics/system.rb +++ b/lib/gitlab/metrics/system.rb @@ -55,7 +55,6 @@ module Gitlab # # Returns the time as a Float. def self.monotonic_time - Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_second) end end |