appsignal-mongo 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,17 @@
1
+ AppSignal Mongo
2
+ ===============
3
+
4
+ `appsignal-mongo` allows AppSignal clients to gain insight in database queries
5
+ that use the [10gen-supported driver for MongoDB](
6
+ https://github.com/mongodb/mongo-ruby-driver),
7
+ for instance [Mongoid 2.x](http://github.com/mongoid/mongoid)
8
+
9
+ For more information, visit:
10
+
11
+ * [AppSignal website](http://appsignal.com)
12
+ * [AppSignal client gem](https://github.com/80beans/appsignal)
13
+
14
+ Licence
15
+ =======
16
+
17
+ See [LICENCE](https://github.com/80beans/appsignal-mongo/blob/master/LICENSE)
@@ -0,0 +1,5 @@
1
+ module Appsignal
2
+ module Mongo
3
+ VERSION = '0.1.1'
4
+ end
5
+ end
@@ -0,0 +1,26 @@
1
+ require 'mongo'
2
+ require 'active_support'
3
+
4
+ module Appsignal
5
+ module Mongo
6
+ module Instrumentation
7
+
8
+ private
9
+
10
+ def instrument_with_appsignal_instrumentation(name, payload={}, &block)
11
+ ActiveSupport::Notifications.instrument(
12
+ 'query.mongodb', :query => payload.merge(:method => name)) do
13
+ instrument_without_appsignal_instrumentation(name, payload, &block)
14
+ end
15
+ end
16
+
17
+ end
18
+ end
19
+ end
20
+
21
+ ::Mongo::Logging.module_eval do
22
+ include Appsignal::Mongo::Instrumentation
23
+
24
+ alias_method :instrument_without_appsignal_instrumentation, :instrument
25
+ alias_method :instrument, :instrument_with_appsignal_instrumentation
26
+ end
metadata ADDED
@@ -0,0 +1,152 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: appsignal-mongo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Thijs Cadier
9
+ - Steven Weller
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2013-03-04 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: mongo
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>'
21
+ - !ruby/object:Gem::Version
22
+ version: '1.5'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>'
29
+ - !ruby/object:Gem::Version
30
+ version: '1.5'
31
+ - !ruby/object:Gem::Dependency
32
+ name: active_support
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ~>
37
+ - !ruby/object:Gem::Version
38
+ version: '3'
39
+ type: :runtime
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: '3'
47
+ - !ruby/object:Gem::Dependency
48
+ name: bson_ext
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ - !ruby/object:Gem::Dependency
64
+ name: rake
65
+ requirement: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ - !ruby/object:Gem::Dependency
80
+ name: rspec
81
+ requirement: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ~>
85
+ - !ruby/object:Gem::Version
86
+ version: 2.12.0
87
+ type: :development
88
+ prerelease: false
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ~>
93
+ - !ruby/object:Gem::Version
94
+ version: 2.12.0
95
+ - !ruby/object:Gem::Dependency
96
+ name: pry
97
+ requirement: !ruby/object:Gem::Requirement
98
+ none: false
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Wrap all mongo queries withActiveSupport::Notifications.instrument calls.For
112
+ use with Appsignal.
113
+ email:
114
+ - contact@appsignal.com
115
+ executables: []
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - lib/appsignal_mongo/version.rb
120
+ - lib/appsignal_mongo.rb
121
+ - README.md
122
+ homepage: https://github.com/80beans/appsignal-mongo
123
+ licenses: []
124
+ post_install_message:
125
+ rdoc_options: []
126
+ require_paths:
127
+ - lib
128
+ required_ruby_version: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ segments:
135
+ - 0
136
+ hash: 1638506603200786482
137
+ required_rubygems_version: !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ segments:
144
+ - 0
145
+ hash: 1638506603200786482
146
+ requirements: []
147
+ rubyforge_project:
148
+ rubygems_version: 1.8.23
149
+ signing_key:
150
+ specification_version: 3
151
+ summary: Add instrument calls to mongodb queries made with mongo. For use with Appsignal.
152
+ test_files: []