time_bandits 0.10.9 → 0.10.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9c20c5271abcd261d1eb1603550bd9e8a2e9f557454bc0369ad41e4a46d77f3
4
- data.tar.gz: 6b327e85bff4a1c9b2c30f6dbc206503d684a1e3fba471f4c9f2774e25b55592
3
+ metadata.gz: c58d28c93e2abce5a7e5748cafd1720e71e9efd1a9dbad61dfd84f8c388d18ac
4
+ data.tar.gz: 4cdd00f82f637c496b5810f46ae1899c898f86850502626c33ab5d676bf8bacd
5
5
  SHA512:
6
- metadata.gz: d9c26ef3f4e1ba927e45a5bd3febfa515ac2b132e2ea4b1aae2277cfd22097133aaefc23fb9617fc1e5a98becd45f467079fd7ade31e68269e9872a987741b4e
7
- data.tar.gz: d09270ae8cc230a0b4dcad0604d75a437da6780539cf1777aa53bdf86b8ee8aaaa9f24fa288f854715b2bd3d3e1b5f3fea05a2c1a99184d188a2b6ea31112a21
6
+ metadata.gz: 0b9afbbe602af0a36640c60491f7de0e8bf173619572c65206a2502c2056a05f1b81d9b14c36ebfeacc69e9a7633cc3c53d8c308475dda258d54ffec4f294e57
7
+ data.tar.gz: fc6dbf5399f916035854330e3a00a517fe50e809cbac3b30d35519c8a74e97eb6b3a8bf0a5c5e9d70f76825d30c69a873f584cacf7952696a427f75384677747
data/Appraisals CHANGED
@@ -6,6 +6,7 @@
6
6
  "5.0.4",
7
7
  "5.1.1",
8
8
  "5.1.2",
9
+ "5.1.5",
9
10
  ].each do |rails_version|
10
11
  next if RUBY_VERSION >= "2.4.0" && rails_version < "4.2.8"
11
12
  appraise "activesupport-#{rails_version}" do
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- time_bandits (0.10.7)
4
+ time_bandits (0.10.9)
5
5
  activesupport (>= 2.3.2)
6
6
  thread_variables
7
7
 
@@ -86,4 +86,4 @@ DEPENDENCIES
86
86
  time_bandits!
87
87
 
88
88
  BUNDLED WITH
89
- 1.15.1
89
+ 1.16.1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- time_bandits (0.10.7)
4
+ time_bandits (0.10.9)
5
5
  activesupport (>= 2.3.2)
6
6
  thread_variables
7
7
 
@@ -86,4 +86,4 @@ DEPENDENCIES
86
86
  time_bandits!
87
87
 
88
88
  BUNDLED WITH
89
- 1.15.1
89
+ 1.16.1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- time_bandits (0.10.7)
4
+ time_bandits (0.10.9)
5
5
  activesupport (>= 2.3.2)
6
6
  thread_variables
7
7
 
@@ -85,4 +85,4 @@ DEPENDENCIES
85
85
  time_bandits!
86
86
 
87
87
  BUNDLED WITH
88
- 1.15.1
88
+ 1.16.1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- time_bandits (0.10.7)
4
+ time_bandits (0.10.9)
5
5
  activesupport (>= 2.3.2)
6
6
  thread_variables
7
7
 
@@ -85,4 +85,4 @@ DEPENDENCIES
85
85
  time_bandits!
86
86
 
87
87
  BUNDLED WITH
88
- 1.15.1
88
+ 1.16.1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- time_bandits (0.10.7)
4
+ time_bandits (0.10.9)
5
5
  activesupport (>= 2.3.2)
6
6
  thread_variables
7
7
 
@@ -85,4 +85,4 @@ DEPENDENCIES
85
85
  time_bandits!
86
86
 
87
87
  BUNDLED WITH
88
- 1.15.1
88
+ 1.16.1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- time_bandits (0.10.7)
4
+ time_bandits (0.10.9)
5
5
  activesupport (>= 2.3.2)
6
6
  thread_variables
7
7
 
@@ -85,4 +85,4 @@ DEPENDENCIES
85
85
  time_bandits!
86
86
 
87
87
  BUNDLED WITH
