time_bandits 0.10.6 → 0.10.7
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 +4 -4
- data/.travis.yml +2 -2
- data/Appraisals +4 -0
- data/{README.rdoc → README.md} +38 -39
- data/Rakefile +2 -2
- data/gemfiles/activesupport_4.1.16.gemfile.lock +2 -2
- data/gemfiles/activesupport_4.2.8.gemfile.lock +2 -2
- data/gemfiles/activesupport_4.2.9.gemfile +8 -0
- data/gemfiles/activesupport_4.2.9.gemfile.lock +89 -0
- data/gemfiles/activesupport_5.0.3.gemfile.lock +2 -2
- data/gemfiles/activesupport_5.0.4.gemfile +8 -0
- data/gemfiles/activesupport_5.0.4.gemfile.lock +88 -0
- data/gemfiles/activesupport_5.1.1.gemfile.lock +2 -2
- data/gemfiles/activesupport_5.1.2.gemfile +8 -0
- data/gemfiles/activesupport_5.1.2.gemfile.lock +88 -0
- data/lib/time_bandits/monkey_patches/active_record.rb +19 -1
- data/lib/time_bandits/version.rb +1 -1
- data/test/unit/gc_consumer_test.rb +3 -2
- metadata +10 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8d23b193698502f40dfdb2c25d8c53e8e86e824f
|
|
4
|
+
data.tar.gz: a1d30b3cb225939fe255364270e8c4a3a3764e42
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d308bf737bb2563d4eeb647e9e80acf005fe5c3fb1656ccbd670aba04dc7c3f01596b6d4c688938ff0a5dd7bc5e01584d9180975d20d9dacd591258b6a4804b5
|
|
7
|
+
data.tar.gz: 6595b1c92610a4b6a85bf35bcfc6e442cfcc75d9f2740a250d43fe469e4cd2eb3f8fd8f7b06df8b1123d28fbc3e6a7a8f79e066fa6e6cbf900a37f401f01a803
|
data/.travis.yml
CHANGED
data/Appraisals
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
[
|
|
2
2
|
"4.1.16",
|
|
3
3
|
"4.2.8",
|
|
4
|
+
"4.2.9",
|
|
4
5
|
"5.0.3",
|
|
6
|
+
"5.0.4",
|
|
5
7
|
"5.1.1",
|
|
8
|
+
"5.1.2",
|
|
6
9
|
].each do |rails_version|
|
|
10
|
+
next if RUBY_VERSION >= "2.4.0" && rails_version < "4.2.8"
|
|
7
11
|
appraise "activesupport-#{rails_version}" do
|
|
8
12
|
gem "activesupport", rails_version
|
|
9
13
|
gem "activerecord", rails_version
|
data/{README.rdoc → README.md}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
# Time Bandits
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## About
|
|
4
4
|
|
|
5
5
|
Time Bandits is a gem plugin for Rails which enhances Rails' controller/view/db benchmark logging.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Usage
|
|
8
8
|
|
|
9
9
|
Without configuration, the standard Rails 'Completed line' will change
|
|
10
10
|
from its default format
|
|
@@ -60,7 +60,7 @@ monkey patching the code which you want to instrument. Have a look at consumers
|
|
|
60
60
|
lib/time_bandits/time_consumers and the corresponding patches under lib/time_bandits/monkey_patches.
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
## Prerequisites
|
|
64
64
|
|
|
65
65
|
Rails >= 3.x is required. The gem will raise an error if you try to use it with an incompatible
|
|
66
66
|
version.
|
|
@@ -73,82 +73,81 @@ Ruby only contains a subset of the railsexpress patches. To get the full monty,
|
|
|
73
73
|
rvm and the railsexpress rvm patchsets (see https://github.com/skaes/rvm-patchsets).
|
|
74
74
|
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
## History
|
|
77
77
|
|
|
78
78
|
This plugin started from the code of the 'custom_benchmark' plugin written by tylerkovacs. However, we
|
|
79
79
|
changed so much of the code that is is practically a full rewrite, hence we changed the name.
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
## Running Tests
|
|
82
82
|
|
|
83
83
|
In order for the test to run you need a running memcached, redis-server and mysql
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
## Release Notes
|
|
86
86
|
|
|
87
|
+
### Version 0.10.6:
|
|
88
|
+
- fixed time calculation for rails 4
|
|
87
89
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
### Version 0.10.5
|
|
91
|
+
- enabled activerecord monkeypatch for rails 5.1
|
|
90
92
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
### Version 0.10.4
|
|
94
|
+
- protect against Rails 5 firing on_load handlers multiple times
|
|
93
95
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
### Version 0.10.3
|
|
97
|
+
- fixed activerecord monkeypatch
|
|
96
98
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
### Version 0.10.2
|
|
100
|
+
- controller testing fixed for rspec
|
|
99
101
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
### Version 0.10.1
|
|
103
|
+
- fixed incorrect module prepend which broke controller testing
|
|
102
104
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
### Version 0.10.0
|
|
106
|
+
- support rails 5
|
|
105
107
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
### Version 0.9.2
|
|
109
|
+
- sequel gem changes broke sequel time consumer
|
|
108
110
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
### Version 0.9.1
|
|
112
|
+
- make sure redis times consumer logs keys in ASCII
|
|
111
113
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
### Version 0.9.0
|
|
115
|
+
- added beetle time consumer
|
|
114
116
|
|
|
115
|
-
|
|
116
|
-
-- added beetle time consumer
|
|
117
|
-
|
|
118
|
-
version 0.8.1
|
|
117
|
+
### Version 0.8.1
|
|
119
118
|
- bugfix
|
|
120
119
|
|
|
121
|
-
|
|
120
|
+
### Version 0.8.0
|
|
122
121
|
- support retrieving current runtime including not yet consumed time
|
|
123
122
|
|
|
124
|
-
|
|
123
|
+
### Version 0.7.4
|
|
125
124
|
- use appraisal for testing against multiple rails versions
|
|
126
125
|
- bugfix for actions without render
|
|
127
126
|
|
|
128
|
-
|
|
127
|
+
### Version 0.7.3
|
|
129
128
|
- bugfix dalli consumer for rails 4.2
|
|
130
129
|
|
|
131
|
-
|
|
130
|
+
### Version 0.7.2
|
|
132
131
|
- support ruby 2.2.0
|
|
133
132
|
|
|
134
|
-
|
|
133
|
+
### Version 0.7.1
|
|
135
134
|
- support measuring sequel gem
|
|
136
135
|
|
|
137
|
-
|
|
136
|
+
### Version 0.7.0
|
|
138
137
|
- switched to byebug (debugger does not fully support 2.0 and 2.1 not at all)
|
|
139
138
|
- adapted garbage collection statistics to work for 2.1
|
|
140
139
|
- improved rails 4.x compatibility
|
|
141
140
|
- GC time consumer now tries to make the most out of an unpatched ruby
|
|
142
141
|
|
|
143
|
-
|
|
142
|
+
### Version 0.6.0
|
|
144
143
|
- added redis time consumer
|
|
145
144
|
- fixed rails 4.0 problems with builtin mem_cache_store
|
|
146
145
|
- now only consumers which measured something are added to the completed line
|
|
147
146
|
|
|
148
|
-
|
|
147
|
+
### Version 0.5.1
|
|
149
148
|
- added license file
|
|
150
149
|
|
|
151
|
-
|
|
150
|
+
### Version 0.5:
|
|
152
151
|
- has dropped rails 2 support
|
|
153
152
|
- relies on ActiveSupport::Notifications
|
|
154
153
|
- is supposedly thread safe
|
|
@@ -156,7 +155,7 @@ version 0.5:
|
|
|
156
155
|
- times are all measured in milliseconds internally
|
|
157
156
|
- added class TimeBandits::TimeConsumers::BaseConsumer to simplify writing custom consumers
|
|
158
157
|
|
|
159
|
-
|
|
158
|
+
## License
|
|
160
159
|
|
|
161
160
|
Copyright (c) 2009-2014 Stefan Kaes <skaes@railsexpress.de>
|
|
162
161
|
|
data/Rakefile
CHANGED
|
@@ -17,9 +17,9 @@ end
|
|
|
17
17
|
|
|
18
18
|
namespace :appraisal do
|
|
19
19
|
task :install do
|
|
20
|
-
system
|
|
20
|
+
abort unless system("appraisal install")
|
|
21
21
|
end
|
|
22
22
|
task :test => :install do
|
|
23
|
-
system("appraisal rake test")
|
|
23
|
+
abort unless system("appraisal rake test")
|
|
24
24
|
end
|
|
25
25
|
end
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: ..
|
|
3
|
+
specs:
|
|
4
|
+
time_bandits (0.10.7)
|
|
5
|
+
activesupport (>= 2.3.2)
|
|
6
|
+
thread_variables
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: http://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
activemodel (4.2.9)
|
|
12
|
+
activesupport (= 4.2.9)
|
|
13
|
+
builder (~> 3.1)
|
|
14
|
+
activerecord (4.2.9)
|
|
15
|
+
activemodel (= 4.2.9)
|
|
16
|
+
activesupport (= 4.2.9)
|
|
17
|
+
arel (~> 6.0)
|
|
18
|
+
activesupport (4.2.9)
|
|
19
|
+
i18n (~> 0.7)
|
|
20
|
+
minitest (~> 5.1)
|
|
21
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
|
22
|
+
tzinfo (~> 1.1)
|
|
23
|
+
amq-protocol (2.0.1)
|
|
24
|
+
amqp (1.6.0)
|
|
25
|
+
amq-protocol (>= 2.0.1)
|
|
26
|
+
eventmachine
|
|
27
|
+
ansi (1.5.0)
|
|
28
|
+
appraisal (2.2.0)
|
|
29
|
+
bundler
|
|
30
|
+
rake
|
|
31
|
+
thor (>= 0.14.0)
|
|
32
|
+
arel (6.0.4)
|
|
33
|
+
beetle (1.0.3)
|
|
34
|
+
activesupport (>= 2.3.4)
|
|
35
|
+
amq-protocol (= 2.0.1)
|
|
36
|
+
amqp (= 1.6.0)
|
|
37
|
+
bunny (~> 0.7.10)
|
|
38
|
+
daemons (>= 1.2.0)
|
|
39
|
+
eventmachine_httpserver (>= 0.2.1)
|
|
40
|
+
hiredis (>= 0.4.5)
|
|
41
|
+
redis (>= 2.2.2)
|
|
42
|
+
uuid4r (>= 0.1.2)
|
|
43
|
+
builder (3.2.3)
|
|
44
|
+
bunny (0.7.10)
|
|
45
|
+
byebug (9.0.6)
|
|
46
|
+
daemons (1.2.4)
|
|
47
|
+
dalli (2.7.6)
|
|
48
|
+
eventmachine (1.2.3)
|
|
49
|
+
eventmachine_httpserver (0.2.1)
|
|
50
|
+
hiredis (0.6.1)
|
|
51
|
+
i18n (0.8.4)
|
|
52
|
+
memcached (1.8.0)
|
|
53
|
+
metaclass (0.0.4)
|
|
54
|
+
minitest (5.10.2)
|
|
55
|
+
mocha (1.2.1)
|
|
56
|
+
metaclass (~> 0.0.1)
|
|
57
|
+
mysql2 (0.4.7)
|
|
58
|
+
rake (10.5.0)
|
|
59
|
+
redis (3.3.3)
|
|
60
|
+
sequel (4.48.0)
|
|
61
|
+
thor (0.19.4)
|
|
62
|
+
thread_safe (0.3.6)
|
|
63
|
+
thread_variables (0.2.0)
|
|
64
|
+
tzinfo (1.2.3)
|
|
65
|
+
thread_safe (~> 0.1)
|
|
66
|
+
uuid4r (0.2.0)
|
|
67
|
+
|
|
68
|
+
PLATFORMS
|
|
69
|
+
ruby
|
|
70
|
+
|
|
71
|
+
DEPENDENCIES
|
|
72
|
+
activerecord (= 4.2.9)
|
|
73
|
+
activesupport (= 4.2.9)
|
|
74
|
+
ansi
|
|
75
|
+
appraisal
|
|
76
|
+
beetle (>= 0.4.6)
|
|
77
|
+
byebug
|
|
78
|
+
dalli
|
|
79
|
+
memcached (~> 1.8.0)
|
|
80
|
+
minitest (~> 5.5)
|
|
81
|
+
mocha
|
|
82
|
+
mysql2
|
|
83
|
+
rake (~> 10.5.0)
|
|
84
|
+
redis
|
|
85
|
+
sequel
|
|
86
|
+
time_bandits!
|
|
87
|
+
|
|
88
|
+
BUNDLED WITH
|
|
89
|
+
1.15.1
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: ..
|
|
3
|
+
specs:
|
|
4
|
+
time_bandits (0.10.7)
|
|
5
|
+
activesupport (>= 2.3.2)
|
|
6
|
+
thread_variables
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: http://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
activemodel (5.0.4)
|
|
12
|
+
activesupport (= 5.0.4)
|
|
13
|
+
activerecord (5.0.4)
|
|
14
|
+
activemodel (= 5.0.4)
|
|
15
|
+
activesupport (= 5.0.4)
|
|
16
|
+
arel (~> 7.0)
|
|
17
|
+
activesupport (5.0.4)
|
|
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 (7.1.4)
|
|
32
|
+
beetle (1.0.3)
|
|
33
|
+
activesupport (>= 2.3.4)
|
|
34
|
+
amq-protocol (= 2.0.1)
|
|
35
|
+
amqp (= 1.6.0)
|
|
36
|
+
bunny (~> 0.7.10)
|
|
37
|
+
daemons (>= 1.2.0)
|
|
38
|
+
eventmachine_httpserver (>= 0.2.1)
|
|
39
|
+
hiredis (>= 0.4.5)
|
|
40
|
+
redis (>= 2.2.2)
|
|
41
|
+
uuid4r (>= 0.1.2)
|
|
42
|
+
bunny (0.7.10)
|
|
43
|
+
byebug (9.0.6)
|
|
44
|
+
concurrent-ruby (1.0.5)
|
|
45
|
+
daemons (1.2.4)
|
|
46
|
+
dalli (2.7.6)
|
|
47
|
+
eventmachine (1.2.3)
|
|
48
|
+
eventmachine_httpserver (0.2.1)
|
|
49
|
+
hiredis (0.6.1)
|
|
50
|
+
i18n (0.8.4)
|
|
51
|
+
memcached (1.8.0)
|
|
52
|
+
metaclass (0.0.4)
|
|
53
|
+
minitest (5.10.2)
|
|
54
|
+
mocha (1.2.1)
|
|
55
|
+
metaclass (~> 0.0.1)
|
|
56
|
+
mysql2 (0.4.7)
|
|
57
|
+
rake (10.5.0)
|
|
58
|
+
redis (3.3.3)
|
|
59
|
+
sequel (4.48.0)
|
|
60
|
+
thor (0.19.4)
|
|
61
|
+
thread_safe (0.3.6)
|
|
62
|
+
thread_variables (0.2.0)
|
|
63
|
+
tzinfo (1.2.3)
|
|
64
|
+
thread_safe (~> 0.1)
|
|
65
|
+
uuid4r (0.2.0)
|
|
66
|
+
|
|
67
|
+
PLATFORMS
|
|
68
|
+
ruby
|
|
69
|
+
|
|
70
|
+
DEPENDENCIES
|
|
71
|
+
activerecord (= 5.0.4)
|
|
72
|
+
activesupport (= 5.0.4)
|
|
73
|
+
ansi
|
|
74
|
+
appraisal
|
|
75
|
+
beetle (>= 0.4.6)
|
|
76
|
+
byebug
|
|
77
|
+
dalli
|
|
78
|
+
memcached (~> 1.8.0)
|
|
79
|
+
minitest (~> 5.5)
|
|
80
|
+
mocha
|
|
81
|
+
mysql2
|
|
82
|
+
rake (~> 10.5.0)
|
|
83
|
+
redis
|
|
84
|
+
sequel
|
|
85
|
+
time_bandits!
|
|
86
|
+
|
|
87
|
+
BUNDLED WITH
|
|
88
|
+
1.15.1
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: ..
|
|
3
|
+
specs:
|
|
4
|
+
time_bandits (0.10.7)
|
|
5
|
+
activesupport (>= 2.3.2)
|
|
6
|
+
thread_variables
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: http://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
activemodel (5.1.2)
|
|
12
|
+
activesupport (= 5.1.2)
|
|
13
|
+
activerecord (5.1.2)
|
|
14
|
+
activemodel (= 5.1.2)
|
|
15
|
+
activesupport (= 5.1.2)
|
|
16
|
+
arel (~> 8.0)
|
|
17
|
+
activesupport (5.1.2)
|
|
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 (1.0.3)
|
|
33
|
+
activesupport (>= 2.3.4)
|
|
34
|
+
amq-protocol (= 2.0.1)
|
|
35
|
+
amqp (= 1.6.0)
|
|
36
|
+
bunny (~> 0.7.10)
|
|
37
|
+
daemons (>= 1.2.0)
|
|
38
|
+
eventmachine_httpserver (>= 0.2.1)
|
|
39
|
+
hiredis (>= 0.4.5)
|
|
40
|
+
redis (>= 2.2.2)
|
|
41
|
+
uuid4r (>= 0.1.2)
|
|
42
|
+
bunny (0.7.10)
|
|
43
|
+
byebug (9.0.6)
|
|
44
|
+
concurrent-ruby (1.0.5)
|
|
45
|
+
daemons (1.2.4)
|
|
46
|
+
dalli (2.7.6)
|
|
47
|
+
eventmachine (1.2.3)
|
|
48
|
+
eventmachine_httpserver (0.2.1)
|
|
49
|
+
hiredis (0.6.1)
|
|
50
|
+
i18n (0.8.4)
|
|
51
|
+
memcached (1.8.0)
|
|
52
|
+
metaclass (0.0.4)
|
|
53
|
+
minitest (5.10.2)
|
|
54
|
+
mocha (1.2.1)
|
|
55
|
+
metaclass (~> 0.0.1)
|
|
56
|
+
mysql2 (0.4.7)
|
|
57
|
+
rake (10.5.0)
|
|
58
|
+
redis (3.3.3)
|
|
59
|
+
sequel (4.48.0)
|
|
60
|
+
thor (0.19.4)
|
|
61
|
+
thread_safe (0.3.6)
|
|
62
|
+
thread_variables (0.2.0)
|
|
63
|
+
tzinfo (1.2.3)
|
|
64
|
+
thread_safe (~> 0.1)
|
|
65
|
+
uuid4r (0.2.0)
|
|
66
|
+
|
|
67
|
+
PLATFORMS
|
|
68
|
+
ruby
|
|
69
|
+
|
|
70
|
+
DEPENDENCIES
|
|
71
|
+
activerecord (= 5.1.2)
|
|
72
|
+
activesupport (= 5.1.2)
|
|
73
|
+
ansi
|
|
74
|
+
appraisal
|
|
75
|
+
beetle (>= 0.4.6)
|
|
76
|
+
byebug
|
|
77
|
+
dalli
|
|
78
|
+
memcached (~> 1.8.0)
|
|
79
|
+
minitest (~> 5.5)
|
|
80
|
+
mocha
|
|
81
|
+
mysql2
|
|
82
|
+
rake (~> 10.5.0)
|
|
83
|
+
redis
|
|
84
|
+
sequel
|
|
85
|
+
time_bandits!
|
|
86
|
+
|
|
87
|
+
BUNDLED WITH
|
|
88
|
+
1.15.1
|
|
@@ -84,7 +84,25 @@ module ActiveRecord
|
|
|
84
84
|
public
|
|
85
85
|
|
|
86
86
|
private
|
|
87
|
-
if Rails::VERSION::STRING >= "5.
|
|
87
|
+
if Rails::VERSION::STRING >= "5.1"
|
|
88
|
+
def log_sql_statement(payload, event)
|
|
89
|
+
name = '%s (%.1fms)' % [payload[:name], event.duration]
|
|
90
|
+
sql = payload[:sql].squeeze(' ')
|
|
91
|
+
binds = nil
|
|
92
|
+
|
|
93
|
+
unless (payload[:binds] || []).empty?
|
|
94
|
+
casted_params = type_casted_binds(payload[:binds], payload[:type_casted_binds])
|
|
95
|
+
binds = " " + payload[:binds].zip(casted_params).map { |attr, value|
|
|
96
|
+
render_bind(attr, value)
|
|
97
|
+
}.inspect
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
name = colorize_payload_name(name, payload[:name])
|
|
101
|
+
sql = color(sql, sql_color(sql), true)
|
|
102
|
+
|
|
103
|
+
debug " #{name} #{sql}#{binds}"
|
|
104
|
+
end
|
|
105
|
+
elsif Rails::VERSION::STRING >= "5.0"
|
|
88
106
|
def log_sql_statement(payload, event)
|
|
89
107
|
name = '%s (%.1fms)' % [payload[:name], event.duration]
|
|
90
108
|
sql = payload[:sql].squeeze(' ')
|
data/lib/time_bandits/version.rb
CHANGED
|
@@ -49,10 +49,11 @@ class GCConsumerTest < Test::Unit::TestCase
|
|
|
49
49
|
def check_work
|
|
50
50
|
GC.start
|
|
51
51
|
m = TimeBandits.metrics
|
|
52
|
+
number_class = RUBY_VERSION >= "2.4.0" ? Integer : Fixnum
|
|
52
53
|
if GC.respond_to?(:time)
|
|
53
54
|
assert_operator 0, :<, m[:gc_calls]
|
|
54
55
|
assert_operator 0, :<, m[:gc_time]
|
|
55
|
-
assert_instance_of
|
|
56
|
+
assert_instance_of number_class, m[:heap_growth]
|
|
56
57
|
assert_operator 0, :<, m[:heap_size]
|
|
57
58
|
assert_operator 0, :<, m[:allocated_objects]
|
|
58
59
|
assert_operator 0, :<, m[:allocated_bytes]
|
|
@@ -60,7 +61,7 @@ class GCConsumerTest < Test::Unit::TestCase
|
|
|
60
61
|
else
|
|
61
62
|
assert_operator 0, :<, m[:gc_calls]
|
|
62
63
|
assert_operator 0, :<=, m[:gc_time]
|
|
63
|
-
assert_instance_of
|
|
64
|
+
assert_instance_of number_class, m[:heap_growth]
|
|
64
65
|
assert_operator 0, :<, m[:heap_size]
|
|
65
66
|
assert_operator 0, :<, m[:allocated_objects]
|
|
66
67
|
assert_operator 0, :<=, m[:allocated_bytes]
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: time_bandits
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.10.
|
|
4
|
+
version: 0.10.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stefan Kaes
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-07-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thread_variables
|
|
@@ -231,7 +231,7 @@ files:
|
|
|
231
231
|
- ".travis.yml"
|
|
232
232
|
- Appraisals
|
|
233
233
|
- Gemfile
|
|
234
|
-
- README.
|
|
234
|
+
- README.md
|
|
235
235
|
- Rakefile
|
|
236
236
|
- TODO
|
|
237
237
|
- docker-compose.yml
|
|
@@ -239,10 +239,16 @@ files:
|
|
|
239
239
|
- gemfiles/activesupport_4.1.16.gemfile.lock
|
|
240
240
|
- gemfiles/activesupport_4.2.8.gemfile
|
|
241
241
|
- gemfiles/activesupport_4.2.8.gemfile.lock
|
|
242
|
+
- gemfiles/activesupport_4.2.9.gemfile
|
|
243
|
+
- gemfiles/activesupport_4.2.9.gemfile.lock
|
|
242
244
|
- gemfiles/activesupport_5.0.3.gemfile
|
|
243
245
|
- gemfiles/activesupport_5.0.3.gemfile.lock
|
|
246
|
+
- gemfiles/activesupport_5.0.4.gemfile
|
|
247
|
+
- gemfiles/activesupport_5.0.4.gemfile.lock
|
|
244
248
|
- gemfiles/activesupport_5.1.1.gemfile
|
|
245
249
|
- gemfiles/activesupport_5.1.1.gemfile.lock
|
|
250
|
+
- gemfiles/activesupport_5.1.2.gemfile
|
|
251
|
+
- gemfiles/activesupport_5.1.2.gemfile.lock
|
|
246
252
|
- lib/time_bandits.rb
|
|
247
253
|
- lib/time_bandits/monkey_patches/action_controller.rb
|
|
248
254
|
- lib/time_bandits/monkey_patches/active_record.rb
|
|
@@ -298,7 +304,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
298
304
|
version: '0'
|
|
299
305
|
requirements: []
|
|
300
306
|
rubyforge_project:
|
|
301
|
-
rubygems_version: 2.6.
|
|
307
|
+
rubygems_version: 2.6.12
|
|
302
308
|
signing_key:
|
|
303
309
|
specification_version: 4
|
|
304
310
|
summary: Custom performance logging for Rails
|