rpm_contrib 2.1.10 → 2.1.11
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/README.md +0 -8
- metadata +64 -41
- data/lib/rpm_contrib/instrumentation/resque.rb +0 -71
- data/test/test_resque.rb +0 -74
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -156,14 +156,6 @@ Our instrumentation works on the underlying 'Mongo' library.
|
|
156
156
|
|
157
157
|
You can disable it by setting 'disable_mongodb' to true in your newrelic.yml file.
|
158
158
|
|
159
|
-
### Resque
|
160
|
-
|
161
|
-
To instrument jobs you no longer need to have your Job class inherit from Resque::Job or include
|
162
|
-
the Resque::Plugins::NewRelicInstrumentation module. The module definition was left in for
|
163
|
-
backward compatibility.
|
164
|
-
|
165
|
-
To disable resque, set 'disable_resque' to true in your newrelic.yml file.
|
166
|
-
|
167
159
|
### Redis
|
168
160
|
|
169
161
|
Redis instrumentation has been removed from rpm_contrib.
|
metadata
CHANGED
@@ -1,53 +1,69 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpm_contrib
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 2
|
8
|
+
- 1
|
9
|
+
- 11
|
10
|
+
version: 2.1.11
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Bill Kayser
|
9
14
|
- Jon Guymon
|
10
15
|
autorequire:
|
11
16
|
bindir: bin
|
12
17
|
cert_chain: []
|
13
|
-
|
14
|
-
|
15
|
-
|
18
|
+
|
19
|
+
date: 2012-05-25 00:00:00 Z
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
16
22
|
name: newrelic_rpm
|
17
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
18
25
|
none: false
|
19
|
-
requirements:
|
20
|
-
- -
|
21
|
-
- !ruby/object:Gem::Version
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 1
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 1
|
33
|
+
- 1
|
22
34
|
version: 3.1.1
|
23
35
|
type: :runtime
|
24
|
-
|
25
|
-
|
26
|
-
- !ruby/object:Gem::Dependency
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
27
38
|
name: newrelic_rpm
|
28
|
-
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
29
41
|
none: false
|
30
|
-
requirements:
|
31
|
-
- -
|
32
|
-
- !ruby/object:Gem::Version
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 1
|
46
|
+
segments:
|
47
|
+
- 3
|
48
|
+
- 1
|
49
|
+
- 1
|
33
50
|
version: 3.1.1
|
34
51
|
type: :runtime
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
on
|
39
|
-
|
52
|
+
version_requirements: *id002
|
53
|
+
description: |
|
54
|
+
Community contributed instrumentation for various frameworks based on
|
40
55
|
the New Relic Ruby monitoring gem newrelic_rpm.
|
41
56
|
|
42
|
-
'
|
43
57
|
email: support@newrelic.com
|
44
58
|
executables: []
|
59
|
+
|
45
60
|
extensions: []
|
46
|
-
|
61
|
+
|
62
|
+
extra_rdoc_files:
|
47
63
|
- CHANGELOG
|
48
64
|
- LICENSE
|
49
65
|
- README.md
|
50
|
-
files:
|
66
|
+
files:
|
51
67
|
- CHANGELOG
|
52
68
|
- Gemfile
|
53
69
|
- LICENSE
|
@@ -71,7 +87,6 @@ files:
|
|
71
87
|
- lib/rpm_contrib/instrumentation/mongoid.rb
|
72
88
|
- lib/rpm_contrib/instrumentation/paperclip.rb
|
73
89
|
- lib/rpm_contrib/instrumentation/picky.rb
|
74
|
-
- lib/rpm_contrib/instrumentation/resque.rb
|
75
90
|
- lib/rpm_contrib/instrumentation/sinatra.rb
|
76
91
|
- lib/rpm_contrib/instrumentation/thinking_sphinx.rb
|
77
92
|
- lib/rpm_contrib/instrumentation/typhoeus.rb
|
@@ -83,35 +98,43 @@ files:
|
|
83
98
|
- test/schema.rb
|
84
99
|
- test/test_curb.rb
|
85
100
|
- test/test_picky.rb
|
86
|
-
- test/test_resque.rb
|
87
101
|
homepage: http://github.com/newrelic/rpm_contrib
|
88
102
|
licenses: []
|
103
|
+
|
89
104
|
post_install_message:
|
90
|
-
rdoc_options:
|
105
|
+
rdoc_options:
|
91
106
|
- --line-numbers
|
92
107
|
- --inline-source
|
93
108
|
- --title
|
94
109
|
- Contributed Instrumentation for New Relic RPM
|
95
110
|
- -m
|
96
111
|
- README.md
|
97
|
-
require_paths:
|
112
|
+
require_paths:
|
98
113
|
- lib
|
99
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
100
115
|
none: false
|
101
|
-
requirements:
|
102
|
-
- -
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
|
105
|
-
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
version: "0"
|
123
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
124
|
none: false
|
107
|
-
requirements:
|
108
|
-
- -
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
hash: 3
|
129
|
+
segments:
|
130
|
+
- 0
|
131
|
+
version: "0"
|
111
132
|
requirements: []
|
133
|
+
|
112
134
|
rubyforge_project:
|
113
|
-
rubygems_version: 1.8.
|
135
|
+
rubygems_version: 1.8.24
|
114
136
|
signing_key:
|
115
137
|
specification_version: 3
|
116
138
|
summary: Contributed Instrumentation for New Relic RPM
|
117
139
|
test_files: []
|
140
|
+
|
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'rpm_contrib/language_support'
|
2
|
-
|
3
|
-
# call this now so it is memoized before potentially forking worker processes
|
4
|
-
RPMContrib::LanguageSupport.can_fork?
|
5
|
-
|
6
|
-
module Resque
|
7
|
-
module Plugins
|
8
|
-
module NewRelicInstrumentation
|
9
|
-
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
|
10
|
-
|
11
|
-
def around_perform_with_monitoring(*args)
|
12
|
-
begin
|
13
|
-
perform_action_with_newrelic_trace(:name => 'perform',
|
14
|
-
:class_name => self.name,
|
15
|
-
:category => 'OtherTransaction/ResqueJob') do
|
16
|
-
yield(*args)
|
17
|
-
end
|
18
|
-
ensure
|
19
|
-
NewRelic::Agent.shutdown if RPMContrib::LanguageSupport.can_fork?
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
module RPMContrib
|
27
|
-
module Instrumentation
|
28
|
-
module ResqueInstrumentationInstaller
|
29
|
-
def payload_class
|
30
|
-
klass = super
|
31
|
-
klass.instance_eval do
|
32
|
-
extend ::Resque::Plugins::NewRelicInstrumentation
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
DependencyDetection.defer do
|
40
|
-
@name = :resque
|
41
|
-
|
42
|
-
depends_on do
|
43
|
-
defined?(::Resque::Job) and not NewRelic::Control.instance['disable_resque']
|
44
|
-
end
|
45
|
-
|
46
|
-
executes do
|
47
|
-
NewRelic::Agent.logger.debug 'Installing Resque instrumentation'
|
48
|
-
end
|
49
|
-
|
50
|
-
executes do
|
51
|
-
# == Resque Instrumentation
|
52
|
-
#
|
53
|
-
# Installs a hook to ensure the agent starts manually when the worker
|
54
|
-
# starts and also adds the tracer to the process method which executes
|
55
|
-
# in the forked task.
|
56
|
-
::Resque::Job.class_eval do
|
57
|
-
def self.new(*args)
|
58
|
-
super(*args).extend RPMContrib::Instrumentation::ResqueInstrumentationInstaller
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
::Resque.before_first_fork do
|
63
|
-
NewRelic::Agent.manual_start(:dispatcher => :resque,
|
64
|
-
:sync_startup => true)
|
65
|
-
end
|
66
|
-
|
67
|
-
::Resque.after_fork do
|
68
|
-
NewRelic::Agent.after_fork(:force_reconnect => false)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
data/test/test_resque.rb
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
require 'resque'
|
2
|
-
require 'mocha'
|
3
|
-
require File.expand_path(File.dirname(__FILE__) + "/helper")
|
4
|
-
require File.expand_path(File.dirname(__FILE__) + "/../lib/rpm_contrib")
|
5
|
-
|
6
|
-
class ResqueTest < Test::Unit::TestCase
|
7
|
-
class ExtendoJorb < ::Resque::Job
|
8
|
-
def self.perform
|
9
|
-
true
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
class GoodJorb
|
14
|
-
def self.perform
|
15
|
-
true
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
class BadJorb
|
20
|
-
def self.perform
|
21
|
-
raise "I'm doing a bad jorb"
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def setup
|
26
|
-
@worker = Resque::Worker.new(:test)
|
27
|
-
NewRelic::Agent.manual_start
|
28
|
-
@engine = NewRelic::Agent.instance.stats_engine
|
29
|
-
end
|
30
|
-
|
31
|
-
def teardown
|
32
|
-
@engine.clear_stats
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_should_instrument_job_extending_from_resque_job
|
36
|
-
@worker.perform(Resque::Job.new(:test,
|
37
|
-
'class' => 'ResqueTest::ExtendoJorb'))
|
38
|
-
|
39
|
-
metrics = [ 'OtherTransaction/all', 'OtherTransaction/ResqueJob/all',
|
40
|
-
'OtherTransaction/ResqueJob/ResqueTest::ExtendoJorb/perform' ]
|
41
|
-
metrics.each do |metric|
|
42
|
-
assert(@engine.metrics.include?(metric),
|
43
|
-
"#{@engine.metrics.inspect} missing #{metric}")
|
44
|
-
end
|
45
|
-
assert !@engine.metrics.include?('Errors/all')
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_should_instrument_poro_job
|
49
|
-
@worker.perform(Resque::Job.new(:test, 'class' => 'ResqueTest::GoodJorb'))
|
50
|
-
|
51
|
-
metrics = [ 'OtherTransaction/all', 'OtherTransaction/ResqueJob/all',
|
52
|
-
'OtherTransaction/ResqueJob/ResqueTest::GoodJorb/perform' ]
|
53
|
-
metrics.each do |metric|
|
54
|
-
assert(@engine.metrics.include?(metric),
|
55
|
-
"#{@engine.metrics.inspect} missing #{metric}")
|
56
|
-
end
|
57
|
-
assert !@engine.metrics.include?('Errors/all')
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_should_collect_job_errors
|
61
|
-
begin
|
62
|
-
@worker.perform(Resque::Job.new(:test, 'class' => 'ResqueTest::BadJorb'))
|
63
|
-
rescue
|
64
|
-
end
|
65
|
-
|
66
|
-
metrics = [ 'OtherTransaction/all', 'OtherTransaction/ResqueJob/all',
|
67
|
-
'OtherTransaction/ResqueJob/ResqueTest::BadJorb/perform',
|
68
|
-
'Errors/all' ]
|
69
|
-
metrics.each do |metric|
|
70
|
-
assert(@engine.metrics.include?(metric),
|
71
|
-
"#{@engine.metrics.inspect} missing #{metric}")
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|