Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-12-12 20:12:49 +0300
committerPawel Chojnacki <pawel@chojnacki.ws>2017-12-12 20:12:49 +0300
commita8ebed6016726722a2283458e4176fc9177558af (patch)
tree74b98a9f79e6de5dbbb7e4d5cee84d1aa46a7ca6 /lib/gitlab/metrics/system.rb
parentb02db1f4931060d9e28bd0d651dbea34c79340e2 (diff)
Make `System.monotonic_time` retun seconds represented by float with microsecond precision
Diffstat (limited to 'lib/gitlab/metrics/system.rb')
-rw-r--r--lib/gitlab/metrics/system.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/gitlab/metrics/system.rb b/lib/gitlab/metrics/system.rb
index c2cbd3c16a1..b31cc6236d1 100644
--- a/lib/gitlab/metrics/system.rb
+++ b/lib/gitlab/metrics/system.rb
@@ -51,11 +51,12 @@ module Gitlab
Process.clock_gettime(Process::CLOCK_REALTIME, precision)
end
- # Returns the current monotonic clock time in a given precision.
+ # Returns the current monotonic clock time as seconds with microseconds precision.
#
- # Returns the time as a Fixnum.
- def self.monotonic_time(precision = :millisecond)
- Process.clock_gettime(Process::CLOCK_MONOTONIC, precision)
+ # Returns the time as a Float.
+ def self.monotonic_time
+
+ Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_second)
end
end
end