rpm_contrib 1.0.11 → 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/CHANGELOG +5 -0
  2. data/README.md +18 -15
  3. data/Rakefile +1 -1
  4. data/lib/rpm_contrib.rb +30 -21
  5. metadata +13 -6
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ * Version 1.0.12
2
+
3
+ Better support for initialization within a Rails 3 application
4
+ rpm_contrib now depends on newrelic_rpm >= 2.13.1
5
+
1
6
  * Version 1.0.11
2
7
 
3
8
  AWS/S3 instrumentation contributed by Brian Doll
data/README.md CHANGED
@@ -3,16 +3,20 @@
3
3
  The `rpm_contrib` gem contains instrumentation for the New Relic RPM agent
4
4
  contributed by the community of RPM users. It requires the RPM Agent to run.
5
5
 
6
- To use the contrib gem, install the `rpm_contrib` gem from gemcutter. It will
7
- also install the required version of the `newrelic_rpm` gem if it's not already
8
- installed.
6
+ To use the rpm_contrib gem, install the `rpm_contrib` gem from rubygems.org.
7
+ It will also install the required version of the `newrelic_rpm` gem if it's not
8
+ already installed.
9
+
10
+ For Rails 3.0 and later, add this dependency to your Gemfile:
11
+
12
+ gem 'rpm_contrib'
9
13
 
10
14
  For Rails 2.1 and later, add this dependency to your in your environment.rb:
11
15
 
12
16
  config.gem 'rpm_contrib'
13
17
 
14
18
  For other frameworks, make sure you load rubygems if it isn't already, then just
15
- require the contrib gem:
19
+ require the rpm_contrib gem:
16
20
 
17
21
  require 'rubygems'
18
22
  require 'rpm_contrib'
@@ -39,26 +43,25 @@ it by setting `disable_paperclip` to true in the newrelic.yml file.
39
43
 
40
44
  ### MongoDB
41
45
 
42
- The MongoMapper object mapper is the only currently supported mapper for RPM
43
- visibility using this gem. Feel free to add others and let us know.
44
-
45
- No special configuration required. You can disable it by setting
46
- `disable_mongodb` to true in the newrelic.yml file.
46
+ Both MongoMapper and Mongoid are supported. You can disable them both by setting
47
+ 'disable_mongodb' to true in the newrelic.yml file.
47
48
 
48
49
  ### Resque
49
50
 
50
- To disable resque, add this to your newrelic.yml:
51
-
52
- disable_resque: true
51
+ To disable resque, set 'disable_resque' to true in your newrelic.yml file.
53
52
 
54
53
  ### Redis
55
54
 
56
55
  Redis instrumentation will record operations as well as `allWeb` and `allOther`
57
- summary metrics under the `Database/Redis` metric namespace.
56
+ summary metrics under the `Database/Redis` metric namespace. This instrumentation
57
+ supports Redis versions 1.x and 2.x. To disable Redis instrumentation, set
58
+ 'disable_redis' to true in your newrelic.yml file.
58
59
 
59
- To disable Redis instrumentation, add this to your newrelic.yml:
60
+ ### AWS/S3
60
61
 
