Class: PhusionPassenger::AdminTools::MemoryStats::Process

Inherits:
Object
  • Object
show all
Defined in:
lib/phusion_passenger/admin_tools/memory_stats.rb

Overview

Information about a single process.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cpuObject

Returns the value of attribute cpu.



37
38
39
# File 'lib/phusion_passenger/admin_tools/memory_stats.rb', line 37

def cpu
  @cpu
end

#nameObject

Returns the value of attribute name.



38
39
40
# File 'lib/phusion_passenger/admin_tools/memory_stats.rb', line 38

def name
  @name
end

#pidObject

Returns the value of attribute pid.



32
33
34
# File 'lib/phusion_passenger/admin_tools/memory_stats.rb', line 32

def pid
  @pid
end

#ppidObject

Returns the value of attribute ppid.



33
34
35
# File 'lib/phusion_passenger/admin_tools/memory_stats.rb', line 33

def ppid
  @ppid
end

#private_dirty_rssObject

in KB



39
40
41
# File 'lib/phusion_passenger/admin_tools/memory_stats.rb', line 39

def private_dirty_rss
  @private_dirty_rss
end

#rssObject

in KB



36
37
38
# File 'lib/phusion_passenger/admin_tools/memory_stats.rb', line 36

def rss
  @rss
end

#threadsObject

Returns the value of attribute threads.



34
35
36
# File 'lib/phusion_passenger/admin_tools/memory_stats.rb', line 34

def threads
  @threads
end

#vm_sizeObject

in KB



35
36
37
# File 'lib/phusion_passenger/admin_tools/memory_stats.rb', line 35

def vm_size
  @vm_size
end

Instance Method Details

#private_dirty_rss_in_mbObject



49
50
51
52
53
54
55
# File 'lib/phusion_passenger/admin_tools/memory_stats.rb', line 49

def private_dirty_rss_in_mb
	if private_dirty_rss.is_a?(Numeric)
		return sprintf("%.1f MB", private_dirty_rss / 1024.0)
	else
		return "?"
	end
end

#rss_in_mbObject



45
46
47
# File 'lib/phusion_passenger/admin_tools/memory_stats.rb', line 45

def rss_in_mb
	return sprintf("%.1f MB", rss / 1024.0)
end

#to_aObject



57
58
59
# File 'lib/phusion_passenger/admin_tools/memory_stats.rb', line 57

def to_a
	return [pid, ppid, vm_size_in_mb, private_dirty_rss_in_mb, rss_in_mb, name]
end

#vm_size_in_mbObject



41
42
43
# File 'lib/phusion_passenger/admin_tools/memory_stats.rb', line 41

def vm_size_in_mb
	return sprintf("%.1f MB", vm_size / 1024.0)
end