diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-12-20 21:30:58 +0300 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-12-21 02:39:52 +0300 |
commit | 040167f0724027020f2d63b6e43481fb3e29dbfc (patch) | |
tree | 43d4c3aa998a4a8a4471d5ece67b6b9b68ce76f3 /lib/gitlab/metrics/system.rb | |
parent | ed715b7926c31fddb1c835823d509672663e23e6 (diff) |
Use seconds where possible, and convert to milliseconds for Influxdb consumption
Diffstat (limited to 'lib/gitlab/metrics/system.rb')
-rw-r--r-- | lib/gitlab/metrics/system.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/metrics/system.rb b/lib/gitlab/metrics/system.rb index 4852017bf38..e60e245cf89 100644 --- a/lib/gitlab/metrics/system.rb +++ b/lib/gitlab/metrics/system.rb @@ -35,19 +35,19 @@ module Gitlab if Process.const_defined?(:CLOCK_THREAD_CPUTIME_ID) def self.cpu_time Process - .clock_gettime(Process::CLOCK_THREAD_CPUTIME_ID, :millisecond) + .clock_gettime(Process::CLOCK_THREAD_CPUTIME_ID, :float_second) end else def self.cpu_time Process - .clock_gettime(Process::CLOCK_PROCESS_CPUTIME_ID, :millisecond) + .clock_gettime(Process::CLOCK_PROCESS_CPUTIME_ID, :float_second) end end # Returns the current real time in a given precision. # - # Returns the time as a Fixnum. - def self.real_time(precision = :millisecond) + # Returns the time as a Float for precision = :float_second. + def self.real_time(precision = :float_second) Process.clock_gettime(Process::CLOCK_REALTIME, precision) end |