newrelic-middleware 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  Use this middleware to see how long your app is spending in middleware.
4
4
 
5
- It does not track per middleware.
6
-
7
5
  ## Installation
8
6
 
9
7
  Add this line to your application's Gemfile:
@@ -1,7 +1,30 @@
1
+ require 'newrelic_rpm'
2
+ require 'new_relic/agent/method_tracer'
3
+
1
4
  module NewRelicMiddleware
2
5
  class Engine < ::Rails::Engine
3
6
  initializer "newrelic.middleware-tracking" do |app|
4
7
  app.config.middleware.insert 0, TrackingSupport
5
8
  end
9
+
10
+ config.after_initialize do |app|
11
+ app.config.middleware.each do |m|
12
+ klass = m.klass
13
+
14
+ if klass.respond_to? :call
15
+ klass.class_eval do
16
+ extend NewRelic::Agent::MethodTracer
17
+
18
+ add_method_tracer :call, "Middleware/#{klass}"
19
+ end
20
+ else
21
+ klass.class_eval do
22
+ include NewRelic::Agent::MethodTracer
23
+
24
+ add_method_tracer :call, "Middleware/#{klass}"
25
+ end
26
+ end
27
+ end
28
+ end
6
29
  end
7
30
  end
@@ -1,3 +1,3 @@
1
1
  module NewRelicMiddleware
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -15,6 +15,8 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = NewRelicMiddleware::VERSION
17
17
 
18
+ gem.add_dependency "newrelic_rpm"
19
+
18
20
  gem.add_development_dependency "rails"
19
21
  gem.add_development_dependency "rack-test"
20
22
  end
@@ -1,6 +1,3 @@
1
- require 'simplecov'
2
- SimpleCov.start
3
-
4
1
  require 'newrelic-middleware'
5
2
 
6
3
  require 'minitest/unit'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic-middleware
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-14 00:00:00.000000000 Z
12
+ date: 2012-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: newrelic_rpm
16
+ requirement: &70249575653620 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70249575653620
14
25
  - !ruby/object:Gem::Dependency
15
26
  name: rails
16
- requirement: &70156941959980 !ruby/object:Gem::Requirement
27
+ requirement: &70249575653200 !ruby/object:Gem::Requirement
17
28
  none: false
18
29
  requirements:
19
30
  - - ! '>='
@@ -21,10 +32,10 @@ dependencies:
21
32
  version: '0'
22
33
  type: :development
23
34
  prerelease: false
24
- version_requirements: *70156941959980
35
+ version_requirements: *70249575653200
25
36
  - !ruby/object:Gem::Dependency
26
37
  name: rack-test
27
- requirement: &70156941959560 !ruby/object:Gem::Requirement
38
+ requirement: &70249575652780 !ruby/object:Gem::Requirement
28
39
  none: false
29
40
  requirements:
30
41
  - - ! '>='
@@ -32,7 +43,7 @@ dependencies:
32
43
  version: '0'
33
44
  type: :development
34
45
  prerelease: false
35
- version_requirements: *70156941959560
46
+ version_requirements: *70249575652780
36
47
  description: Track time spent your middleware stack with New Relic
37
48
  email:
38
49
  - me@broadcastingadam.com
@@ -66,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
66
77
  version: '0'
67
78
  segments:
68
79
  - 0
69
- hash: 2035928544990081540
80
+ hash: -4148351062161272907
70
81
  required_rubygems_version: !ruby/object:Gem::Requirement
71
82
  none: false
72
83
  requirements:
@@ -75,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
86
  version: '0'
76
87
  segments:
77
88
  - 0
78
- hash: 2035928544990081540
89
+ hash: -4148351062161272907
79
90
  requirements: []
80
91
  rubyforge_project:
81
92
  rubygems_version: 1.8.11