Commit f4ed9f50 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 0473d9a6 388a4964
...@@ -57,17 +57,9 @@ module Gitlab ...@@ -57,17 +57,9 @@ module Gitlab
end end
end end
# THREAD_CPUTIME is not supported on OS X def self.cpu_time
if Process.const_defined?(:CLOCK_THREAD_CPUTIME_ID) Process
def self.cpu_time .clock_gettime(Process::CLOCK_PROCESS_CPUTIME_ID, :float_second)
Process
.clock_gettime(Process::CLOCK_THREAD_CPUTIME_ID, :float_second)
end
else
def self.cpu_time
Process
.clock_gettime(Process::CLOCK_PROCESS_CPUTIME_ID, :float_second)
end
end end
# Returns the current real time in a given precision. # Returns the current real time in a given precision.
......
...@@ -52,13 +52,13 @@ describe Gitlab::Metrics::System do ...@@ -52,13 +52,13 @@ describe Gitlab::Metrics::System do
end end
describe '.cpu_time' do describe '.cpu_time' do
it 'returns a Fixnum' do it 'returns a Float' do
expect(described_class.cpu_time).to be_an(Float) expect(described_class.cpu_time).to be_an(Float)
end end
end end
describe '.real_time' do describe '.real_time' do
it 'returns a Fixnum' do it 'returns a Float' do
expect(described_class.real_time).to be_an(Float) expect(described_class.real_time).to be_an(Float)
end 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