tunemygc 1.0.16 → 1.0.17

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: 54010f30fc1f18626f5d42e18190768b0352f8ec
4
- data.tar.gz: 8d6a9176c43526c8752e667c0e9807c9747ba885
3
+ metadata.gz: edab5ea70a5d450b7947bd53af538d7a125bcf26
4
+ data.tar.gz: 5153bc0167c5758d290995c39de56702d91e6617
5
5
  SHA512:
6
- metadata.gz: 0eba3e2f068c242d955688d75dc20a106dd657dd592fb7f0b3015a7e6aa937df2c4403c37656e5422b3de8dec83a1ed60b06290f47f8fa08671c664098670738
7
- data.tar.gz: 5f663fe615c300acaa3225cdb7ede0b83e049a04fd56867ee3e8158805906a5dce40b1cb5fd635dc5636845b6b05ec513091d9b3178d5c8cca75651c76638106
6
+ metadata.gz: 87096291b0dd67012742a0be010d8d60d487e0cc201004709cc60ed9a77311fec247930837d70b0afbe38250489c9a9743e83172612ebca7128183caf74674db
7
+ data.tar.gz: 665c300107d8a324a1b161f22ba75fec80fbc642095d75dc7ac2e7554355cbc39a91ce94209fa139b5885541d0e115d3985a61e2c4a52f4eed4acd7a275c61a4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tunemygc (1.0.12)
4
+ tunemygc (1.0.16)
5
5
  activesupport (~> 4.1)
6
6
  certified (~> 1.0, >= 1.0.0)
7
7
 
data/lib/tunemygc.rb CHANGED
@@ -9,8 +9,12 @@ module TuneMyGc
9
9
  "User-Agent" => "TuneMyGC #{TuneMyGc::VERSION}"}.freeze
10
10
  end
11
11
 
12
- if ENV["RUBY_GC_TUNE"] && defined?(Rails) && Rails.version >= "4.0"
13
- require 'tunemygc/railtie'
12
+ if ENV["RUBY_GC_TUNE"]
13
+ if defined?(Rails) && Rails.version >= "4.0"
14
+ require 'tunemygc/railtie'
15
+ else
16
+ require 'tunemygc/agent'
17
+ end
14
18
  else
15
19
  puts "[TuneMyGC] not enabled"
16
20
  end
@@ -10,6 +10,20 @@ module TuneMyGc
10
10
 
11
11
  attr_accessor :logger, :interposer, :snapshotter
12
12
 
13
+ # snapshot stages
14
+ def booted
15
+ snapshot(:BOOTED)
16
+ end
17
+
18
+ def processing_started
19
+ snapshot(:PROCESSING_STARTED)
20
+ end
21
+
22
+ def processing_ended
23
+ snapshot(:PROCESSING_ENDED)
24
+ interposer.check_uninstall
25
+ end
26
+
13
27
  def snapshot(stage, meta = nil)
14
28
  snapshotter.take(stage, meta)
15
29
  end
@@ -48,6 +48,8 @@ module TuneMyGc
48
48
  end
49
49
 
50
50
  def uninstall
51
+ TuneMyGc.uninstall_gc_tracepoint
52
+ TuneMyGc.log "uninstalled GC tracepoint"
51
53
  @spy.uninstall
52
54
  reset
53
55
  end
@@ -10,6 +10,7 @@ module TuneMyGc
10
10
  spy :ActionController
11
11
  spy :Minitest
12
12
  spy :ActiveJob
13
+ spy :Manual
13
14
 
14
15
  def self.current
15
16
  s = if ENV['RUBY_GC_SPY']
@@ -5,14 +5,13 @@ require 'tunemygc/subscriber'
5
5
  module TuneMyGc
6
6
  class StartRequestSubscriber < Subscriber
7
7
  def start(name, id, payload)
8
- TuneMyGc.snapshot(:PROCESSING_STARTED)
8
+ TuneMyGc.processing_started
9
9
  end
10
10
  end
11
11
 
12
12
  class EndRequestSubscriber < Subscriber
13
13
  def finish(name, id, payload)
14
- TuneMyGc.snapshot(:PROCESSING_ENDED)
15
- TuneMyGc.interposer.check_uninstall
14
+ TuneMyGc.processing_ended
16
15
  end
17
16
  end
18
17
  end
@@ -46,12 +46,11 @@ module TuneMyGc
46
46
  end
47
47
 
48
48
  def tunemygc_before_perform
49
- TuneMyGc.snapshot(:PROCESSING_STARTED)
49
+ TuneMyGc.processing_started
50
50
  end
51
51
 
52
52
  def tunemygc_after_perform
53
- TuneMyGc.snapshot(:PROCESSING_ENDED)
54
- TuneMyGc.interposer.check_uninstall
53
+ TuneMyGc.processing_ended
55
54
  end
56
55
  end
57
56
  end
@@ -0,0 +1,18 @@
1
+ # encoding: utf-8
2
+
3
+ module TuneMyGc
4
+ module Spies
5
+ class Manual
6
+ def install
7
+ TuneMyGc.log "hooked: manual"
8
+ end
9
+
10
+ def uninstall
11
+ TuneMyGc.log "uninstalled manual spy"
12
+ end
13
+
14
+ def check_uninstall
15
+ end
16
+ end
17
+ end
18
+ end
@@ -47,12 +47,11 @@ module TuneMyGc
47
47
 
48
48
  private
49
49
  def tunemygc_before_setup
50
- TuneMyGc.snapshot(:PROCESSING_STARTED)
50
+ TuneMyGc.processing_started
51
51
  end
52
52
 
53
53
  def tunemygc_after_teardown
54
- TuneMyGc.snapshot(:PROCESSING_ENDED)
55
- TuneMyGc.interposer.check_uninstall
54
+ TuneMyGc.processing_ended
56
55
  end
57
56
  end
58
57
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module TuneMyGc
4
- VERSION = "1.0.16"
4
+ VERSION = "1.0.17"
5
5
  end
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.16
4
+ version: 1.0.17
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-02-17 00:00:00.000000000 Z
11
+ date: 2015-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -146,6 +146,7 @@ files:
146
146
  - lib/tunemygc/spies.rb
147
147
  - lib/tunemygc/spies/action_controller.rb
148
148
  - lib/tunemygc/spies/active_job.rb
149
+ - lib/tunemygc/spies/manual.rb
149
150
  - lib/tunemygc/spies/minitest.rb
150
151
  - lib/tunemygc/subscriber.rb
151
152
  - lib/tunemygc/syncer.rb