Commit 63eba216 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Support old versions of ruby without monotonic clock

parent 1e587d3b
......@@ -21,7 +21,11 @@ module GitlabMetrics
#
# Returns the time as a Fixnum.
def self.monotonic_time
if defined?(Process::CLOCK_MONOTONIC)
Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
else
Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment