Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
gitlab-org
gitlab-exporter
Commits
93b99e9c
Unverified
Commit
93b99e9c
authored
Nov 07, 2018
by
Ben Kochie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle Process.clock_getres failures.
parent
1063f7c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
lib/gitlab_monitor/process.rb
lib/gitlab_monitor/process.rb
+8
-4
No files found.
lib/gitlab_monitor/process.rb
View file @
93b99e9c
...
...
@@ -10,10 +10,8 @@ module GitLab
# It takes a pid
class
ProcessStats
def
initialize
(
pid
)
@pid
=
pid
@user_hertz
=
Process
.
clock_getres
(
:TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID
,
:hertz
)
@pid
=
pid
@user_hertz
=
retrieve_user_hertz
@stats
=
populate_info
end
...
...
@@ -47,6 +45,12 @@ module GitLab
rescue
Errno
::
ENOENT
nil
end
def
retrieve_user_hertz
Process
.
clock_getres
(
:TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID
,
:hertz
)
rescue
Errno
::
EINVAL
100.0
end
end
# Probes a process for info then writes metrics to a target
...
...
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