mongo_missing_indexes 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongo/missing_indexes.rb +8 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 593f3463f7b61b5c790be2e08accd5686afc7d68
|
4
|
+
data.tar.gz: d20be09879985ff3e1af1afeb1cbf44436db192a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3175acb6fb673207ea3daa14a2269db5ec548bd91fc3e6ca64a8001af76d0c5aa4de0fd5093341f9e3662c36c90aed94350a0bd64e88dd3ba924ea43bb35a19c
|
7
|
+
data.tar.gz: 57c9084c8e358f82fcf6868a71e3581a10f331d6610cfdb229c5348515800c13daf7fbd725d2783056d1fe27823755793111a3cd9bd95aac65190c51394b71a6
|
@@ -16,7 +16,10 @@ class Mongo::MissingIndexes
|
|
16
16
|
[
|
17
17
|
:find,
|
18
18
|
:count,
|
19
|
-
:
|
19
|
+
:update_one,
|
20
|
+
:update_many,
|
21
|
+
:delete_one,
|
22
|
+
:delete_many,
|
20
23
|
].each do |method_name|
|
21
24
|
if @enabled
|
22
25
|
Mongo::Collection.class_eval <<-HERE, __FILE__, __LINE__
|
@@ -25,7 +28,7 @@ class Mongo::MissingIndexes
|
|
25
28
|
|
26
29
|
def #{method_name}(*args, &block)
|
27
30
|
#{method_name}_aliased_from_missing_indexes(*args, &block).tap do
|
28
|
-
Mongo::MissingIndexes.instrument_database(self, :#{method_name}, *args, &block)
|
31
|
+
::Mongo::MissingIndexes.instrument_database(self, :#{method_name}, *args, &block)
|
29
32
|
end
|
30
33
|
end
|
31
34
|
end
|
@@ -84,10 +87,10 @@ class Mongo::MissingIndexes
|
|
84
87
|
if non_index_query
|
85
88
|
query_id = SecureRandom.uuid
|
86
89
|
|
87
|
-
logger.info("#{query_id} - unindexed query: #{collection.name}.#{method_name}(#{args.map { |a| a.inspect }.join(", ")})".red)
|
88
|
-
logger.info("#{query_id} - Query backtrace:".yellow)
|
90
|
+
logger.info("mongo_missing_indexes - #{query_id} - unindexed query: #{collection.name}.#{method_name}(#{args.map { |a| a.inspect }.join(", ")})".red)
|
91
|
+
logger.info("mongo_missing_indexes - #{query_id} - Query backtrace:".yellow)
|
89
92
|
caller.map(&:to_s).each do |line|
|
90
|
-
logger.info("#{query_id} - #{line}".yellow)
|
93
|
+
logger.info("mongo_missing_indexes - #{query_id} - #{line}".yellow)
|
91
94
|
end
|
92
95
|
end
|
93
96
|
end
|