61
- disable_redis: true
62
+ Get metrics on how S3 is performing for you in production. To disable AWS/S3, set
63
+ 'disable_aws-s3' to true in your newrelic.yml file. For more information on this
64
+ instrumentation, check out [our blog](http://blog.newrelic.com/2010/07/06/monitoring-aws-s3/).
62
65
 
63
66
  # How to Add Custom Instrumentation
64
67
 
data/Rakefile CHANGED
@@ -22,7 +22,7 @@ begin
22
22
  gem.email = "support@newrelic.com"
23
23
  gem.homepage = "http://github.com/newrelic/rpm_contrib"
24
24
  gem.author = "Bill Kayser"
25
- gem.add_dependency 'newrelic_rpm', '>=2.11.1'
25
+ gem.add_dependency 'newrelic_rpm', '>=2.13.1'
26
26
  gem.version = version
27
27
  gem.files = FileList['LICENSE', 'README*', 'lib/**/*.rb', 'bin/*', '[A-Z]*', 'test/**/*'].to_a
28
28
  gem.rdoc_options <<
data/lib/rpm_contrib.rb CHANGED
@@ -1,34 +1,43 @@
1
-
2
1
  RPM_CONTRIB_LIB = File.dirname(__FILE__)
3
2
 
4
3
  module RPMContrib
5
4
  VERSION = File.read(RPM_CONTRIB_LIB+"/../CHANGELOG")[/Version ([\d\.]+)$/, 1]
6
- end
7
5
 
8
- # Perform any framework/dispatcher detection before loading the rpm
9
- # gem.
6
+ def self.init_sequence
7
+ Proc.new do
8
+ # Tell the agent to load all the files in the
9
+ # rpm_contrib/instrumentation directory.
10
+ NewRelic::Agent.add_instrumentation(RPM_CONTRIB_LIB+"/rpm_contrib/instrumentation/**/*.rb")
11
+
12
+ # Load all the Sampler class definitions. These will register
13
+ # automatically with the agent.
14
+ Dir.glob(RPM_CONTRIB_LIB + "/rpm_contrib/samplers/**/*.rb") { |file| require file }
15
+ end
16
+ end
10
17
 
18
+ end
19
+
20
+ # Perform any framework/dispatcher detection before loading the rpm gem.
11
21
  raise "The rpm_contrib gem must be loaded before the newrelic_rpm gem." if defined?(::NewRelic)
12
22
 
13
23
  Dir.glob(RPM_CONTRIB_LIB + "/rpm_contrib/detection/**/*.rb") { |file| require file }
14
24
 
15
25
  require 'newrelic_rpm'
16
26
 
17
- init_sequence = Proc.new do
18
-
19
- # Tell the agent to load all the files in the
20
- # rpm_contrib/instrumentation directory.
21
- NewRelic::Agent.add_instrumentation(RPM_CONTRIB_LIB+"/rpm_contrib/instrumentation/**/*.rb")
22
-
23
- # Load all the Sampler class definitions. These will register
24
- # automatically with the agent.
25
- Dir.glob(RPM_CONTRIB_LIB + "/rpm_contrib/samplers/**/*.rb") { |file| require file }
26
- end
27
-
28
- if defined?(Rails.configuration)
29
- Rails.configuration.after_initialize &init_sequence
27
+ if defined? Rails
28
+ # Rails 3.x+
29
+ if Rails.respond_to?(:version) && Rails.version =~ /^3/
30
+ module NewRelic
31
+ class Railtie < Rails::Railtie
32
+ initializer("rpm_contrib.start_plugin", &RPMContrib.init_sequence)
33
+ end
34
+ end
35
+ # Rails 2.x
36
+ elsif defined?(Rails) && Rails.respond_to?(:configuration)
37
+ Rails.configuration.after_initialize &RPMContrib.init_sequence
38
+ else
39
+ raise "The rpm_contrib gem supports Rails 2.2+ only."
40
+ end
30
41
  else
31
- init_sequence.call
32
- end
33
-
34
-
42
+ RPMContrib.init_sequence.call
43
+ end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpm_contrib
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 15
4
5
  prerelease: false
5
6
  segments:
6
7
  - 1
7
8
  - 0
8
- - 11
9
- version: 1.0.11
9
+ - 12
10
+ version: 1.0.12
10
11
  platform: ruby
11
12
  authors:
12
13
  - Bill Kayser
@@ -14,21 +15,23 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-09-01 00:00:00 -07:00
18
+ date: 2010-09-23 00:00:00 -07:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: newrelic_rpm
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 57
27
30
  segments:
28
31
  - 2
29
- - 11
32
+ - 13
30
33
  - 1
31
- version: 2.11.1
34
+ version: 2.13.1
32
35
  type: :runtime
33
36
  version_requirements: *id001
34
37
  description: |
@@ -81,23 +84,27 @@ rdoc_options:
81
84
  require_paths:
82
85
  - lib
83
86
  required_ruby_version: !ruby/object:Gem::Requirement
87
+ none: false
84
88
  requirements:
85
89
  - - ">="
86
90
  - !ruby/object:Gem::Version
91
+ hash: 3
87
92
  segments:
88
93
  - 0
89
94
  version: "0"
90
95
  required_rubygems_version: !ruby/object:Gem::Requirement
96
+ none: false
91
97
  requirements:
92
98
  - - ">="
93
99
  - !ruby/object:Gem::Version
100
+ hash: 3
94
101
  segments:
95
102
  - 0
96
103
  version: "0"
97
104
  requirements: []
98
105
 
99
106
  rubyforge_project:
100
- rubygems_version: 1.3.6
107
+ rubygems_version: 1.3.7
101
108
  signing_key:
102
109
  specification_version: 3
103
110
  summary: Contributed Instrumentation for New Relic RPM