Skip to content
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

Get the unique_set_size with other process info #317

Merged
merged 3 commits into from
Nov 30, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Whitespace cleanup.
  • Loading branch information
jrafanie committed Nov 30, 2017
commit 8c0715d7861aaf71ef658eba8ec8f2d0f9573d6b
26 changes: 13 additions & 13 deletions lib/gems/pending/util/miq-process.rb
Original file line number Diff line number Diff line change
@@ -98,20 +98,20 @@ def self.processInfo(pid = nil)
wmi.release
when :linux
x = MiqProcess.linux_process_stat(pid)
result[:name] = x[:name]
result[:priority] = x[:priority]
result[:memory_usage] = x[:rss] * 4096
result[:memory_size] = x[:vsize]
percent_memory = (1.0 * result[:memory_usage]) / MiqSystem.total_memory
result[:percent_memory] = round_to(percent_memory * 100.0, 2)
result[:cpu_time] = x[:stime] + x[:utime]
cpu_status = MiqSystem.status[:cpu]
cpu_total = (0..3).inject(0) { |sum, x| sum + cpu_status[x].to_i }
cpu_total /= MiqSystem.num_cpus
percent_cpu = (1.0 * result[:cpu_time]) / cpu_total
result[:percent_cpu] = round_to(percent_cpu * 100.0, 2)
result[:name] = x[:name]
result[:priority] = x[:priority]
result[:memory_usage] = x[:rss] * 4096
result[:memory_size] = x[:vsize]
percent_memory = (1.0 * result[:memory_usage]) / MiqSystem.total_memory
result[:percent_memory] = round_to(percent_memory * 100.0, 2)
result[:cpu_time] = x[:stime] + x[:utime]
cpu_status = MiqSystem.status[:cpu]
cpu_total = (0..3).inject(0) { |sum, x| sum + cpu_status[x].to_i }
cpu_total /= MiqSystem.num_cpus
percent_cpu = (1.0 * result[:cpu_time]) / cpu_total
result[:percent_cpu] = round_to(percent_cpu * 100.0, 2)
result[:proportional_set_size] = Sys::ProcTable.ps(pid).smaps.pss
result[:unique_set_size] = Sys::ProcTable.ps(pid).smaps.uss
result[:unique_set_size] = Sys::ProcTable.ps(pid).smaps.uss
when :macosx
h = nil
begin