diff options
-rw-r--r-- | CHANGELOG | 3 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | lib/gitlab_metrics.rb | 6 |
3 files changed, 9 insertions, 2 deletions
@@ -1,3 +1,6 @@ +v5.8.1 + - Support old versions of ruby without monotonic clock + v5.8.0 - Fix SSH support for Git for Windows v2.14 @@ -1 +1 @@ -5.8.0 +5.8.1 diff --git a/lib/gitlab_metrics.rb b/lib/gitlab_metrics.rb index b974b8a..413b799 100644 --- a/lib/gitlab_metrics.rb +++ b/lib/gitlab_metrics.rb @@ -21,7 +21,11 @@ module GitlabMetrics # # Returns the time as a Fixnum. def self.monotonic_time - Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond) + if defined?(Process::CLOCK_MONOTONIC) + Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond) + else + Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) + end end end |