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
1063f7c0
Unverified
Commit
1063f7c0
authored
Nov 07, 2018
by
Ben Kochie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explicitly set process stats with populate_info.
parent
a75c2088
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
lib/gitlab_monitor/process.rb
lib/gitlab_monitor/process.rb
+2
-3
No files found.
lib/gitlab_monitor/process.rb
View file @
1063f7c0
...
...
@@ -11,11 +11,10 @@ module GitLab
class
ProcessStats
def
initialize
(
pid
)
@pid
=
pid
@stats
=
nil
@user_hertz
=
Process
.
clock_getres
(
:TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID
,
:hertz
)
populate_info
@stats
=
populate_info
end
def
valid?
...
...
@@ -44,7 +43,7 @@ module GitLab
def
populate_info
# Pad the array by one element to make field numbers match the man page.
@stats
=
[
""
].
concat
(
File
.
read
(
"/proc/
#{
@pid
}
/stat"
).
split
(
" "
))
[
""
].
concat
(
File
.
read
(
"/proc/
#{
@pid
}
/stat"
).
split
(
" "
))
rescue
Errno
::
ENOENT
nil
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