-
-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Process memory usage and fix process state update #1516
Conversation
Hi there, thanks for the PR! I don't love the idea of adding a dependency for this, especially since it is dashboard only and memory usage is usually better tracked through other tools. That said, how about something like this: def process_pss(pid)
data = File.read("/proc/#{pid}/smaps_rollup")
pss_line = data.lines.find { |line| line.start_with?("Pss:") }
pss_line.split(" ")[1].to_i * 1024
end If that file doesn't exist on macos (you seem to use it, good opportunity to find out), probably need to do some switching based on platform like sidekiq does here (and also to not break on windows): https://github.com/sidekiq/sidekiq/blob/d6354bc74204004fc8b446c96875a333c50d27eb/lib/sidekiq/launcher.rb#L227 It will be unix only but that seems perfectly fine. |
Hi @Earlopain! |
@noma4i thanks for putting together this PR! I'm in agreement with @Earlopain about the reluctance to add dependencies (and unfortunately GoodJob's java CI build are broken at the moment so I'm not able to verify it right now). Also seeing it now, I have a thought of "gosh, I wish that was PSS rather than RSS" (which matters less for the I wonder:
|
Updated. @bensheldon I have used the sidekiq approach to copy same multiplatform behaviour. Macos works, Linux code tested: |
@bensheldon any other change you want to see in this PR? |
@noma4i would you be able to fix the lint errors? ( |
I fixed it. I'll poke at this a tiny bit and then looks good 👍🏻 |
Hi!
I have found that the code around process refresh was shadowed by the
reload
instruction. So basically state field was never refreshed in the database. For this case I have added additional line in the spec file.Initially the idea was to add memory usage to the process state. Like that:
This change uncovered the state update issue.
So far these changes are in this PR: