Class: Evilution::Memory::LeakCheck Private
- Inherits:
-
Object
- Object
- Evilution::Memory::LeakCheck
- Defined in:
- lib/evilution/memory/leak_check.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- WARMUP_ITERATIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
5- DEFAULT_ITERATIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
50- DEFAULT_MAX_GROWTH_KB =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
10 MB
10_240
Instance Attribute Summary collapse
- #samples ⇒ Object readonly private
Instance Method Summary collapse
- #growth_kb ⇒ Object private
-
#initialize(iterations: DEFAULT_ITERATIONS, max_growth_kb: DEFAULT_MAX_GROWTH_KB) ⇒ LeakCheck
constructor
private
A new instance of LeakCheck.
- #passed? ⇒ Boolean private
- #rss_available? ⇒ Boolean private
- #run ⇒ Object private
Constructor Details
#initialize(iterations: DEFAULT_ITERATIONS, max_growth_kb: DEFAULT_MAX_GROWTH_KB) ⇒ LeakCheck
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of LeakCheck.
12 13 14 15 16 |
# File 'lib/evilution/memory/leak_check.rb', line 12 def initialize(iterations: DEFAULT_ITERATIONS, max_growth_kb: DEFAULT_MAX_GROWTH_KB) @iterations = iterations @max_growth_kb = max_growth_kb @samples = [] end |
Instance Attribute Details
#samples ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/evilution/memory/leak_check.rb', line 10 def samples @samples end |
Instance Method Details
#growth_kb ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 31 32 33 |
# File 'lib/evilution/memory/leak_check.rb', line 28 def growth_kb return nil if samples.any?(&:nil?) return 0 if samples.size < 2 samples.last - samples.first end |
#passed? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 38 39 40 |
# File 'lib/evilution/memory/leak_check.rb', line 35 def passed? kb = growth_kb return false if kb.nil? kb <= @max_growth_kb end |
#rss_available? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/evilution/memory/leak_check.rb', line 24 def rss_available? !Evilution::Memory.rss_kb.nil? end |
#run ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 21 22 |
# File 'lib/evilution/memory/leak_check.rb', line 18 def run(&) warmup(&) measure(&) result end |