mongo-rails-instrumentation 0.2.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,9 +3,9 @@ require 'mongo/rails/instrumentation'
3
3
  module Mongo::Rails::Instrumentation
4
4
  class Railtie < Rails::Railtie
5
5
  initializer "mongo.rails.instrumentation" do |app|
6
- instrument Mongo::Connection, [
6
+ instrument Mongo::Networking, [
7
7
  :send_message,
8
- :send_message_with_safe_check,
8
+ :send_message_with_gle,
9
9
  :receive_message
10
10
  ]
11
11
 
@@ -19,16 +19,17 @@ module Mongo::Rails::Instrumentation
19
19
  def instrument(clazz, methods)
20
20
  clazz.module_eval do
21
21
  methods.each do |m|
22
- class_eval %{def #{m}_with_instrumentation(*args, &block)
23
- ActiveSupport::Notifications.instrumenter.instrument "mongo.mongo", :name => "#{m}" do
24
- #{m}_without_instrumentation(*args, &block)
22
+ class_eval <<-CODE, __FILE__, __LINE__ + 1
23
+ def #{m}_with_instrumentation(*args, &block)
24
+ ActiveSupport::Notifications.instrumenter.instrument "mongo.mongo", :name => "#{m}" do
25
+ #{m}_without_instrumentation(*args, &block)
26
+ end
25
27
  end
26
- end
27
- }
28
+ CODE
28
29
 
29
30
  alias_method_chain m, :instrumentation
30
31
  end
31
32
  end
32
33
  end
33
34
  end
34
- end
35
+ end
@@ -1,7 +1,7 @@
1
1
  module Mongo
2
2
  module Rails
3
3
  module Instrumentation
4
- VERSION = '0.2.4'
4
+ VERSION = '0.3.0'
5
5
  end
6
6
  end
7
7
  end
@@ -16,4 +16,5 @@ Gem::Specification.new do |s|
16
16
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
  s.require_paths = ["lib"]
19
+ s.add_dependency 'mongo', '>= 1.8.0'
19
20
  end
metadata CHANGED
@@ -1,34 +1,39 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mongo-rails-instrumentation
3
- version: !ruby/object:Gem::Version
4
- hash: 31
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 4
10
- version: 0.2.4
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Tom Ward
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-05-18 00:00:00 +01:00
19
- default_executable:
20
- dependencies: []
21
-
12
+ date: 2013-01-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: mongo
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.8.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.8.0
22
30
  description: Records time spent in mongo and adds to request logs
23
- email:
31
+ email:
24
32
  - tom@popdog.net
25
33
  executables: []
26
-
27
34
  extensions: []
28
-
29
35
  extra_rdoc_files: []
30
-
31
- files:
36
+ files:
32
37
  - .gitignore
33
38
  - Gemfile
34
39
  - MIT-LICENSE
@@ -41,39 +46,28 @@ files:
41
46
  - lib/mongo/rails/instrumentation/railtie.rb
42
47
  - lib/mongo/rails/instrumentation/version.rb
43
48
  - mongo-rails-instrumentation.gemspec
44
- has_rdoc: true
45
49
  homepage: http://github.com/freerange/mongo-rails-instrumentation
46
50
  licenses: []
47
-
48
51
  post_install_message:
49
52
  rdoc_options: []
50
-
51
- require_paths:
53
+ require_paths:
52
54
  - lib
53
- required_ruby_version: !ruby/object:Gem::Requirement
55
+ required_ruby_version: !ruby/object:Gem::Requirement
54
56
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 0
61
- version: "0"
62
- required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
62
  none: false
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- hash: 3
68
- segments:
69
- - 0
70
- version: "0"
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
71
67
  requirements: []
72
-
73
68
  rubyforge_project:
74
- rubygems_version: 1.6.2
69
+ rubygems_version: 1.8.23
75
70
  signing_key:
76
71
  specification_version: 3
77
72
  summary: Records time spent in mongo and adds to request logs
78
73
  test_files: []
79
-