-
Notifications
You must be signed in to change notification settings - Fork 31
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
ArgumentError with sys-proctable 1.2.0 on Windows #24
Comments
Can you write me a failing test by chance, ideally one that fails on multiple platforms? It still works with mac, so I don't know what to fix:
|
Also this might be a better issue for the sys proctable gem |
My gemfile source 'https://rubygems.org'
gem 'get_process_mem'
gem 'sys-proctable', '1.2.1'
It looks like sys-proctable is only used on Windows. https://github.com/schneems/get_process_mem/blob/master/lib/get_process_mem.rb#L90 Repro require 'get_process_mem'
puts Gem.loaded_specs['sys-proctable'].version
puts "Current memory usage (mb): #{GetProcessMem.new.mb}" They made a breaking change: djberg96/sys-proctable@a0d834a#diff-6eed097efe922533c5d33dc1632d41b2R95
Would a fix that checks the version work? def ps_memory
if RUNS_ON_WINDOWS
args = Gem.loaded_specs['sys-proctable'].version > Gem::Version.new('1.1.5') ? {pid: pid} : pid
size = ProcTable.ps(args).working_set_size
BigDecimal.new(size)
else
mem = `ps -o rss= -p #{pid}`
KB_TO_BYTE * BigDecimal.new(mem == "" ? 0 : mem)
end
end
Edit: Oh. Could just fix it, update version and required dependencies. That's better than coding versions in. Duh. |
Looks like an update to
sys-proctable
is not backwards compatible withget_process_mem
0.2.1
.System specs:
Repro:
Workaround:
gem 'sys-proctable', '1.1.5'
The text was updated successfully, but these errors were encountered: