tunemygc 1.0.14 → 1.0.15
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 +4 -4
 - data/lib/tunemygc/agent.rb +3 -7
 - data/lib/tunemygc/snapshotter.rb +2 -2
 - data/lib/tunemygc/spies.rb +20 -3
 - data/lib/tunemygc/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 956696cbbc6fc7680ed613521109232e1c4a79eb
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f8acd75f2c48db3ee3699241e5758c0febc6019d
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 957f5ffaaebb1a0d64cb844d584ab0b1ab55f7ee596e6ea7eb907b4ba987d399aa027cd1183b032c1970ef3324d73a89d98fcea66a904893ffafacf4de4d3bdf
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 63a1e0a81af583cd188579d75906ed2c13f41acc51db49bc2f9ffdf207941f1258c86ab5b919ced2a5991482394ad4b6c88d0445cf21878781dddf879bfb22f8
         
     | 
    
        data/lib/tunemygc/agent.rb
    CHANGED
    
    | 
         @@ -10,8 +10,8 @@ module TuneMyGc 
     | 
|
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
              attr_accessor :logger, :interposer, :snapshotter
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
              def snapshot(stage,  
     | 
| 
       14 
     | 
    
         
            -
                snapshotter.take(stage,  
     | 
| 
      
 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 
     | 
    
         
            -
                 
     | 
| 
       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
         
     | 
    
        data/lib/tunemygc/snapshotter.rb
    CHANGED
    
    | 
         @@ -18,8 +18,8 @@ module TuneMyGc 
     | 
|
| 
       18 
18 
     | 
    
         
             
                  @stat_keys = GC.stat.keys
         
     | 
| 
       19 
19 
     | 
    
         
             
                end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
                def take(stage,  
     | 
| 
       22 
     | 
    
         
            -
                  _buffer([ 
     | 
| 
      
 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
         
     | 
    
        data/lib/tunemygc/spies.rb
    CHANGED
    
    | 
         @@ -2,8 +2,25 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module TuneMyGc
         
     | 
| 
       4 
4 
     | 
    
         
             
              module Spies
         
     | 
| 
       5 
     | 
    
         
            -
                 
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
      
 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
         
     | 
    
        data/lib/tunemygc/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-02-13 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: activesupport
         
     |