tunemygc 1.0.46 → 1.0.47

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49de1d99a256241f20303c4a9aadad76f38d018a
4
- data.tar.gz: 6ad5a64acd9b13d07b97dfcca71c96b0117c1c72
3
+ metadata.gz: fdd4781423af377b02af2c99a16794cdec61e12e
4
+ data.tar.gz: b5c7fc03f4693a1d2ccc3015b1363fe4b1da4e6a
5
5
  SHA512:
6
- metadata.gz: e2c5826b227af1523049f58f76193ea72a96e05892a9bd3ab4222ea5af6e62e5b0db157f71dd3ef7463b1397baac78e0d8aaa1a602141730c26b05bb8c92ef84
7
- data.tar.gz: c1c2955d6bfc5b7724ad0bed2eed20bdeb1792094bda6802d3ef8ec16dbd0c69d1a005f20e7b295e8c34c4c6983043f5e191cf1b16f7dc409427eee425ad2a10
6
+ metadata.gz: fdb95cbb93251ff6ecfa865ebf058c2be1d28a69177513973bbdb4a9b5303ebf2f6bb8477a9c7ef0abb1fb5f990726f3656366e3de995412f210a229c0c7b9eb
7
+ data.tar.gz: b3e123b1e316e8b35ff1d475b1c849b73f2cdfb38b7bdc594c6aaf91a3089cd4cec5c33f218e12652331768b26488c8b3c645531cf806c04c4ade350d93297b6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tunemygc (1.0.43)
4
+ tunemygc (1.0.46)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -6,7 +6,7 @@ The Ruby garbage collector has been flagged as the crux of Ruby performance and
6
6
 
7
7
  ## We're fixing this
8
8
 
