komamitsu-gc_monitor 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/gc_monitor.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'thread'
2
2
 
3
3
  module GcMonitor
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
 
6
6
  class << self
7
7
  def remaining_objects
@@ -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 test_truth
9
- assert true
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: komamitsu-gc_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - komamitsu