summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-08-09 10:40:45 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2017-08-09 10:40:45 +0000
commite358cf251a1916284033c4af6f9c75495ad1e2a7 (patch)
treec05ddec11cf9a49f3f3152b02ced9365b145d782
parent1e587d3b7fbe596ab010cb022b0c6526d2489613 (diff)
parent8d46316067399dc8cfe47d705faeb7e323bbad59 (diff)
downloadgitlab-shell-e358cf251a1916284033c4af6f9c75495ad1e2a7.tar.gz
Merge branch '69-monotonic-clock' into 'master'
Support old versions of ruby without a monotonic clock Closes #69 See merge request !161
-rw-r--r--CHANGELOG3
-rw-r--r--VERSION2
-rw-r--r--lib/gitlab_metrics.rb6
3 files changed, 9 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 96e9346..b45b86a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
diff --git a/VERSION b/VERSION
index 11d9efa..1802e77 100644
--- a/VERSION
+++ b/VERSION
@@ -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