active_record_stats 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.simplecov +6 -0
- data/.travis.yml +15 -0
- data/README.md +8 -1
- data/active_record_stats.gemspec +1 -0
- data/lib/active_record_stats/rack_middleware.rb +1 -1
- data/lib/active_record_stats/version.rb +1 -1
- metadata +43 -29
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MTU1Y2M4Y2Y2MDhmNWVhMWQ4YzYzMzE5ODQ2MDE4ZDA4OWE1YzZkZg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NzgwZDJlZGE5ODJiYjY3OGQzNjgzYmE4NzQ0Y2FiOWI5NGI5ZDJjYw==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YzcwYWZjNDg4YWQyOTY1OTg5MGRiOGFhMzIyZWFhYzVmNzlmNjU3Yzc1NmNi
|
10
|
+
Y2Y0MTRhZGU3YTBjMDNhMmNhM2E5Yzc3OTg2NzNhYWRhMDE3Yjg5YWQ2MTY5
|
11
|
+
MzRmNzRiYjkwNjZhMGVhYTJjMTlkM2NmNDMzNDU0YmRlMzE3Nzk=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ODkyMTY0Y2UwZmZmMmVhZjVhZWQzNTBlZTM1ZTMzMzc4NThkZGM0NmUwNTg2
|
14
|
+
ZDEyNmRlNzUwYzkwZDhmY2Y3OTIxZDIxMmM3MGExN2U3YzEwYjEwM2JkYzNj
|
15
|
+
ODAxOTA5ZTRhYTI0ZDg1MDg4ODQ0OTYzYzIwYTdmMGMyMGEzZTQ=
|
data/.simplecov
ADDED
data/.travis.yml
CHANGED
@@ -6,4 +6,19 @@ rvm:
|
|
6
6
|
|
7
7
|
before_install:
|
8
8
|
- gem install bundler -v 1.11.2
|
9
|
+
|
10
|
+
before_script:
|
9
11
|
- bin/setup
|
12
|
+
|
13
|
+
deploy:
|
14
|
+
provider: rubygems
|
15
|
+
api_key:
|
16
|
+
secure: hP/f6DldhG0RrlDxnPNHeOsg2JaIdR2sw8D1TVQeSReGgaoHM55k2BJnCzMglqdGd9TtyBpN+O0B10oSZ0HylBhm6+nYlkxkLvFlCoKz9VjGJPZeW32qRcTnfKw+yl24M1BTt/quZH+e0mjpAcj3rXxuA0aR74bHrBUabhqcvi5YRosKNKRmqOb4gmj+pLSNs9p8ftK5onIwx3vmKhuuK96Ba+xpF1KPAet9BejzaOeqoMb0p7o6fw029r95TshiXex8J/yLegn61w28PG3dC8HDDV9te4xf7151T3a6PQKnXgR9o3oz2SGoK3OH3qzyR5JB/0Fszd1P89wVing5eEOq6sM+++pX7+sslS2vKSTQfbRGIe2o47L0HBlYC8/m3GTwTDWQ9BRd8vItDUC4GNI5fEj74CoOLQ0+QBsVdotGJq3kl/EN96L6ODNhMEKeAr6AVngwP74XK30qW3XH+Cni3Dnz1CUi3Tpso7xjQC1AEJd7YP+yVdqduwJpiIu5BqFGizBdvyp5+gGFBftxRaWbW0lMEs5YJ5yZWNejO5q0jZCGgkEXH7UPo7G0bpMIinJ7o9SEbICBT/1Gm6nmV04krP+su+qAveIyMcZcmyyjn1OXQ5Hehkf6FuHmFJGcv3Jd+a0hjgjLgSBVlBzIrYADBDGX4W/FZWJBNv75OtE=
|
17
|
+
gem: active_record_stats
|
18
|
+
on:
|
19
|
+
tags: true
|
20
|
+
repo: enova/active_record_stats
|
21
|
+
|
22
|
+
env:
|
23
|
+
global:
|
24
|
+
secure: oJ83X6WVeW7owbJ2Lj6wfGepDDCPtYohgBW9ShDZcc4Lb8FcvQ3+iz3GoS1i9L1Z995wnku894KemN2t0Ntr347e0vlpibH5ffCQIKhSMmjyGGSIIfNS9YaCSPV/fvwTPgxBby2sszUdzLQA4nR7tMGg0WQIeXCTUOUvU8EuIevY51oWLwKlbBcj1ZKBt6qZCMEfXuleuOzouKVcS6PHF2NuSckDSZ/7kA99jQL5AOORoL851G9eMbtiSbrUIgI+GqF7jAwPmC1XneR5lCq4Tq9iEoEJp/Vi56l7Ur2/WeLX01gl/bCqCk7Ty1ISYAynyT5Uiu3kXeI/bDRDiclOSbUa7YOAI6thWC6RyjC4wJ0wu8n58ONjkaiX/qaixx8gfL7nkEUGrn4qDhtY2rizTS7zde7+H0Q6MpASB9WhAnXvFSEROR7aQf4VeMdaznvc1Bio8fyoNi5ca/a+EcsCBnFg+qVQ1I5o4NR7Qaz39BZjsqQqwGRME1ND/UWQVta9eWKDIg65sbgRZmD6TI25lHxQaAIiVyFANRDdYYlO6WWEfFZg4auJJpiczkJgudbbckQ9m0xoz33ZFxgjJN3E4wK3ojMJ20YwQyVa4nQ5KeoQP6NT793IQ9ANjmR8rKcyFWDKM52oTv4x2AgW0vQo2lnTCC+n8vY9p/GcflEZbc8=
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# ActiveRecordStats
|
1
|
+
# ActiveRecordStats [![Build Status](https://travis-ci.org/enova/active_record_stats.svg?branch=master)](https://travis-ci.org/enova/active_record_stats) [![Coverage Status](https://coveralls.io/repos/github/enova/active_record_stats/badge.svg?branch=master)](https://coveralls.io/github/enova/active_record_stats?branch=master)
|
2
2
|
|
3
3
|
Provides Rails, Resque, and Sidekiq integrations for emitting metrics
|
4
4
|
about ActiveRecord usage to StatsD using Shopify's [statsd-instrument][].
|
@@ -74,6 +74,13 @@ Example metrics that might be emitted:
|
|
74
74
|
* `db.job.cache__prime.SELECT:10|g`: ten `SELECT` statements were issued when
|
75
75
|
processing the `Cache::Prime` job.
|
76
76
|
|
77
|
+
## Caveats
|
78
|
+
|
79
|
+
This library does not actually parse SQL queries; it uses a [very naive string munging
|
80
|
+
tactic](https://github.com/enova/active_record_stats/blob/master/spec/statement_type_spec.rb)
|
81
|
+
to identify the statement type involved. Because of this, some of the metrics are a
|
82
|
+
bit nonsensical, such as `WITH` statements being reported when a query begins with a CTE.
|
83
|
+
|
77
84
|
## License
|
78
85
|
|
79
86
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/active_record_stats.gemspec
CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
27
27
|
spec.add_development_dependency "rspec", "~> 3.0"
|
28
28
|
spec.add_development_dependency 'pry', '~> 0.10'
|
29
|
+
spec.add_development_dependency 'coveralls', '~> 0.8'
|
29
30
|
|
30
31
|
spec.add_development_dependency 'pg', '~> 0.18'
|
31
32
|
spec.add_development_dependency 'actionpack', '~> 4.0'
|
@@ -37,7 +37,7 @@ module ActiveRecordStats
|
|
37
37
|
|
38
38
|
ensure
|
39
39
|
request_params = env[ENV_KEY]
|
40
|
-
if controller = request_params['controller']
|
40
|
+
if request_params && controller = request_params['controller']
|
41
41
|
controller = controller.gsub('/', '__')
|
42
42
|
action = request_params['action']
|
43
43
|
emit(controller, action, db_time, totals)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_stats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Hargraves
|
@@ -14,132 +14,146 @@ dependencies:
|
|
14
14
|
name: activerecord
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: statsd-instrument
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.0'
|
34
|
-
- -
|
34
|
+
- - ! '>='
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: 2.0.4
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- -
|
41
|
+
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '2.0'
|
44
|
-
- -
|
44
|
+
- - ! '>='
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 2.0.4
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '1.11'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - ~>
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '1.11'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rake
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- -
|
65
|
+
- - ~>
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '10.0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - ~>
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '10.0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: rspec
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - ~>
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '3.0'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- -
|
86
|
+
- - ~>
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '3.0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: pry
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- -
|
93
|
+
- - ~>
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '0.10'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- -
|
100
|
+
- - ~>
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0.10'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: coveralls
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0.8'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ~>
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0.8'
|
103
117
|
- !ruby/object:Gem::Dependency
|
104
118
|
name: pg
|
105
119
|
requirement: !ruby/object:Gem::Requirement
|
106
120
|
requirements:
|
107
|
-
- -
|
121
|
+
- - ~>
|
108
122
|
- !ruby/object:Gem::Version
|
109
123
|
version: '0.18'
|
110
124
|
type: :development
|
111
125
|
prerelease: false
|
112
126
|
version_requirements: !ruby/object:Gem::Requirement
|
113
127
|
requirements:
|
114
|
-
- -
|
128
|
+
- - ~>
|
115
129
|
- !ruby/object:Gem::Version
|
116
130
|
version: '0.18'
|
117
131
|
- !ruby/object:Gem::Dependency
|
118
132
|
name: actionpack
|
119
133
|
requirement: !ruby/object:Gem::Requirement
|
120
134
|
requirements:
|
121
|
-
- -
|
135
|
+
- - ~>
|
122
136
|
- !ruby/object:Gem::Version
|
123
137
|
version: '4.0'
|
124
138
|
type: :development
|
125
139
|
prerelease: false
|
126
140
|
version_requirements: !ruby/object:Gem::Requirement
|
127
141
|
requirements:
|
128
|
-
- -
|
142
|
+
- - ~>
|
129
143
|
- !ruby/object:Gem::Version
|
130
144
|
version: '4.0'
|
131
145
|
- !ruby/object:Gem::Dependency
|
132
146
|
name: rack-test
|
133
147
|
requirement: !ruby/object:Gem::Requirement
|
134
148
|
requirements:
|
135
|
-
- -
|
149
|
+
- - ~>
|
136
150
|
- !ruby/object:Gem::Version
|
137
151
|
version: '0.6'
|
138
152
|
type: :development
|
139
153
|
prerelease: false
|
140
154
|
version_requirements: !ruby/object:Gem::Requirement
|
141
155
|
requirements:
|
142
|
-
- -
|
156
|
+
- - ~>
|
143
157
|
- !ruby/object:Gem::Version
|
144
158
|
version: '0.6'
|
145
159
|
description: ActiveRecord instrumentation for Rails, Resque and Sidekiq
|
@@ -149,10 +163,11 @@ executables: []
|
|
149
163
|
extensions: []
|
150
164
|
extra_rdoc_files: []
|
151
165
|
files:
|
152
|
-
-
|
153
|
-
-
|
154
|
-
-
|
155
|
-
-
|
166
|
+
- .gitignore
|
167
|
+
- .rspec
|
168
|
+
- .ruby-version
|
169
|
+
- .simplecov
|
170
|
+
- .travis.yml
|
156
171
|
- Gemfile
|
157
172
|
- LICENSE.txt
|
158
173
|
- README.md
|
@@ -175,19 +190,18 @@ require_paths:
|
|
175
190
|
- lib
|
176
191
|
required_ruby_version: !ruby/object:Gem::Requirement
|
177
192
|
requirements:
|
178
|
-
- -
|
193
|
+
- - ! '>='
|
179
194
|
- !ruby/object:Gem::Version
|
180
195
|
version: '0'
|
181
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
197
|
requirements:
|
183
|
-
- -
|
198
|
+
- - ! '>='
|
184
199
|
- !ruby/object:Gem::Version
|
185
200
|
version: '0'
|
186
201
|
requirements: []
|
187
202
|
rubyforge_project:
|
188
|
-
rubygems_version: 2.5
|
203
|
+
rubygems_version: 2.4.5
|
189
204
|
signing_key:
|
190
205
|
specification_version: 4
|
191
206
|
summary: Emit ActiveRecord query counts and runtime to StatsD
|
192
207
|
test_files: []
|
193
|
-
has_rdoc:
|