88
- 1.15.1
88
+ 1.16.1
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "activesupport", "5.1.5"
6
+ gem "activerecord", "5.1.5"
7
+
8
+ gemspec :path => "../"
@@ -0,0 +1,85 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ time_bandits (0.10.9)
5
+ activesupport (>= 2.3.2)
6
+ thread_variables
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ activemodel (5.1.5)
12
+ activesupport (= 5.1.5)
13
+ activerecord (5.1.5)
14
+ activemodel (= 5.1.5)
15
+ activesupport (= 5.1.5)
16
+ arel (~> 8.0)
17
+ activesupport (5.1.5)
18
+ concurrent-ruby (~> 1.0, >= 1.0.2)
19
+ i18n (~> 0.7)
20
+ minitest (~> 5.1)
21
+ tzinfo (~> 1.1)
22
+ amq-protocol (2.0.1)
23
+ amqp (1.6.0)
24
+ amq-protocol (>= 2.0.1)
25
+ eventmachine
26
+ ansi (1.5.0)
27
+ appraisal (2.2.0)
28
+ bundler
29
+ rake
30
+ thor (>= 0.14.0)
31
+ arel (8.0.0)
32
+ beetle (2.1.1)
33
+ activesupport (>= 2.3.4)
34
+ amq-protocol (= 2.0.1)
35
+ amqp (= 1.6.0)
36
+ bunny (~> 0.7.10)
37
+ hiredis (>= 0.4.5)
38
+ redis (>= 2.2.2)
39
+ uuid4r (>= 0.1.2)
40
+ bunny (0.7.11)
41
+ byebug (10.0.0)
42
+ concurrent-ruby (1.0.5)
43
+ dalli (2.7.6)
44
+ eventmachine (1.2.5)
45
+ hiredis (0.6.1)
46
+ i18n (0.9.5)
47
+ concurrent-ruby (~> 1.0)
48
+ memcached (1.8.0)
49
+ metaclass (0.0.4)
50
+ minitest (5.11.3)
51
+ mocha (1.3.0)
52
+ metaclass (~> 0.0.1)
53
+ mysql2 (0.4.10)
54
+ rake (10.5.0)
55
+ redis (4.0.1)
56
+ sequel (5.5.0)
57
+ thor (0.20.0)
58
+ thread_safe (0.3.6)
59
+ thread_variables (0.2.0)
60
+ tzinfo (1.2.5)
61
+ thread_safe (~> 0.1)
62
+ uuid4r (0.2.0)
63
+
64
+ PLATFORMS
65
+ ruby
66
+
67
+ DEPENDENCIES
68
+ activerecord (= 5.1.5)
69
+ activesupport (= 5.1.5)
70
+ ansi
71
+ appraisal
72
+ beetle (>= 0.4.6)
73
+ byebug
74
+ dalli
75
+ memcached (~> 1.8.0)
76
+ minitest (~> 5.5)
77
+ mocha
78
+ mysql2
79
+ rake (~> 10.5.0)
80
+ redis
81
+ sequel
82
+ time_bandits!
83
+
84
+ BUNDLED WITH
85
+ 1.16.1
@@ -68,14 +68,14 @@ module ActiveRecord
68
68
 
69
69
  protected
70
70
  def sql(event)
71
+ payload = event.payload
72
+
71
73
  self.class.runtime += event.duration
72
74
  self.class.call_count += 1
73
- self.class.query_cache_hits += 1 if payload[:cached] || event.payload[:name] == "CACHE"
75
+ self.class.query_cache_hits += 1 if payload[:cached] || payload[:name] == "CACHE"
74
76
 
75
77
  return unless logger.debug?
76
78
 
77
- payload = event.payload
78
-
79
79
  return if IGNORE_PAYLOAD_NAMES.include?(payload[:name])
80
80
 
81
81
  log_sql_statement(payload, event)
@@ -1,3 +1,3 @@
1
1
  module TimeBandits
2
- VERSION = "0.10.9"
2
+ VERSION = "0.10.10"
3
3
  end
@@ -3,6 +3,9 @@ require 'active_record'
3
3
  require 'time_bandits/monkey_patches/active_record'
4
4
 
5
5
  class DatabaseTest < Test::Unit::TestCase
6
+
7
+ ActiveRecord::Base.logger = Logger.new($stdout)
8
+
6
9
  def setup
7
10
  TimeBandits.time_bandits = []
8
11
  TimeBandits.add TimeBandits::TimeConsumers::Database
@@ -37,6 +40,14 @@ class DatabaseTest < Test::Unit::TestCase
37
40
  assert_equal "ActiveRecord: 1.234ms(0q,0h)", TimeBandits.runtime
38
41
  end
39
42
 
43
+ test "sql can be executed" do
44
+ event = mock('event')
45
+ event.stubs(:payload).returns({name: "MURKS", sql: "SELECT 1"})
46
+ event.stubs(:duration).returns(0.1)
47
+ ActiveRecord::Base.logger.expects(:debug)
48
+ assert_nil log_subscriber.new.sql(event)
49
+ end
50
+
40
51
  private
41
52
 
42
53
  def bandit
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time_bandits
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.9
4
+ version: 0.10.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
@@ -249,6 +249,8 @@ files:
249
249
  - gemfiles/activesupport_5.1.1.gemfile.lock
250
250
  - gemfiles/activesupport_5.1.2.gemfile
251
251
  - gemfiles/activesupport_5.1.2.gemfile.lock
252
+ - gemfiles/activesupport_5.1.5.gemfile
253
+ - gemfiles/activesupport_5.1.5.gemfile.lock
252
254
  - lib/time_bandits.rb
253
255
  - lib/time_bandits/monkey_patches/action_controller.rb
254
256
  - lib/time_bandits/monkey_patches/active_record.rb