9
- ![tunemygc workflow diagram](https://raw.githubusercontent.com/bear-metal/tunemygc/master/assets/tunemygc-graphic2x-80dac1571cacc70d9b272bb62ae9f6df.png?token=AAABe8sM_ofiQkrCpNw7OYRbtHMLO9l5ks5UuQlYwA%3D%3D)
9
+ ![tunemygc workflow diagram](https://raw.githubusercontent.com/bear-metal/tunemygc/master/assets/tunemygc-graphic2x-b3390590eadab5528577f4e0285330fd.png?token=AAABe8sM_ofiQkrCpNw7OYRbtHMLO9l5ks5UuQlYwA%3D%3D)
10
10
 
11
11
  We also recently [blogged](http://bearmetal.eu/theden/2015-02-20-rails-garbage-collection-tuning-approaches) about how the product works.
12
12
 
@@ -35,11 +35,11 @@ module TuneMyGc
35
35
  logger.info "[TuneMyGC, pid: #{Process.pid}] #{message}"
36
36
  end
37
37
 
38
- def spy_id
39
- TuneMyGc::Spies.id
38
+ def spy_ids
39
+ TuneMyGc::Spies.ids
40
40
  end
41
41
 
42
- def spy
42
+ def spies
43
43
  TuneMyGc::Spies.current
44
44
  end
45
45
 
@@ -4,12 +4,16 @@ require 'tunemygc/spies'
4
4
 
5
5
  module TuneMyGc
6
6
  class Interposer
7
- attr_reader :spy
7
+ attr_reader :spies
8
8
  attr_accessor :installed
9
9
 
10
- def initialize(spy = TuneMyGc.spy)
10
+ def initialize(spies = TuneMyGc.spies)
11
11
  reset
12
- @spy = TuneMyGc::Spies.const_get(spy).new
12
+ @spies = spies.map{|s| TuneMyGc::Spies.const_get(s).new }
13
+ end
14
+
15
+ def spy
16
+ @spies.first
13
17
  end
14
18
 
15
19
  def on_initialized
@@ -17,7 +21,7 @@ module TuneMyGc
17
21
  TuneMyGc.install_gc_tracepoint
18
22
  TuneMyGc.log "hooked: GC tracepoints"
19
23
  TuneMyGc.snapshot(:BOOTED)
20
- TuneMyGc.interposer.spy.install
24
+ TuneMyGc.interposer.spies.each{|s| s.install }
21
25
  end
22
26
 
23
27
  def install
@@ -36,7 +40,7 @@ module TuneMyGc
36
40
  at_exit do
37
41
  if @installed
38
42
  TuneMyGc.log "at_exit"
39
- @spy.uninstall
43
+ @spies.each{|s| s.uninstall }
40
44
  TuneMyGc.snapshot(:TERMINATED)
41
45
  TuneMyGc.reccommendations
42
46
  end
@@ -47,13 +51,13 @@ module TuneMyGc
47
51
  end
48
52
 
49
53
  def check_uninstall
50
- @spy.check_uninstall
54
+ @spies.each{|s| s.check_uninstall }
51
55
  end
52
56
 
53
57
  def uninstall
54
58
  TuneMyGc.uninstall_gc_tracepoint
55
59
  TuneMyGc.log "uninstalled GC tracepoint"
56
- @spy.uninstall
60
+ @spies.each{|s| s.uninstall }
57
61
  reset
58
62
  end
59
63
 
@@ -15,15 +15,19 @@ module TuneMyGc
15
15
  spy :Rspec, 'rspec'
16
16
  spy :QueJob, 'que_job'
17
17
 
18
- def self.id
19
- @spies.key(current)
18
+ def self.ids
19
+ current.map do |spy|
20
+ @spies.key(spy)
21
+ end.join(',')
20
22
  end
21
23
 
22
24
  def self.current
23
25
  if ENV['RUBY_GC_SPY']
24
- @spies[ENV['RUBY_GC_SPY']] || raise(NotImplementedError, "TuneMyGC spy #{ENV['RUBY_GC_SPY']} not supported. Valid spies are #{@spies.keys}")
26
+ ENV['RUBY_GC_SPY'].split(",").map do |spy|
27
+ @spies[spy] || raise(NotImplementedError, "TuneMyGC spy #{spy} not supported. Valid spies are #{@spies.keys}")
28
+ end
25
29
  else
26
- TuneMyGc.rails? ? 'ActionController' : 'Manual'
30
+ [(TuneMyGc.rails? ? 'ActionController' : 'Manual')]
27
31
  end
28
32
  end
29
33
  end
@@ -59,7 +59,7 @@ module TuneMyGc
59
59
  end
60
60
 
61
61
  def environment(snapshotter)
62
- ENVIRONMENT.dup.concat([snapshotter.stat_keys, TuneMyGc.spy_id, Socket.gethostname, Process.ppid, Process.pid])
62
+ ENVIRONMENT.dup.concat([snapshotter.stat_keys, TuneMyGc.spy_ids, Socket.gethostname, Process.ppid, Process.pid])
63
63
  end
64
64
 
65
65
  private
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module TuneMyGc
4
- VERSION = "1.0.46"
4
+ VERSION = "1.0.47"
5
5
  end
@@ -14,17 +14,17 @@ class TestActiveJobInterposer < TuneMyGcTestCase
14
14
  end
15
15
 
16
16
  def teardown
17
- TuneMyGc.interposer = TuneMyGc::Interposer.new(:ActionController)
17
+ TuneMyGc.interposer = TuneMyGc::Interposer.new([:ActionController])
18
18
  end
19
19
 
20
20
  def test_init
21
- TuneMyGc.interposer = TuneMyGc::Interposer.new(:ActiveJob)
21
+ TuneMyGc.interposer = TuneMyGc::Interposer.new([:ActiveJob])
22
22
  interposer = TuneMyGc.interposer
23
23
  assert !interposer.installed
24
24
  end
25
25
 
26
26
  def test_install_uninstall
27
- TuneMyGc.interposer = TuneMyGc::Interposer.new(:ActiveJob)
27
+ TuneMyGc.interposer = TuneMyGc::Interposer.new([:ActiveJob])
28
28
  interposer = TuneMyGc.interposer
29
29
  interposer.install
30
30
  interposer.on_initialized
@@ -35,7 +35,7 @@ class TestActiveJobInterposer < TuneMyGcTestCase
35
35
  end
36
36
 
37
37
  def test_gc_hooks
38
- TuneMyGc.interposer = TuneMyGc::Interposer.new(:ActiveJob)
38
+ TuneMyGc.interposer = TuneMyGc::Interposer.new([:ActiveJob])
39
39
  interposer = TuneMyGc.interposer
40
40
  interposer.install
41
41
  TuneMyGc.interposer.on_initialized
@@ -58,7 +58,7 @@ class TestActiveJobInterposer < TuneMyGcTestCase
58
58
  end
59
59
 
60
60
  def test_tests_limit
61
- TuneMyGc.interposer = TuneMyGc::Interposer.new(:ActiveJob)
61
+ TuneMyGc.interposer = TuneMyGc::Interposer.new([:ActiveJob])
62
62
  interposer = TuneMyGc.interposer
63
63
  interposer.install
64
64
  TuneMyGc.interposer.on_initialized
data/test/test_agent.rb CHANGED
@@ -12,10 +12,13 @@ class TestAgent < TuneMyGcTestCase
12
12
  end
13
13
 
14
14
  def test_spy
15
- assert_equal 'ActionController', TuneMyGc.spy
15
+ assert_equal ['ActionController'], TuneMyGc.spies
16
16
  ENV['RUBY_GC_SPY'] = "minitest"
17
- assert_equal 'Minitest', TuneMyGc.spy
18
- assert_equal 'minitest', TuneMyGc.spy_id
17
+ assert_equal ['Minitest'], TuneMyGc.spies
18
+ assert_equal 'minitest', TuneMyGc.spy_ids
19
+ ENV['RUBY_GC_SPY'] = "action_controller,active_job"
20
+ assert_equal ['ActionController','ActiveJob'], TuneMyGc.spies
21
+ assert_equal 'action_controller,active_job', TuneMyGc.spy_ids
19
22
  ensure
20
23
  ENV.delete('RUBY_GC_SPY')
21
24
  end
@@ -18,17 +18,17 @@ class TestMinitestInterposer < TuneMyGcTestCase
18
18
  end
19
19
 
20
20
  def teardown
21
- TuneMyGc.interposer = TuneMyGc::Interposer.new(:ActionController)
21
+ TuneMyGc.interposer = TuneMyGc::Interposer.new([:ActionController])
22
22
  end
23
23
 
24
24
  def test_init
25
- TuneMyGc.interposer = TuneMyGc::Interposer.new(:Minitest)
25
+ TuneMyGc.interposer = TuneMyGc::Interposer.new([:Minitest])
26
26
  interposer = TuneMyGc.interposer
27
27
  assert !interposer.installed
28
28
  end
29
29
 
30
30
  def test_install_uninstall
31
- TuneMyGc.interposer = TuneMyGc::Interposer.new(:Minitest)
31
+ TuneMyGc.interposer = TuneMyGc::Interposer.new([:Minitest])
32
32
  interposer = TuneMyGc.interposer
33
33
  interposer.install
34
34
  interposer.on_initialized
@@ -39,7 +39,7 @@ class TestMinitestInterposer < TuneMyGcTestCase
39
39
  end
40
40
 
41
41
  def test_gc_hooks
42
- TuneMyGc.interposer = TuneMyGc::Interposer.new(:Minitest)
42
+ TuneMyGc.interposer = TuneMyGc::Interposer.new([:Minitest])
43
43
  interposer = TuneMyGc.interposer
44
44
  interposer.install
45
45
  TuneMyGc.interposer.on_initialized
@@ -62,7 +62,7 @@ class TestMinitestInterposer < TuneMyGcTestCase
62
62
  end
63
63
 
64
64
  def test_tests_limit
65
- TuneMyGc.interposer = TuneMyGc::Interposer.new(:Minitest)
65
+ TuneMyGc.interposer = TuneMyGc::Interposer.new([:Minitest])
66
66
  interposer = TuneMyGc.interposer
67
67
  interposer.install
68
68
  TuneMyGc.interposer.on_initialized
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tunemygc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.46
4
+ version: 1.0.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bear Metal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-20 00:00:00.000000000 Z
11
+ date: 2015-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -109,7 +109,7 @@ files:
109
109
  - README.md
110
110
  - Rakefile
111
111
  - assets/discourse_bench.png
112
- - assets/tunemygc-graphic2x-80dac1571cacc70d9b272bb62ae9f6df.png
112
+ - assets/tunemygc-graphic2x-b3390590eadab5528577f4e0285330fd.png
113
113
  - bin/tunemygc
114
114
  - doc/protocol.md
115
115
  - ext/tunemygc/extconf.rb