tunemygc 1.0.37 → 1.0.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/tunemygc/spies.rb +2 -1
- data/lib/tunemygc/spies/que_job.rb +58 -0
- data/lib/tunemygc/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9074b8798ec2152f0cc0118978874cc7a7633741
|
4
|
+
data.tar.gz: d5bfe7dc5d64d750043ea3e746db62ada122f4ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d0ac6b6322fc33c5ff000fee1111411c4035c190224d162e47cfc42ad672073b033350a7dcf6d93d4ee69ceb1dfe8a4b10c805c51ed50a7a1c92fa5492dbc8f
|
7
|
+
data.tar.gz: 2143807442db9579cea527ff150ae81d0ea6460a365ef26d2dc962815137e4c8f40d2435fac8a58e2ef4cdd14cc4f044e2362b143767ccb3ec5a91ccfe6b4967
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -108,9 +108,9 @@ And after some profiling requests, when the process terminates, you can visit th
|
|
108
108
|
|
109
109
|
#### Advanced
|
110
110
|
|
111
|
-
* `RUBY_GC_SPY=action_controller` (Spy on the GC for this type of processing. `action_controller`, `active_job`, `minitest` or `rspec` are supported)
|
111
|
+
* `RUBY_GC_SPY=action_controller` (Spy on the GC for this type of processing. `action_controller`, `active_job`, `que_job`, `minitest` or `rspec` are supported)
|
112
112
|
|
113
|
-
Defines what type of processing you would like to sample for GC activity. An Action Controller spy is the default, but [ActiveJob](https://github.com/rails/rails/tree/master/activejob), [minitest](https://github.com/seattlerb/minitest) and [rspec](http://rspec.info) are also supported as experimental features.
|
113
|
+
Defines what type of processing you would like to sample for GC activity. An Action Controller spy is the default, but [ActiveJob](https://github.com/rails/rails/tree/master/activejob), [que](https://github.com/chanks/que), [minitest](https://github.com/seattlerb/minitest) and [rspec](http://rspec.info) are also supported as experimental features.
|
114
114
|
|
115
115
|
## How do I use this?
|
116
116
|
|
data/lib/tunemygc/spies.rb
CHANGED
@@ -0,0 +1,58 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'que'
|
4
|
+
|
5
|
+
module TuneMyGc
|
6
|
+
module Spies
|
7
|
+
class QueJob < TuneMyGc::Spies::Base
|
8
|
+
def install
|
9
|
+
::Que::Job.__send__(:include, TuneMyGc::Spies::QueJob::Hooks)
|
10
|
+
TuneMyGc.log "hooked: que_job"
|
11
|
+
end
|
12
|
+
|
13
|
+
def uninstall
|
14
|
+
TuneMyGc.uninstall_gc_tracepoint
|
15
|
+
TuneMyGc.log "uninstalled GC tracepoint"
|
16
|
+
::Que::Job.__send__(:include, TuneMyGc::Spies::QueJob::DisabledHooks)
|
17
|
+
TuneMyGc.log "uninstalled que_job spy"
|
18
|
+
end
|
19
|
+
|
20
|
+
module Hooks
|
21
|
+
def run(*args)
|
22
|
+
self.class.tunemygc_before_run
|
23
|
+
super
|
24
|
+
ensure
|
25
|
+
self.class.tunemygc_after_run
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.included(klass)
|
29
|
+
klass.extend(TuneMyGc::Spies::QueJob::Hooks::ClassMethods)
|
30
|
+
end
|
31
|
+
|
32
|
+
module ClassMethods
|
33
|
+
def tunemygc_before_run
|
34
|
+
TuneMyGc.processing_started
|
35
|
+
end
|
36
|
+
|
37
|
+
def tunemygc_after_run
|
38
|
+
TuneMyGc.processing_ended
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
module DisabledHooks
|
44
|
+
def self.included(klass)
|
45
|
+
klass.extend(TuneMyGc::Spies::QueJob::DisabledHooks::ClassMethods)
|
46
|
+
end
|
47
|
+
|
48
|
+
module ClassMethods
|
49
|
+
def tunemygc_before_run
|
50
|
+
end
|
51
|
+
|
52
|
+
def tunemygc_after_run
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
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.38
|
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-
|
11
|
+
date: 2015-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- lib/tunemygc/spies/base.rb
|
130
130
|
- lib/tunemygc/spies/manual.rb
|
131
131
|
- lib/tunemygc/spies/minitest.rb
|
132
|
+
- lib/tunemygc/spies/que_job.rb
|
132
133
|
- lib/tunemygc/spies/rspec.rb
|
133
134
|
- lib/tunemygc/subscriber.rb
|
134
135
|
- lib/tunemygc/syncer.rb
|