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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mongo/missing_indexes.rb +8 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 614da8657e676927aa0eab4b1e886fa276d041bb
4
- data.tar.gz: 23ce330e755f5e9b1651f12d5bed674ead6add67
3
+ metadata.gz: 593f3463f7b61b5c790be2e08accd5686afc7d68
4
+ data.tar.gz: d20be09879985ff3e1af1afeb1cbf44436db192a
5
5
  SHA512:
6
- metadata.gz: e68fc3a2b46d4e9f4f2567fa301fb746d39c79528fbd4e317f6b3aeb10010ad2152b31d825b0bc89a949c28842dfffd2e2570429d60799455971397185723279
7
- data.tar.gz: ad6aeb723bc3b77eb7e4418eecb03b54693eb89090cf5efbe7319f02c5f28d235c06d8c0f05521041b21fcb62093d144b9e7596ead97d31e7cfce7634360817f
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
- :update,
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_missing_indexes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Taylor