Class: FFWD::Statistics::SMAP
- Inherits:
-
Object
- Object
- FFWD::Statistics::SMAP
- Defined in:
- lib/ffwd/statistics/system_statistics.rb
Overview
Example SMAP (mapping header) Size: 4 kB Rss: 0 kB Pss: 0 kB Shared_Clean: 0 kB Shared_Dirty: 0 kB Private_Clean: 0 kB Private_Dirty: 0 kB Referenced: 0 kB Anonymous: 0 kB AnonHugePages: 0 kB Swap: 0 kB KernelPageSize: 4 kB MMUPageSize: 4 kB Locked: 0 kB VmFlags: rd ex
Constant Summary collapse
- KEY_MAPPING =
{ "Size" => :size, "Rss" => :rss, "Pss" => :pss, "Shared_Clean" => :shared_clean, "Shared_Dirty" => :shared_dirty, "Private_Clean" => :private_clean, "Private_Dirty" => :private_dirty, "Referenced" => :referenced, "Anonymous" => :anonymous, "AnonHugePages" => :anon_huge_pages, "Swap" => :swap, "KernelPageSize" => :kernel_page_size, "MMUPageSize" => :mmu_page_size, "Locked" => :locked, "VmFlags" => :vm_flags, }
- TYPE_MAP =
{ "VmFlags" => lambda{|s| s} }
- DEFAULT_TYPE =
lambda{|s| s[0, s.size - 3].to_i * 1024}
Instance Attribute Summary collapse
-
#anon_huge_pages ⇒ Object
readonly
Returns the value of attribute anon_huge_pages.
-
#anonymous ⇒ Object
readonly
Returns the value of attribute anonymous.
-
#kernel_page_size ⇒ Object
readonly
Returns the value of attribute kernel_page_size.
-
#locked ⇒ Object
readonly
Returns the value of attribute locked.
-
#mmu_page_size ⇒ Object
readonly
Returns the value of attribute mmu_page_size.
-
#private_clean ⇒ Object
readonly
Returns the value of attribute private_clean.
-
#private_dirty ⇒ Object
readonly
Returns the value of attribute private_dirty.
-
#pss ⇒ Object
readonly
Returns the value of attribute pss.
-
#referenced ⇒ Object
readonly
Returns the value of attribute referenced.
-
#rss ⇒ Object
readonly
Returns the value of attribute rss.
-
#shared_clean ⇒ Object
readonly
Returns the value of attribute shared_clean.
-
#shared_dirty ⇒ Object
readonly
Returns the value of attribute shared_dirty.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#swap ⇒ Object
readonly
Returns the value of attribute swap.
-
#vmflags ⇒ Object
readonly
Returns the value of attribute vmflags.
Instance Method Summary collapse
-
#initialize(values) ⇒ SMAP
constructor
A new instance of SMAP.
Constructor Details
#initialize(values) ⇒ SMAP
Returns a new instance of SMAP.
78 79 80 81 82 83 84 85 86 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 78 def initialize values values.each do |key, value| unless target = KEY_MAPPING[key] raise "unexpected key: #{key}" end instance_variable_set "@#{target}", value end end |
Instance Attribute Details
#anon_huge_pages ⇒ Object (readonly)
Returns the value of attribute anon_huge_pages.
47 48 49 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 47 def anon_huge_pages @anon_huge_pages end |
#anonymous ⇒ Object (readonly)
Returns the value of attribute anonymous.
46 47 48 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 46 def anonymous @anonymous end |
#kernel_page_size ⇒ Object (readonly)
Returns the value of attribute kernel_page_size.
49 50 51 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 49 def kernel_page_size @kernel_page_size end |
#locked ⇒ Object (readonly)
Returns the value of attribute locked.
51 52 53 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 51 def locked @locked end |
#mmu_page_size ⇒ Object (readonly)
Returns the value of attribute mmu_page_size.
50 51 52 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 50 def mmu_page_size @mmu_page_size end |
#private_clean ⇒ Object (readonly)
Returns the value of attribute private_clean.
43 44 45 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 43 def private_clean @private_clean end |
#private_dirty ⇒ Object (readonly)
Returns the value of attribute private_dirty.
44 45 46 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 44 def private_dirty @private_dirty end |
#pss ⇒ Object (readonly)
Returns the value of attribute pss.
40 41 42 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 40 def pss @pss end |
#referenced ⇒ Object (readonly)
Returns the value of attribute referenced.
45 46 47 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 45 def referenced @referenced end |
#rss ⇒ Object (readonly)
Returns the value of attribute rss.
39 40 41 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 39 def rss @rss end |
#shared_clean ⇒ Object (readonly)
Returns the value of attribute shared_clean.
41 42 43 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 41 def shared_clean @shared_clean end |
#shared_dirty ⇒ Object (readonly)
Returns the value of attribute shared_dirty.
42 43 44 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 42 def shared_dirty @shared_dirty end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
38 39 40 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 38 def size @size end |
#swap ⇒ Object (readonly)
Returns the value of attribute swap.
48 49 50 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 48 def swap @swap end |
#vmflags ⇒ Object (readonly)
Returns the value of attribute vmflags.
52 53 54 |
# File 'lib/ffwd/statistics/system_statistics.rb', line 52 def vmflags @vmflags end |