rpm_contrib 1.0.12 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/lib/rpm_contrib/instrumentation/mongo_mapper.rb +28 -28
- data/lib/rpm_contrib/instrumentation/mongoid.rb +16 -18
- metadata +4 -4
data/CHANGELOG
CHANGED
@@ -7,35 +7,35 @@ if defined?(::MongoMapper) && !NewRelic::Control.instance['disable_mongodb']
|
|
7
7
|
# Currently only MongoMapper is implemented
|
8
8
|
module MongoMapper
|
9
9
|
def self.included(model)
|
10
|
-
model.metaclass.class_eval do
|
11
|
-
add_method_tracer :find, 'Database/#{self.name}/find'
|
12
|
-
add_method_tracer :find!, 'Database/#{self.name}/find!'
|
13
|
-
add_method_tracer :paginate, 'Database/#{self.name}/paginate'
|
14
|
-
add_method_tracer :first, 'Database/#{self.name}/first'
|
15
|
-
add_method_tracer :last, 'Database/#{self.name}/last'
|
16
|
-
add_method_tracer :all, 'Database/#{self.name}/all'
|
17
|
-
add_method_tracer :count, 'Database/#{self.name}/count'
|
18
|
-
add_method_tracer :create, 'Database/#{self.name}/create'
|
19
|
-
add_method_tracer :create!, 'Database/#{self.name}/create!'
|
20
|
-
add_method_tracer :update, 'Database/#{self.name}/update'
|
21
|
-
add_method_tracer :delete, 'Database/#{self.name}/delete'
|
22
|
-
add_method_tracer :delete_all, 'Database/#{self.name}/delete_all'
|
23
|
-
add_method_tracer :destroy, 'Database/#{self.name}/destroy'
|
24
|
-
add_method_tracer :destroy_all, 'Database/#{self.name}/destroy_all'
|
25
|
-
add_method_tracer :exists?, 'Database/#{self.name}/exists?'
|
26
|
-
add_method_tracer :find_by_id, 'Database/#{self.name}/find_by_id'
|
27
|
-
add_method_tracer :increment, 'Database/#{self.name}/increment'
|
28
|
-
add_method_tracer :decrement, 'Database/#{self.name}/decrement'
|
29
|
-
add_method_tracer :set, 'Database/#{self.name}/set'
|
30
|
-
add_method_tracer :push, 'Database/#{self.name}/push'
|
31
|
-
add_method_tracer :push_all, 'Database/#{self.name}/push_all'
|
32
|
-
add_method_tracer :push_uniq, 'Database/#{self.name}/push_uniq'
|
33
|
-
add_method_tracer :pull, 'Database/#{self.name}/pull'
|
34
|
-
add_method_tracer :pull_all, 'Database/#{self.name}/pull_all'
|
35
|
-
end
|
36
|
-
|
37
10
|
model.class_eval do
|
38
|
-
|
11
|
+
class << self
|
12
|
+
add_method_tracer :find, 'Database/#{self.name}/find'
|
13
|
+
add_method_tracer :find!, 'Database/#{self.name}/find!'
|
14
|
+
add_method_tracer :paginate, 'Database/#{self.name}/paginate'
|
15
|
+
add_method_tracer :first, 'Database/#{self.name}/first'
|
16
|
+
add_method_tracer :last, 'Database/#{self.name}/last'
|
17
|
+
add_method_tracer :all, 'Database/#{self.name}/all'
|
18
|
+
add_method_tracer :count, 'Database/#{self.name}/count'
|
19
|
+
add_method_tracer :create, 'Database/#{self.name}/create'
|
20
|
+
add_method_tracer :create!, 'Database/#{self.name}/create!'
|
21
|
+
add_method_tracer :update, 'Database/#{self.name}/update'
|
22
|
+
add_method_tracer :delete, 'Database/#{self.name}/delete'
|
23
|
+
add_method_tracer :delete_all, 'Database/#{self.name}/delete_all'
|
24
|
+
add_method_tracer :destroy, 'Database/#{self.name}/destroy'
|
25
|
+
add_method_tracer :destroy_all, 'Database/#{self.name}/destroy_all'
|
26
|
+
add_method_tracer :exists?, 'Database/#{self.name}/exists?'
|
27
|
+
add_method_tracer :find_by_id, 'Database/#{self.name}/find_by_id'
|
28
|
+
add_method_tracer :increment, 'Database/#{self.name}/increment'
|
29
|
+
add_method_tracer :decrement, 'Database/#{self.name}/decrement'
|
30
|
+
add_method_tracer :set, 'Database/#{self.name}/set'
|
31
|
+
add_method_tracer :push, 'Database/#{self.name}/push'
|
32
|
+
add_method_tracer :push_all, 'Database/#{self.name}/push_all'
|
33
|
+
add_method_tracer :push_uniq, 'Database/#{self.name}/push_uniq'
|
34
|
+
add_method_tracer :pull, 'Database/#{self.name}/pull'
|
35
|
+
add_method_tracer :pull_all, 'Database/#{self.name}/pull_all'
|
36
|
+
end
|
37
|
+
|
38
|
+
add_method_tracer :save, 'Database/#{self.class.name}/save'
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -19,31 +19,29 @@ if defined?(::Mongoid) && !NewRelic::Control.instance['disable_mongodb']
|
|
19
19
|
|
20
20
|
module Mongoid
|
21
21
|
def included(model)
|
22
|
-
model.metaclass.class_eval do
|
23
|
-
puts "adding mongoid method tracers for #{model.name}"
|
24
|
-
add_method_tracer :create, 'Database/#{self.name}/create'
|
25
|
-
add_method_tracer :create!, 'Database/#{self.name}/create!'
|
26
|
-
add_method_tracer :delete_all, 'Database/#{self.name}/delete_all'
|
27
|
-
add_method_tracer :destroy_all, 'Database/#{self.name}/destroy_all'
|
28
|
-
add_method_tracer :all, 'Database/#{self.name}/all'
|
29
|
-
add_method_tracer :find, 'Database/#{self.name}/find'
|
30
|
-
add_method_tracer :first, 'Database/#{self.name}/first'
|
31
|
-
add_method_tracer :last, 'Database/#{self.name}/last'
|
32
|
-
add_method_tracer :find_or_create_by, 'Database/#{self.name}/find_or_create_by'
|
33
|
-
add_method_tracer :find_or_initialize_by, 'Database/#{self.name}/find_or_initialize_by'
|
34
|
-
add_method_tracer :min, 'Database/#{self.name}/min'
|
35
|
-
add_method_tracer :max, 'Database/#{self.name}/max'
|
36
|
-
add_method_tracer :sum, 'Database/#{self.name}/sum'
|
37
|
-
end
|
38
|
-
|
39
22
|
model.class_eval do
|
23
|
+
class << self
|
24
|
+
add_method_tracer :create, 'Database/#{self.name}/create'
|
25
|
+
add_method_tracer :create!, 'Database/#{self.name}/create!'
|
26
|
+
add_method_tracer :delete_all, 'Database/#{self.name}/delete_all'
|
27
|
+
add_method_tracer :destroy_all, 'Database/#{self.name}/destroy_all'
|
28
|
+
add_method_tracer :all, 'Database/#{self.name}/all'
|
29
|
+
add_method_tracer :find, 'Database/#{self.name}/find'
|
30
|
+
add_method_tracer :first, 'Database/#{self.name}/first'
|
31
|
+
add_method_tracer :last, 'Database/#{self.name}/last'
|
32
|
+
add_method_tracer :find_or_create_by, 'Database/#{self.name}/find_or_create_by'
|
33
|
+
add_method_tracer :find_or_initialize_by, 'Database/#{self.name}/find_or_initialize_by'
|
34
|
+
add_method_tracer :min, 'Database/#{self.name}/min'
|
35
|
+
add_method_tracer :max, 'Database/#{self.name}/max'
|
36
|
+
add_method_tracer :sum, 'Database/#{self.name}/sum'
|
37
|
+
end
|
38
|
+
|
40
39
|
add_method_tracer :update_attributes, 'Database/#{self.class.name}/update_attributes'
|
41
40
|
add_method_tracer :update_attributes!, 'Database/#{self.class.name}/update_attributes!'
|
42
41
|
add_method_tracer :save, 'Database/#{self.class.name}/save'
|
43
42
|
add_method_tracer :save!, 'Database/#{self.class.name}/save!'
|
44
43
|
add_method_tracer :delete, 'Database/#{self.class.name}/delete'
|
45
44
|
add_method_tracer :destroy, 'Database/#{self.class.name}/destroy'
|
46
|
-
|
47
45
|
end
|
48
46
|
super
|
49
47
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpm_contrib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 13
|
10
|
+
version: 1.0.13
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bill Kayser
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-10-28 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|