rpm_contrib 2.1.4 → 2.1.5.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/README.md +17 -7
- data/lib/rpm_contrib/detection.rb +3 -5
- data/lib/rpm_contrib/instrumentation/resque.rb +1 -1
- data/lib/rpm_contrib/instrumentation/ultrasphinx.rb +1 -1
- data/lib/rpm_contrib/instrumentation/yajl.rb +17 -2
- data/lib/rpm_contrib.rb +0 -5
- data/test/test_curb.rb +5 -2
- metadata +12 -10
- data/lib/rpm_contrib/detection/resque.rb +0 -15
data/CHANGELOG
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
* Version 2.1.5.beta
|
2
|
+
|
3
|
+
Changed the resque detection so it does not depend on the load
|
4
|
+
order of resque => rpm_contrib => newrelic_rpm. The gems can be
|
5
|
+
installed in any order.
|
6
|
+
|
1
7
|
* Version 2.1.4
|
2
8
|
|
3
9
|
Updated requirements to latest agent with some bug fixes for background jobs
|
data/README.md
CHANGED
@@ -12,10 +12,6 @@ For Rails 3.0 and when using Bundler, add these dependencies to your Gemfile:
|
|
12
12
|
gem 'rpm_contrib'
|
13
13
|
gem 'newrelic_rpm'
|
14
14
|
|
15
|
-
For some frameworks, it's important that the contrib gem is loaded
|
16
|
-
before the newrelic_rpm gem. We hope to remove that unfortunate
|
17
|
-
requirement in the future.
|
18
|
-
|
19
15
|
For Rails 2.1 and later, add these dependencies to your in your environment.rb:
|
20
16
|
|
21
17
|
config.gem 'rpm_contrib'
|
@@ -36,7 +32,18 @@ after all other frameworks have loaded:
|
|
36
32
|
|
37
33
|
DependencyDetection.detect!
|
38
34
|
|
39
|
-
|
35
|
+
### Troubleshooting Startup
|
36
|
+
|
37
|
+
If you've set up your gems to load as described above and you are still not seeing
|
38
|
+
data in RPM, there may be a bug in detecting your framework. Try setting the
|
39
|
+
environment variable `NEWRELIC_DISPATCHER` to the name of your app server (Camping,
|
40
|
+
Resque, Rake, etc), and please report to us if this fixes the problem so we can
|
41
|
+
fix the auto-detection logic.
|
42
|
+
|
43
|
+
If this does not help then set the `log_level` to `debug` in the `newrelic.yml` file
|
44
|
+
and examine the `newrelic_agent.log` file for errors after restarting your app.
|
45
|
+
|
46
|
+
## Supported Frameworks
|
40
47
|
|
41
48
|
A number of frameworks are supported in the contrib gem. They are all turned on
|
42
49
|
by default but you can add settings to your newrelic.yml to disable any of them.
|
@@ -56,8 +63,11 @@ You can disable it with `disable_cassandra_instrumentation` in your newrelic.yml
|
|
56
63
|
### Camping
|
57
64
|
|
58
65
|
The gem will detect a Camping app but you need to manually add the
|
59
|
-
instrumentation to your configuration file. See
|
60
|
-
for more information.
|
66
|
+
instrumentation to your configuration file. See
|
67
|
+
RPMContrib::Instrumentation::Camping for more information.
|
68
|
+
|
69
|
+
In addition you will need to load the gems in the following order: 1) Camping, 2) rpm_contrib,
|
70
|
+
3) newrelic_rpm.
|
61
71
|
|
62
72
|
### Crack
|
63
73
|
|
@@ -1,7 +1,5 @@
|
|
1
|
+
# Currently the only framework we are detecting with an agent
|
2
|
+
# patch is camping. You need to specify the camping gem prior
|
3
|
+
# to the contrib gem and newrelic agent gem in order for this to work.
|
1
4
|
require 'rpm_contrib/detection/camping'
|
2
|
-
require 'rpm_contrib/detection/resque'
|
3
5
|
|
4
|
-
module RpmContrib
|
5
|
-
module Detection
|
6
|
-
end
|
7
|
-
end
|
@@ -1,13 +1,28 @@
|
|
1
1
|
DependencyDetection.defer do
|
2
2
|
depends_on do
|
3
|
-
defined?(::Yajl::
|
3
|
+
defined?(::Yajl::Parser) && !NewRelic::Control.instance['disable_yajl_instrumentation']
|
4
|
+
end
|
5
|
+
|
6
|
+
executes do
|
7
|
+
::Yajl::Parser.class_eval do
|
8
|
+
class << self
|
9
|
+
include ::NewRelic::Agent::MethodTracer
|
10
|
+
add_method_tracer :parse, 'Parser/Yajl/parse'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
DependencyDetection.defer do
|
17
|
+
depends_on do
|
18
|
+
defined?(::Yajl::Encoder) && !NewRelic::Control.instance['disable_yajl_instrumentation']
|
4
19
|
end
|
5
20
|
|
6
21
|
executes do
|
7
22
|
::Yajl::Encoder.class_eval do
|
8
23
|
class << self
|
9
24
|
include ::NewRelic::Agent::MethodTracer
|
10
|
-
add_method_tracer :
|
25
|
+
add_method_tracer :encode, 'Encoder/Yajl/encode'
|
11
26
|
end
|
12
27
|
end
|
13
28
|
end
|
data/lib/rpm_contrib.rb
CHANGED
@@ -2,11 +2,7 @@ RPM_CONTRIB_LIB = File.dirname(__FILE__)
|
|
2
2
|
|
3
3
|
module RPMContrib; end
|
4
4
|
|
5
|
-
# Perform any framework/dispatcher detection before loading the rpm gem.
|
6
5
|
require 'rpm_contrib/detection'
|
7
|
-
if defined?(::NewRelic) && defined?(::NewRelic::Control)
|
8
|
-
puts "Warning! The rpm_contrib gem should be loaded before the newrelic_rpm gem if you are using Resque or Camping."
|
9
|
-
end
|
10
6
|
|
11
7
|
require 'newrelic_rpm'
|
12
8
|
require 'rpm_contrib/instrumentation'
|
@@ -25,7 +21,6 @@ if defined? Rails
|
|
25
21
|
end
|
26
22
|
# Rails 2.x
|
27
23
|
elsif defined?(Rails) && Rails.respond_to?(:configuration)
|
28
|
-
|
29
24
|
Rails.configuration.after_initialize { NewRelic::Control.instance.init_plugin }
|
30
25
|
else
|
31
26
|
raise "The rpm_contrib gem supports Rails 2.2+ only."
|
data/test/test_curb.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
require "#{File.dirname(__FILE__)}/helper"
|
2
|
-
|
2
|
+
begin
|
3
|
+
require 'curb'
|
4
|
+
rescue LoadError
|
5
|
+
end
|
3
6
|
|
4
7
|
class NewRelic::Agent::NetInstrumentationTest < Test::Unit::TestCase
|
5
8
|
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
|
@@ -63,4 +66,4 @@ class NewRelic::Agent::NetInstrumentationTest < Test::Unit::TestCase
|
|
63
66
|
assert_equal 0, @engine.metrics.size
|
64
67
|
end
|
65
68
|
|
66
|
-
end
|
69
|
+
end if defined? ::Curl::Easy
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpm_contrib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 31098237
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
|
9
|
+
- 5
|
10
|
+
- beta
|
11
|
+
version: 2.1.5.beta
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Bill Kayser
|
@@ -15,7 +16,7 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2011-08
|
19
|
+
date: 2011-09-08 00:00:00 -07:00
|
19
20
|
default_executable:
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
@@ -56,7 +57,6 @@ files:
|
|
56
57
|
- lib/rpm_contrib.rb
|
57
58
|
- lib/rpm_contrib/detection.rb
|
58
59
|
- lib/rpm_contrib/detection/camping.rb
|
59
|
-
- lib/rpm_contrib/detection/resque.rb
|
60
60
|
- lib/rpm_contrib/instrumentation.rb
|
61
61
|
- lib/rpm_contrib/instrumentation/active_mq.rb
|
62
62
|
- lib/rpm_contrib/instrumentation/aws.rb
|
@@ -106,12 +106,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
108
108
|
requirements:
|
109
|
-
- - "
|
109
|
+
- - ">"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
hash:
|
111
|
+
hash: 25
|
112
112
|
segments:
|
113
|
-
-
|
114
|
-
|
113
|
+
- 1
|
114
|
+
- 3
|
115
|
+
- 1
|
116
|
+
version: 1.3.1
|
115
117
|
requirements: []
|
116
118
|
|
117
119
|
rubyforge_project:
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# Detect when running under camping and set the framework and dispatcher.
|
2
|
-
|
3
|
-
module NewRelic
|
4
|
-
class LocalEnvironment
|
5
|
-
module Resque
|
6
|
-
def discover_dispatcher
|
7
|
-
super
|
8
|
-
if defined?(::Resque::Worker) && @dispatcher.nil?
|
9
|
-
@dispatcher = 'resque'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|