Class: Hotch::Memory::Report::Line
- Inherits:
-
Struct
- Object
- Struct
- Hotch::Memory::Report::Line
- Defined in:
- lib/hotch/memory.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Total
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#max_age ⇒ Object
Returns the value of attribute max_age.
-
#min_age ⇒ Object
Returns the value of attribute min_age.
-
#old_count ⇒ Object
Returns the value of attribute old_count.
-
#total_age ⇒ Object
Returns the value of attribute total_age.
-
#total_memsize ⇒ Object
Returns the value of attribute total_memsize.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
-
.from_result(result, ignore_paths) ⇒ Object
- [path, lineno, type], [count, old_count, total_age, min_age, max_age, total_memsize
-
].
Instance Method Summary collapse
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count
143 144 145 |
# File 'lib/hotch/memory.rb', line 143 def count @count end |
#filename ⇒ Object
Returns the value of attribute filename
143 144 145 |
# File 'lib/hotch/memory.rb', line 143 def filename @filename end |
#max_age ⇒ Object
Returns the value of attribute max_age
143 144 145 |
# File 'lib/hotch/memory.rb', line 143 def max_age @max_age end |
#min_age ⇒ Object
Returns the value of attribute min_age
143 144 145 |
# File 'lib/hotch/memory.rb', line 143 def min_age @min_age end |
#old_count ⇒ Object
Returns the value of attribute old_count
143 144 145 |
# File 'lib/hotch/memory.rb', line 143 def old_count @old_count end |
#total_age ⇒ Object
Returns the value of attribute total_age
143 144 145 |
# File 'lib/hotch/memory.rb', line 143 def total_age @total_age end |
#total_memsize ⇒ Object
Returns the value of attribute total_memsize
143 144 145 |
# File 'lib/hotch/memory.rb', line 143 def total_memsize @total_memsize end |
#type ⇒ Object
Returns the value of attribute type
143 144 145 |
# File 'lib/hotch/memory.rb', line 143 def type @type end |
Class Method Details
.from_result(result, ignore_paths) ⇒ Object
[
[path, lineno, type],
[count, old_count, total_age, min_age, max_age, total_memsize]
]
149 150 151 152 153 154 |
# File 'lib/hotch/memory.rb', line 149 def self.from_result(result, ignore_paths) path, line, *args = result.flatten(1) return if ignore_paths.any? { |ip| ip == path || ip === path } filename = "#{strip_path(path || "?")}:#{line}" new(filename, *args) end |
Instance Method Details
#key ⇒ Object
156 157 158 |
# File 'lib/hotch/memory.rb', line 156 def key [filename, type] end |
#lengths ⇒ Object
165 166 167 |
# File 'lib/hotch/memory.rb', line 165 def lengths members.map { |member| self[member].to_s.size } end |
#puts(io, fmt) ⇒ Object
160 161 162 163 |
# File 'lib/hotch/memory.rb', line 160 def puts(io, fmt) send = method(:send) io.puts fmt % members.map(&send) end |
#sum(other) ⇒ Object
169 170 171 172 173 |
# File 'lib/hotch/memory.rb', line 169 def sum(other) other.to_a.each.with_index do |value, i| self[i] += value if Numeric === value end end |