tunemygc 1.0.14 → 1.0.15

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: 828a308f32ca9d6761f298ab1ad8d21a27704ef7
4
- data.tar.gz: 06c671553355fd93d12f675e1cd1e70099345edd
3
+ metadata.gz: 956696cbbc6fc7680ed613521109232e1c4a79eb
4
+ data.tar.gz: f8acd75f2c48db3ee3699241e5758c0febc6019d
5
5
  SHA512:
6
- metadata.gz: 5eeaedd38f1b6b02d552855de459b5da06b46d6e33f041fb3e9c972871d921c5aad1c4e3659ec3e5666c6dc8986075bca96fde4f60b3bbf8c3829dbd2b980c01
7
- data.tar.gz: 5c22bc01bcb6265560cab7326cfe3de45b95942c44402a476c4118bc078363140fcd721f6ca48439d11be0fcbb4260a596c6eac94951391ff47beb99315699c5
6
+ metadata.gz: 957f5ffaaebb1a0d64cb844d584ab0b1ab55f7ee596e6ea7eb907b4ba987d399aa027cd1183b032c1970ef3324d73a89d98fcea66a904893ffafacf4de4d3bdf
7
+ data.tar.gz: 63a1e0a81af583cd188579d75906ed2c13f41acc51db49bc2f9ffdf207941f1258c86ab5b919ced2a5991482394ad4b6c88d0445cf21878781dddf879bfb22f8
@@ -10,8 +10,8 @@ module TuneMyGc
10
10
 
11
11
  attr_accessor :logger, :interposer, :snapshotter
12
12
 
13
- def snapshot(stage, timestamp = nil, meta = nil)
14
- snapshotter.take(stage, timestamp, meta)
13
+ def snapshot(stage, meta = nil)
14
+ snapshotter.take(stage, meta)
15
15
  end
16
16
 
17
17
  def raw_snapshot(snapshot)
@@ -23,11 +23,7 @@ module TuneMyGc
23
23
  end
24
24
 
25
25
  def spy
26
- if ENV['RUBY_GC_SPY']
27
- ENV['RUBY_GC_SPY'].classify
28
- else
29
- 'ActionController'
30
- end
26
+ TuneMyGc::Spies.current
31
27
  end
32
28
 
33
29
  def reccommendations
@@ -18,8 +18,8 @@ module TuneMyGc
18
18
  @stat_keys = GC.stat.keys
19
19
  end
20
20
 
21
- def take(stage, timestamp = nil, meta = nil)
22
- _buffer([(timestamp || TuneMyGc.walltime), TuneMyGc.peak_rss, TuneMyGc.current_rss, stage, GC.stat.values_at(*stat_keys), GC.latest_gc_info, meta])
21
+ def take(stage, meta = nil)
22
+ _buffer([TuneMyGc.walltime, TuneMyGc.peak_rss, TuneMyGc.current_rss, stage, GC.stat.values_at(*stat_keys), GC.latest_gc_info, meta])
23
23
  end
24
24
 
25
25
  # low level interface, for tests and GC callback
@@ -2,8 +2,25 @@
2
2
 
3
3
  module TuneMyGc
4
4
  module Spies
5
- autoload :ActionController, 'tunemygc/spies/action_controller'
6
- autoload :Minitest, 'tunemygc/spies/minitest'
7
- autoload :ActiveJob, 'tunemygc/spies/active_job'
5
+ def self.spy(s)
6
+ autoload s, "tunemygc/spies/#{s.to_s.underscore}"
7
+ (@spies ||= []) << s.to_s
8
+ end
9
+
10
+ spy :ActionController
11
+ spy :Minitest
12
+ spy :ActiveJob
13
+
14
+ def self.current
15
+ s = if ENV['RUBY_GC_SPY']
16
+ ENV['RUBY_GC_SPY'].classify
17
+ else
18
+ 'ActionController'
19
+ end
20
+ unless @spies.include?(s)
21
+ raise NotImplementedError, "TuneMyGC spy #{s.underscore.inspect} not supported. Valid spies are #{@spies.map(&:underscore)}"
22
+ end
23
+ s
24
+ end
8
25
  end
9
26
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module TuneMyGc
4
- VERSION = "1.0.14"
4
+ VERSION = "1.0.15"
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.14
4
+ version: 1.0.15
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-12 00:00:00.000000000 Z
11
+ date: 2015-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport