komamitsu-gc_monitor 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/gc_monitor.rb +1 -1
- data/test/test_gc_monitor.rb +17 -2
- metadata +1 -1
data/lib/gc_monitor.rb
CHANGED
data/test/test_gc_monitor.rb
CHANGED
@@ -1,11 +1,26 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
2
|
|
3
|
+
class Foo
|
4
|
+
attr_accessor :dummy
|
5
|
+
include GcMonitor
|
6
|
+
end
|
7
|
+
|
3
8
|
class TestGcMonitor < Test::Unit::TestCase
|
4
9
|
|
5
10
|
def setup
|
6
11
|
end
|
7
12
|
|
8
|
-
def
|
9
|
-
|
13
|
+
def test_exit_normal
|
14
|
+
Foo.release_hook('puts "i am released."') # This is option hook, for debug.
|
15
|
+
# GcMonitor.tcp_server('0.0.0.0', 4321)
|
16
|
+
|
17
|
+
10.times do
|
18
|
+
o = Foo.new
|
19
|
+
o.dummy = 'x' * 10 * 1024 * 1024 # For GC.
|
20
|
+
sleep 0.5
|
21
|
+
end
|
22
|
+
|
23
|
+
# You can filter the objects with using :time keyword.
|
24
|
+
assert GcMonitor.list(:time => 8).kind_of? Array
|
10
25
|
end
|
11
26
|
end
|