tunemygc 1.0.32 → 1.0.33

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eada0c05f9039579213cc0929d88d888d73fdfa3
4
- data.tar.gz: 8495c9b0d5c073b4a6b88ca08a50814ca4a4ce3a
3
+ metadata.gz: ef627fde5f3119f99a7b36890a463d112afdc0b2
4
+ data.tar.gz: 199f8ff26b9935caea0cfcb5e1586d8e2a3548e6
5
5
  SHA512:
6
- metadata.gz: b6a688cb885d69388f15894463fe6cb20320c84829aad3ccdb6bb827bd131e45aff560f572e24054be818dfec74a243407262507d308cee7ab323dbfcd9cc3c2
7
- data.tar.gz: 9c7f0614ce486ac84e0dd9218b6c4bd312832a80df2efdd31327f1adfe68c80ac7d3af69cf76f5855f747d255442c031e65dc8f39de8231e6353e7ca0373dcfc
6
+ metadata.gz: bd394d9a8a2f2ed9c182299c8b16315565004b38ced6c58efb9a951b6eb65ef6fa0ebf375258ac42a4849aa29d5a68139c08e26e7ddd82b41d47c48cc1575b0e
7
+ data.tar.gz: f7ef44b0f09ce4cf3bc5fab829d8cd93cb115cd8b73f008d5db47addf878b76e3c98ce716cc32e70fa1b0404095fc35a729717fe0876f4e8d1f2c733ff35dfa8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tunemygc (1.0.31)
4
+ tunemygc (1.0.33)
5
5
  certified (~> 1.0, >= 1.0.0)
6
6
 
7
7
  GEM
@@ -35,6 +35,10 @@ module TuneMyGc
35
35
  logger.info "[TuneMyGC, pid: #{Process.pid}] #{message}"
36
36
  end
37
37
 
38
+ def spy_id
39
+ TuneMyGc::Spies.id
40
+ end
41
+
38
42
  def spy
39
43
  TuneMyGc::Spies.current
40
44
  end
@@ -2,28 +2,28 @@
2
2
 
3
3
  module TuneMyGc
4
4
  module Spies
5
- def self.spy(s)
6
- autoload s, "tunemygc/spies/#{s.to_s.underscore}"
7
- (@spies ||= []) << s.to_s
5
+ def self.spy(s, file)
6
+ autoload s, "tunemygc/spies/#{file}"
7
+ (@spies ||= {})[file] = s.to_s
8
8
  end
9
9
 
10
- spy :Base
11
- spy :ActionController
12
- spy :Minitest
13
- spy :ActiveJob
14
- spy :Manual
15
- spy :Rspec
10
+ spy :Base, 'base'
11
+ spy :ActionController, 'action_controller'
12
+ spy :Minitest, 'minitest'
13
+ spy :ActiveJob, 'active_job'
14
+ spy :Manual, 'manual'
15
+ spy :Rspec, 'rspec'
16
+
17
+ def self.id
18
+ @spies.key(current)
19
+ end
16
20
 
17
21
  def self.current
18
- s = if ENV['RUBY_GC_SPY']
19
- ENV['RUBY_GC_SPY'].classify
22
+ if ENV['RUBY_GC_SPY']
23
+ @spies[ENV['RUBY_GC_SPY']] || raise(NotImplementedError, "TuneMyGC spy #{ENV['RUBY_GC_SPY']} not supported. Valid spies are #{@spies.keys}")
20
24
  else
21
25
  TuneMyGc.rails? ? 'ActionController' : 'Manual'
22
26
  end
23
- unless @spies.include?(s)
24
- raise NotImplementedError, "TuneMyGC spy #{s.underscore.inspect} not supported. Valid spies are #{@spies.map(&:underscore)}"
25
- end
26
- s
27
27
  end
28
28
  end
29
29
  end
@@ -36,7 +36,7 @@ module TuneMyGc
36
36
  end
37
37
 
38
38
  def environment(snapshotter)
39
- ENVIRONMENT.dup.concat([snapshotter.stat_keys, TuneMyGc.spy.underscore, Socket.gethostname, Process.ppid, Process.pid])
39
+ ENVIRONMENT.dup.concat([snapshotter.stat_keys, TuneMyGc.spy_id, Socket.gethostname, Process.ppid, Process.pid])
40
40
  end
41
41
 
42
42
  private
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module TuneMyGc
4
- VERSION = "1.0.32"
4
+ VERSION = "1.0.33"
5
5
  end
data/test/test_agent.rb CHANGED
@@ -15,6 +15,7 @@ class TestAgent < TuneMyGcTestCase
15
15
  assert_equal 'ActionController', TuneMyGc.spy
16
16
  ENV['RUBY_GC_SPY'] = "minitest"
17
17
  assert_equal 'Minitest', TuneMyGc.spy
18
+ assert_equal 'minitest', TuneMyGc.spy_id
18
19
  ensure
19
20
  ENV.delete('RUBY_GC_SPY')
20
21
  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.32
4
+ version: 1.0.33
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-06 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: certified