Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f4ed9f50
Commit
f4ed9f50
authored
Jun 28, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
0473d9a6
388a4964
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
13 deletions
+5
-13
lib/gitlab/metrics/system.rb
lib/gitlab/metrics/system.rb
+3
-11
spec/lib/gitlab/metrics/system_spec.rb
spec/lib/gitlab/metrics/system_spec.rb
+2
-2
No files found.
lib/gitlab/metrics/system.rb
View file @
f4ed9f50
...
...
@@ -57,17 +57,9 @@ module Gitlab
end
end
# THREAD_CPUTIME is not supported on OS X
if
Process
.
const_defined?
(
:CLOCK_THREAD_CPUTIME_ID
)
def
self
.
cpu_time
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
def
self
.
cpu_time
Process
.
clock_gettime
(
Process
::
CLOCK_PROCESS_CPUTIME_ID
,
:float_second
)
end
# Returns the current real time in a given precision.
...
...
spec/lib/gitlab/metrics/system_spec.rb
View file @
f4ed9f50
...
...
@@ -52,13 +52,13 @@ describe Gitlab::Metrics::System do
end
describe
'.cpu_time'
do
it
'returns a F
ixnum
'
do
it
'returns a F
loat
'
do
expect
(
described_class
.
cpu_time
).
to
be_an
(
Float
)
end
end
describe
'.real_time'
do
it
'returns a F
ixnum
'
do
it
'returns a F
loat
'
do
expect
(
described_class
.
real_time
).
to
be_an
(
Float
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment