inst-jobs-statsd 2.1.0 → 2.1.1

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: c7d2f71f91477c6e30a43226165ea6506e6e7b186f3fcf4876ce3b99d8595cd1
4
- data.tar.gz: a57c33ba7eb726155f0aa767a18dffc7cfb39f0faae21c51133d233076f7954d
3
+ metadata.gz: b7109a5cd6de633fa11fc099411ebee5734f42e70fc5647d548bb6b0b600fdd2
4
+ data.tar.gz: dc22dd71405515b383151a3bf96549f8544102bf53ef4f676b50560bb01cff17
5
5
  SHA512:
6
- metadata.gz: 7a692a9342cceb3ab900493cda108515956203e30d83acd048b96f3da2a9978f59ea711196aac5ed1c0156001847bd06548a36cd2b8e395be80a2309f077a620
7
- data.tar.gz: 70018e665a4e434fc6828391d0f67f753fb09569db8991baee0d44bfa72c73b9b3e770d5ecf8d6e0f1173961497ca586c96c552c10dfdef746c97157aea501e1
6
+ metadata.gz: efdc1e13bc1101c87497433447a11b71300ca5dae150b80d0c3cb036fbdf7538bc0f82086f5ddfb65f8b4c8a0356c5425a4c66e9a0d8172a922f28d5426f1b95
7
+ data.tar.gz: 64dfa45fd9551d1507ed79d2f4e06d828614fe26e261e427e9f85418cfaad8e4aff9a934f9fd993487b4fa5000cf39a1bf6546290fea204c941dc58e7da037f3
@@ -9,7 +9,6 @@ require_relative 'inst_jobs_statsd/jobs_tracker'
9
9
  require_relative 'inst_jobs_statsd/naming'
10
10
 
11
11
  require_relative 'inst_jobs_statsd/stats/counters'
12
- require_relative 'inst_jobs_statsd/stats/counters/failed'
13
12
  require_relative 'inst_jobs_statsd/stats/counters/run'
14
13
 
15
14
  require_relative 'inst_jobs_statsd/stats/periodic'
@@ -21,5 +20,6 @@ require_relative 'inst_jobs_statsd/stats/timing'
21
20
  require_relative 'inst_jobs_statsd/stats/timing/failed'
22
21
  require_relative 'inst_jobs_statsd/stats/timing/perform'
23
22
  require_relative 'inst_jobs_statsd/stats/timing/pop'
23
+ require_relative 'inst_jobs_statsd/ext/job'
24
24
 
25
25
  ::InstStatsd::DefaultTracking.include InstJobsStatsd::DefaultTracking
@@ -0,0 +1,11 @@
1
+ module InstJobsStatsd
2
+ module Ext
3
+ module Job
4
+ def fail!
5
+ failed_job = super
6
+ InstJobsStatsd::Stats::Counters.report_count(:failed, 1, job: failed_job)
7
+ failed_job
8
+ end
9
+ end
10
+ end
11
+ end
@@ -9,8 +9,8 @@ module InstJobsStatsd
9
9
  end
10
10
 
11
11
  def initialize(enable_periodic_queries: true)
12
- Stats::Counters::Failed.enable
13
12
  Stats::Counters::Run.enable
13
+ ::Delayed::Job.prepend InstJobsStatsd::Ext::Job
14
14
 
15
15
  if enable_periodic_queries
16
16
  Stats::Periodic::Failed.enable
@@ -82,7 +82,7 @@ module InstJobsStatsd
82
82
 
83
83
  def self.dd_region_tags
84
84
  return {} unless ENV['INST_JOBS_STATSD_NAMESPACE']
85
- {namespace: ENV['INST_JOBS_STATSD_NAMESPACE']}
85
+ { namespace: ENV['INST_JOBS_STATSD_NAMESPACE'] }
86
86
  end
87
87
 
88
88
  private
@@ -91,7 +91,7 @@ module InstJobsStatsd
91
91
  obj_tag, method_tag = job.tag.split(/[\.#]/, 2).map do |v|
92
92
  InstStatsd::Statsd.escape(v).gsub('::', '-')
93
93
  end
94
- return method_tag, obj_tag
94
+ [method_tag, obj_tag]
95
95
  end
96
96
  end
97
97
  end
@@ -1,3 +1,3 @@
1
1
  module InstJobsStatsd
2
- VERSION = '2.1.0'.freeze
2
+ VERSION = '2.1.1'.freeze
3
3
  end
@@ -0,0 +1,206 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ inst-jobs-statsd (2.1.0)
5
+ inst-jobs (> 1.0, < 3.0)
6
+ inst_statsd (>= 2.1.2, < 3.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionmailer (4.2.11.1)
12
+ actionpack (= 4.2.11.1)
13
+ actionview (= 4.2.11.1)
14
+ activejob (= 4.2.11.1)
15
+ mail (~> 2.5, >= 2.5.4)
16
+ rails-dom-testing (~> 1.0, >= 1.0.5)
17
+ actionpack (4.2.11.1)
18
+ actionview (= 4.2.11.1)
19
+ activesupport (= 4.2.11.1)
20
+ rack (~> 1.6)
21
+ rack-test (~> 0.6.2)
22
+ rails-dom-testing (~> 1.0, >= 1.0.5)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
24
+ actionview (4.2.11.1)
25
+ activesupport (= 4.2.11.1)
26
+ builder (~> 3.1)
27
+ erubis (~> 2.7.0)
28
+ rails-dom-testing (~> 1.0, >= 1.0.5)
29
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
30
+ activejob (4.2.11.1)
31
+ activesupport (= 4.2.11.1)
32
+ globalid (>= 0.3.0)
33
+ activemodel (4.2.11.1)
34
+ activesupport (= 4.2.11.1)
35
+ builder (~> 3.1)
36
+ activerecord (4.2.11.1)
37
+ activemodel (= 4.2.11.1)
38
+ activesupport (= 4.2.11.1)
39
+ arel (~> 6.0)
40
+ activesupport (4.2.11.1)
41
+ i18n (~> 0.7)
42
+ minitest (~> 5.1)
43
+ thread_safe (~> 0.3, >= 0.3.4)
44
+ tzinfo (~> 1.1)
45
+ after_transaction_commit (1.1.2)
46
+ activerecord (>= 4.0)
47
+ arel (6.0.4)
48
+ aroi (0.0.7)
49
+ rails (>= 3.2)
50
+ ast (2.4.0)
51
+ builder (3.2.4)
52
+ bump (0.8.0)
53
+ byebug (11.1.1)
54
+ coderay (1.1.2)
55
+ concurrent-ruby (1.1.5)
56
+ crass (1.0.6)
57
+ database_cleaner (1.7.0)
58
+ debug_inspector (0.0.3)
59
+ diff-lcs (1.3)
60
+ docile (1.3.2)
61
+ dogstatsd-ruby (4.8.2)
62
+ erubis (2.7.0)
63
+ et-orbi (1.2.4)
64
+ tzinfo
65
+ factory_girl (4.9.0)
66
+ activesupport (>= 3.0.0)
67
+ fugit (1.4.2)
68
+ et-orbi (~> 1.1, >= 1.1.8)
69
+ raabro (~> 1.4)
70
+ globalid (0.4.2)
71
+ activesupport (>= 4.2.0)
72
+ i18n (0.9.5)
73
+ concurrent-ruby (~> 1.0)
74
+ inst-jobs (1.0.4)
75
+ activerecord (>= 4.2)
76
+ activesupport (>= 4.2)
77
+ after_transaction_commit (>= 1.0, < 3)
78
+ debug_inspector (~> 0.0.3)
79
+ fugit (~> 1.3)
80
+ railties (>= 4.2)
81
+ redis (> 3.0)
82
+ redis-scripting (~> 1.0.1)
83
+ inst_statsd (2.1.6)
84
+ aroi (~> 0.0.7)
85
+ dogstatsd-ruby (~> 4.2)
86
+ statsd-ruby (~> 1.0)
87
+ json (2.3.0)
88
+ loofah (2.4.0)
89
+ crass (~> 1.0.2)
90
+ nokogiri (>= 1.5.9)
91
+ mail (2.7.1)
92
+ mini_mime (>= 0.1.1)
93
+ method_source (0.9.2)
94
+ mini_mime (1.0.2)
95
+ mini_portile2 (2.4.0)
96
+ minitest (5.14.0)
97
+ nokogiri (1.10.7)
98
+ mini_portile2 (~> 2.4.0)
99
+ parser (2.7.0.2)
100
+ ast (~> 2.4.0)
101
+ pg (0.21.0)
102
+ powerpack (0.1.2)
103
+ pry (0.12.2)
104
+ coderay (~> 1.1.0)
105
+ method_source (~> 0.9.0)
106
+ raabro (1.4.0)
107
+ rack (1.6.12)
108
+ rack-test (0.6.3)
109
+ rack (>= 1.0)
110
+ rails (4.2.11.1)
111
+ actionmailer (= 4.2.11.1)
112
+ actionpack (= 4.2.11.1)
113
+ actionview (= 4.2.11.1)
114
+ activejob (= 4.2.11.1)
115
+ activemodel (= 4.2.11.1)
116
+ activerecord (= 4.2.11.1)
117
+ activesupport (= 4.2.11.1)
118
+ bundler (>= 1.3.0, < 2.0)
119
+ railties (= 4.2.11.1)
120
+ sprockets-rails
121
+ rails-deprecated_sanitizer (1.0.3)
122
+ activesupport (>= 4.2.0.alpha)
123
+ rails-dom-testing (1.0.9)
124
+ activesupport (>= 4.2.0, < 5.0)
125
+ nokogiri (~> 1.6)
126
+ rails-deprecated_sanitizer (>= 1.0.1)
127
+ rails-html-sanitizer (1.3.0)
128
+ loofah (~> 2.3)
129
+ railties (4.2.11.1)
130
+ actionpack (= 4.2.11.1)
131
+ activesupport (= 4.2.11.1)
132
+ rake (>= 0.8.7)
133
+ thor (>= 0.18.1, < 2.0)
134
+ rainbow (2.2.2)
135
+ rake
136
+ rake (13.0.1)
137
+ redis (4.2.5)
138
+ redis-scripting (1.0.1)
139
+ redis (>= 3.0)
140
+ rspec (3.9.0)
141
+ rspec-core (~> 3.9.0)
142
+ rspec-expectations (~> 3.9.0)
143
+ rspec-mocks (~> 3.9.0)
144
+ rspec-core (3.9.1)
145
+ rspec-support (~> 3.9.1)
146
+ rspec-expectations (3.9.0)
147
+ diff-lcs (>= 1.2.0, < 2.0)
148
+ rspec-support (~> 3.9.0)
149
+ rspec-mocks (3.9.1)
150
+ diff-lcs (>= 1.2.0, < 2.0)
151
+ rspec-support (~> 3.9.0)
152
+ rspec-support (3.9.2)
153
+ rubocop (0.48.1)
154
+ parser (>= 2.3.3.1, < 3.0)
155
+ powerpack (~> 0.1)
156
+ rainbow (>= 1.99.1, < 3.0)
157
+ ruby-progressbar (~> 1.7)
158
+ unicode-display_width (~> 1.0, >= 1.0.1)
159
+ ruby-progressbar (1.10.1)
160
+ simplecov (0.17.1)
161
+ docile (~> 1.1)
162
+ json (>= 1.8, < 3)
163
+ simplecov-html (~> 0.10.0)
164
+ simplecov-html (0.10.2)
165
+ sprockets (3.7.2)
166
+ concurrent-ruby (~> 1.0)
167
+ rack (> 1, < 3)
168
+ sprockets-rails (3.2.1)
169
+ actionpack (>= 4.0)
170
+ activesupport (>= 4.0)
171
+ sprockets (>= 3.0.0)
172
+ statsd-ruby (1.5.0)
173
+ test_after_commit (1.1.0)
174
+ activerecord (>= 3.2)
175
+ thor (1.0.1)
176
+ thread_safe (0.3.6)
177
+ timecop (0.9.1)
178
+ tzinfo (1.2.6)
179
+ thread_safe (~> 0.1)
180
+ unicode-display_width (1.6.1)
181
+ wwtd (1.4.0)
182
+
183
+ PLATFORMS
184
+ ruby
185
+
186
+ DEPENDENCIES
187
+ after_transaction_commit (< 2)
188
+ bump
189
+ bundler
190
+ byebug
191
+ database_cleaner (~> 1.7)
192
+ factory_girl
193
+ inst-jobs-statsd!
194
+ pg (~> 0.21.0)
195
+ pry
196
+ rails (~> 4.2.11)
197
+ rake
198
+ rspec (~> 3.9)
199
+ rubocop (~> 0.48.0)
200
+ simplecov (~> 0.17)
201
+ test_after_commit (= 1.1.0)
202
+ timecop
203
+ wwtd (~> 1.4.0)
204
+
205
+ BUNDLED WITH
206
+ 1.17.3
@@ -0,0 +1,231 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ inst-jobs-statsd (2.1.0)
5
+ inst-jobs (> 1.0, < 3.0)
6
+ inst_statsd (>= 2.1.2, < 3.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actioncable (5.1.7)
12
+ actionpack (= 5.1.7)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (~> 0.6.1)
15
+ actionmailer (5.1.7)
16
+ actionpack (= 5.1.7)
17
+ actionview (= 5.1.7)
18
+ activejob (= 5.1.7)
19
+ mail (~> 2.5, >= 2.5.4)
20
+ rails-dom-testing (~> 2.0)
21
+ actionpack (5.1.7)
22
+ actionview (= 5.1.7)
23
+ activesupport (= 5.1.7)
24
+ rack (~> 2.0)
25
+ rack-test (>= 0.6.3)
26
+ rails-dom-testing (~> 2.0)
27
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
+ actionview (5.1.7)
29
+ activesupport (= 5.1.7)
30
+ builder (~> 3.1)
31
+ erubi (~> 1.4)
32
+ rails-dom-testing (~> 2.0)
33
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
34
+ activejob (5.1.7)
35
+ activesupport (= 5.1.7)
36
+ globalid (>= 0.3.6)
37
+ activemodel (5.1.7)
38
+ activesupport (= 5.1.7)
39
+ activerecord (5.1.7)
40
+ activemodel (= 5.1.7)
41
+ activesupport (= 5.1.7)
42
+ arel (~> 8.0)
43
+ activesupport (5.1.7)
44
+ concurrent-ruby (~> 1.0, >= 1.0.2)
45
+ i18n (>= 0.7, < 2)
46
+ minitest (~> 5.1)
47
+ tzinfo (~> 1.1)
48
+ after_transaction_commit (2.1.0)
49
+ activerecord (>= 5.0)
50
+ arel (8.0.0)
51
+ aroi (0.0.7)
52
+ rails (>= 3.2)
53
+ ast (2.4.0)
54
+ backports (3.15.0)
55
+ builder (3.2.4)
56
+ bump (0.8.0)
57
+ byebug (11.1.1)
58
+ coderay (1.1.2)
59
+ concurrent-ruby (1.1.5)
60
+ crass (1.0.6)
61
+ database_cleaner (1.7.0)
62
+ debug_inspector (0.0.3)
63
+ diff-lcs (1.3)
64
+ docile (1.3.2)
65
+ dogstatsd-ruby (4.8.2)
66
+ erubi (1.9.0)
67
+ et-orbi (1.2.4)
68
+ tzinfo
69
+ factory_girl (4.9.0)
70
+ activesupport (>= 3.0.0)
71
+ fugit (1.4.2)
72
+ et-orbi (~> 1.1, >= 1.1.8)
73
+ raabro (~> 1.4)
74
+ globalid (0.4.2)
75
+ activesupport (>= 4.2.0)
76
+ i18n (1.8.2)
77
+ concurrent-ruby (~> 1.0)
78
+ inst-jobs (1.0.4)
79
+ activerecord (>= 4.2)
80
+ activesupport (>= 4.2)
81
+ after_transaction_commit (>= 1.0, < 3)
82
+ debug_inspector (~> 0.0.3)
83
+ fugit (~> 1.3)
84
+ railties (>= 4.2)
85
+ redis (> 3.0)
86
+ redis-scripting (~> 1.0.1)
87
+ inst_statsd (2.1.6)
88
+ aroi (~> 0.0.7)
89
+ dogstatsd-ruby (~> 4.2)
90
+ statsd-ruby (~> 1.0)
91
+ json (2.3.0)
92
+ loofah (2.4.0)
93
+ crass (~> 1.0.2)
94
+ nokogiri (>= 1.5.9)
95
+ mail (2.7.1)
96
+ mini_mime (>= 0.1.1)
97
+ method_source (0.9.2)
98
+ mini_mime (1.0.2)
99
+ mini_portile2 (2.4.0)
100
+ minitest (5.14.0)
101
+ multi_json (1.14.1)
102
+ mustermann (1.1.1)
103
+ ruby2_keywords (~> 0.0.1)
104
+ nio4r (2.5.2)
105
+ nokogiri (1.10.7)
106
+ mini_portile2 (~> 2.4.0)
107
+ parser (2.7.0.2)
108
+ ast (~> 2.4.0)
109
+ pg (1.2.2)
110
+ powerpack (0.1.2)
111
+ pry (0.12.2)
112
+ coderay (~> 1.1.0)
113
+ method_source (~> 0.9.0)
114
+ raabro (1.4.0)
115
+ rack (2.1.1)
116
+ rack-protection (2.0.8.1)
117
+ rack
118
+ rack-test (1.1.0)
119
+ rack (>= 1.0, < 3)
120
+ rails (5.1.7)
121
+ actioncable (= 5.1.7)
122
+ actionmailer (= 5.1.7)
123
+ actionpack (= 5.1.7)
124
+ actionview (= 5.1.7)
125
+ activejob (= 5.1.7)
126
+ activemodel (= 5.1.7)
127
+ activerecord (= 5.1.7)
128
+ activesupport (= 5.1.7)
129
+ bundler (>= 1.3.0)
130
+ railties (= 5.1.7)
131
+ sprockets-rails (>= 2.0.0)
132
+ rails-dom-testing (2.0.3)
133
+ activesupport (>= 4.2.0)
134
+ nokogiri (>= 1.6)
135
+ rails-html-sanitizer (1.3.0)
136
+ loofah (~> 2.3)
137
+ railties (5.1.7)
138
+ actionpack (= 5.1.7)
139
+ activesupport (= 5.1.7)
140
+ method_source
141
+ rake (>= 0.8.7)
142
+ thor (>= 0.18.1, < 2.0)
143
+ rainbow (2.2.2)
144
+ rake
145
+ rake (13.0.1)
146
+ redis (4.2.5)
147
+ redis-scripting (1.0.1)
148
+ redis (>= 3.0)
149
+ rspec (3.9.0)
150
+ rspec-core (~> 3.9.0)
151
+ rspec-expectations (~> 3.9.0)
152
+ rspec-mocks (~> 3.9.0)
153
+ rspec-core (3.9.1)
154
+ rspec-support (~> 3.9.1)
155
+ rspec-expectations (3.9.0)
156
+ diff-lcs (>= 1.2.0, < 2.0)
157
+ rspec-support (~> 3.9.0)
158
+ rspec-mocks (3.9.1)
159
+ diff-lcs (>= 1.2.0, < 2.0)
160
+ rspec-support (~> 3.9.0)
161
+ rspec-support (3.9.2)
162
+ rubocop (0.48.1)
163
+ parser (>= 2.3.3.1, < 3.0)
164
+ powerpack (~> 0.1)
165
+ rainbow (>= 1.99.1, < 3.0)
166
+ ruby-progressbar (~> 1.7)
167
+ unicode-display_width (~> 1.0, >= 1.0.1)
168
+ ruby-progressbar (1.10.1)
169
+ ruby2_keywords (0.0.2)
170
+ simplecov (0.17.1)
171
+ docile (~> 1.1)
172
+ json (>= 1.8, < 3)
173
+ simplecov-html (~> 0.10.0)
174
+ simplecov-html (0.10.2)
175
+ sinatra (2.0.8.1)
176
+ mustermann (~> 1.0)
177
+ rack (~> 2.0)
178
+ rack-protection (= 2.0.8.1)
179
+ tilt (~> 2.0)
180
+ sinatra-contrib (2.0.8.1)
181
+ backports (>= 2.8.2)
182
+ multi_json
183
+ mustermann (~> 1.0)
184
+ rack-protection (= 2.0.8.1)
185
+ sinatra (= 2.0.8.1)
186
+ tilt (~> 2.0)
187
+ sprockets (3.7.2)
188
+ concurrent-ruby (~> 1.0)
189
+ rack (> 1, < 3)
190
+ sprockets-rails (3.2.1)
191
+ actionpack (>= 4.0)
192
+ activesupport (>= 4.0)
193
+ sprockets (>= 3.0.0)
194
+ statsd-ruby (1.5.0)
195
+ thor (1.0.1)
196
+ thread_safe (0.3.6)
197
+ tilt (2.0.10)
198
+ timecop (0.9.1)
199
+ tzinfo (1.2.6)
200
+ thread_safe (~> 0.1)
201
+ unicode-display_width (1.6.1)
202
+ websocket-driver (0.6.5)
203
+ websocket-extensions (>= 0.1.0)
204
+ websocket-extensions (0.1.4)
205
+ wwtd (1.4.0)
206
+
207
+ PLATFORMS
208
+ ruby
209
+
210
+ DEPENDENCIES
211
+ bump
212
+ bundler
213
+ byebug
214
+ database_cleaner (~> 1.7)
215
+ factory_girl
216
+ inst-jobs-statsd!
217
+ pg (~> 1.2)
218
+ pry
219
+ rails (~> 5.1.7)
220
+ rake
221
+ rspec (~> 3.9)
222
+ rubocop (~> 0.48.0)
223
+ simplecov (~> 0.17)
224
+ sinatra (~> 2.0.8)
225
+ sinatra-contrib (~> 2.0.8)
226
+ sprockets (~> 3.7)
227
+ timecop
228
+ wwtd (~> 1.4.0)
229
+
230
+ BUNDLED WITH
231
+ 1.17.3
@@ -0,0 +1,259 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ inst-jobs-statsd (2.1.0)
5
+ inst-jobs (> 1.0, < 3.0)
6
+ inst_statsd (>= 2.1.2, < 3.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actioncable (6.1.3)
12
+ actionpack (= 6.1.3)
13
+ activesupport (= 6.1.3)
14
+ nio4r (~> 2.0)
15
+ websocket-driver (>= 0.6.1)
16
+ actionmailbox (6.1.3)
17
+ actionpack (= 6.1.3)
18
+ activejob (= 6.1.3)
19
+ activerecord (= 6.1.3)
20
+ activestorage (= 6.1.3)
21
+ activesupport (= 6.1.3)
22
+ mail (>= 2.7.1)
23
+ actionmailer (6.1.3)
24
+ actionpack (= 6.1.3)
25
+ actionview (= 6.1.3)
26
+ activejob (= 6.1.3)
27
+ activesupport (= 6.1.3)
28
+ mail (~> 2.5, >= 2.5.4)
29
+ rails-dom-testing (~> 2.0)
30
+ actionpack (6.1.3)
31
+ actionview (= 6.1.3)
32
+ activesupport (= 6.1.3)
33
+ rack (~> 2.0, >= 2.0.9)
34
+ rack-test (>= 0.6.3)
35
+ rails-dom-testing (~> 2.0)
36
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
37
+ actiontext (6.1.3)
38
+ actionpack (= 6.1.3)
39
+ activerecord (= 6.1.3)
40
+ activestorage (= 6.1.3)
41
+ activesupport (= 6.1.3)
42
+ nokogiri (>= 1.8.5)
43
+ actionview (6.1.3)
44
+ activesupport (= 6.1.3)
45
+ builder (~> 3.1)
46
+ erubi (~> 1.4)
47
+ rails-dom-testing (~> 2.0)
48
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
49
+ activejob (6.1.3)
50
+ activesupport (= 6.1.3)
51
+ globalid (>= 0.3.6)
52
+ activemodel (6.1.3)
53
+ activesupport (= 6.1.3)
54
+ activerecord (6.1.3)
55
+ activemodel (= 6.1.3)
56
+ activesupport (= 6.1.3)
57
+ activestorage (6.1.3)
58
+ actionpack (= 6.1.3)
59
+ activejob (= 6.1.3)
60
+ activerecord (= 6.1.3)
61
+ activesupport (= 6.1.3)
62
+ marcel (~> 0.3.1)
63
+ mimemagic (~> 0.3.2)
64
+ activesupport (6.1.3)
65
+ concurrent-ruby (~> 1.0, >= 1.0.2)
66
+ i18n (>= 1.6, < 2)
67
+ minitest (>= 5.1)
68
+ tzinfo (~> 2.0)
69
+ zeitwerk (~> 2.3)
70
+ after_transaction_commit (2.2.1)
71
+ activerecord (>= 5.2)
72
+ aroi (0.0.7)
73
+ rails (>= 3.2)
74
+ ast (2.4.2)
75
+ backports (3.20.2)
76
+ builder (3.2.4)
77
+ bump (0.10.0)
78
+ byebug (11.1.3)
79
+ coderay (1.1.3)
80
+ concurrent-ruby (1.1.8)
81
+ crass (1.0.6)
82
+ database_cleaner (1.99.0)
83
+ debug_inspector (0.0.3)
84
+ diff-lcs (1.4.4)
85
+ docile (1.3.5)
86
+ dogstatsd-ruby (4.8.2)
87
+ erubi (1.10.0)
88
+ et-orbi (1.2.4)
89
+ tzinfo
90
+ factory_girl (4.9.0)
91
+ activesupport (>= 3.0.0)
92
+ fugit (1.4.2)
93
+ et-orbi (~> 1.1, >= 1.1.8)
94
+ raabro (~> 1.4)
95
+ globalid (0.4.2)
96
+ activesupport (>= 4.2.0)
97
+ i18n (1.8.9)
98
+ concurrent-ruby (~> 1.0)
99
+ inst-jobs (2.2.0)
100
+ activerecord (>= 4.2)
101
+ activesupport (>= 4.2)
102
+ after_transaction_commit (>= 1.0, < 3)
103
+ debug_inspector (~> 0.0.3)
104
+ fugit (~> 1.3)
105
+ railties (>= 4.2)
106
+ redis (> 3.0)
107
+ redis-scripting (~> 1.0.1)
108
+ inst_statsd (2.1.6)
109
+ aroi (~> 0.0.7)
110
+ dogstatsd-ruby (~> 4.2)
111
+ statsd-ruby (~> 1.0)
112
+ loofah (2.9.0)
113
+ crass (~> 1.0.2)
114
+ nokogiri (>= 1.5.9)
115
+ mail (2.7.1)
116
+ mini_mime (>= 0.1.1)
117
+ marcel (0.3.3)
118
+ mimemagic (~> 0.3.2)
119
+ method_source (1.0.0)
120
+ mimemagic (0.3.5)
121
+ mini_mime (1.0.2)
122
+ mini_portile2 (2.5.0)
123
+ minitest (5.14.3)
124
+ multi_json (1.15.0)
125
+ mustermann (1.1.1)
126
+ ruby2_keywords (~> 0.0.1)
127
+ nio4r (2.5.5)
128
+ nokogiri (1.11.1)
129
+ mini_portile2 (~> 2.5.0)
130
+ racc (~> 1.4)
131
+ parser (2.7.2.0)
132
+ ast (~> 2.4.1)
133
+ pg (1.2.3)
134
+ powerpack (0.1.3)
135
+ pry (0.14.0)
136
+ coderay (~> 1.1)
137
+ method_source (~> 1.0)
138
+ raabro (1.4.0)
139
+ racc (1.5.2)
140
+ rack (2.2.3)
141
+ rack-protection (2.0.8.1)
142
+ rack
143
+ rack-test (1.1.0)
144
+ rack (>= 1.0, < 3)
145
+ rails (6.1.3)
146
+ actioncable (= 6.1.3)
147
+ actionmailbox (= 6.1.3)
148
+ actionmailer (= 6.1.3)
149
+ actionpack (= 6.1.3)
150
+ actiontext (= 6.1.3)
151
+ actionview (= 6.1.3)
152
+ activejob (= 6.1.3)
153
+ activemodel (= 6.1.3)
154
+ activerecord (= 6.1.3)
155
+ activestorage (= 6.1.3)
156
+ activesupport (= 6.1.3)
157
+ bundler (>= 1.15.0)
158
+ railties (= 6.1.3)
159
+ sprockets-rails (>= 2.0.0)
160
+ rails-dom-testing (2.0.3)
161
+ activesupport (>= 4.2.0)
162
+ nokogiri (>= 1.6)
163
+ rails-html-sanitizer (1.3.0)
164
+ loofah (~> 2.3)
165
+ railties (6.1.3)
166
+ actionpack (= 6.1.3)
167
+ activesupport (= 6.1.3)
168
+ method_source
169
+ rake (>= 0.8.7)
170
+ thor (~> 1.0)
171
+ rainbow (2.2.2)
172
+ rake
173
+ rake (13.0.3)
174
+ redis (4.2.5)
175
+ redis-scripting (1.0.1)
176
+ redis (>= 3.0)
177
+ rspec (3.10.0)
178
+ rspec-core (~> 3.10.0)
179
+ rspec-expectations (~> 3.10.0)
180
+ rspec-mocks (~> 3.10.0)
181
+ rspec-core (3.10.1)
182
+ rspec-support (~> 3.10.0)
183
+ rspec-expectations (3.10.1)
184
+ diff-lcs (>= 1.2.0, < 2.0)
185
+ rspec-support (~> 3.10.0)
186
+ rspec-mocks (3.10.2)
187
+ diff-lcs (>= 1.2.0, < 2.0)
188
+ rspec-support (~> 3.10.0)
189
+ rspec-support (3.10.2)
190
+ rubocop (0.48.1)
191
+ parser (>= 2.3.3.1, < 3.0)
192
+ powerpack (~> 0.1)
193
+ rainbow (>= 1.99.1, < 3.0)
194
+ ruby-progressbar (~> 1.7)
195
+ unicode-display_width (~> 1.0, >= 1.0.1)
196
+ ruby-progressbar (1.11.0)
197
+ ruby2_keywords (0.0.4)
198
+ simplecov (0.21.2)
199
+ docile (~> 1.1)
200
+ simplecov-html (~> 0.11)
201
+ simplecov_json_formatter (~> 0.1)
202
+ simplecov-html (0.12.3)
203
+ simplecov_json_formatter (0.1.2)
204
+ sinatra (2.0.8.1)
205
+ mustermann (~> 1.0)
206
+ rack (~> 2.0)
207
+ rack-protection (= 2.0.8.1)
208
+ tilt (~> 2.0)
209
+ sinatra-contrib (2.0.8.1)
210
+ backports (>= 2.8.2)
211
+ multi_json
212
+ mustermann (~> 1.0)
213
+ rack-protection (= 2.0.8.1)
214
+ sinatra (= 2.0.8.1)
215
+ tilt (~> 2.0)
216
+ sprockets (4.0.2)
217
+ concurrent-ruby (~> 1.0)
218
+ rack (> 1, < 3)
219
+ sprockets-rails (3.2.2)
220
+ actionpack (>= 4.0)
221
+ activesupport (>= 4.0)
222
+ sprockets (>= 3.0.0)
223
+ statsd-ruby (1.5.0)
224
+ thor (1.1.0)
225
+ tilt (2.0.10)
226
+ timecop (0.9.4)
227
+ tzinfo (2.0.4)
228
+ concurrent-ruby (~> 1.0)
229
+ unicode-display_width (1.7.0)
230
+ websocket-driver (0.7.3)
231
+ websocket-extensions (>= 0.1.0)
232
+ websocket-extensions (0.1.5)
233
+ wwtd (1.4.1)
234
+ zeitwerk (2.4.2)
235
+
236
+ PLATFORMS
237
+ ruby
238
+
239
+ DEPENDENCIES
240
+ bump
241
+ bundler
242
+ byebug
243
+ database_cleaner (~> 1.7)
244
+ factory_girl
245
+ inst-jobs-statsd!
246
+ pg (~> 1.2)
247
+ pry
248
+ rails (~> 6.0)
249
+ rake
250
+ rspec (~> 3.9)
251
+ rubocop (~> 0.48.0)
252
+ simplecov (~> 0.17)
253
+ sinatra (~> 2.0.8)
254
+ sinatra-contrib (~> 2.0.8)
255
+ timecop
256
+ wwtd (~> 1.4.0)
257
+
258
+ BUNDLED WITH
259
+ 2.1.4
@@ -0,0 +1,15 @@
1
+ RSpec.describe 'InstJobsStatsd::Ext::Job' do
2
+ describe 'sends count on job failure' do
3
+ before do
4
+ InstJobsStatsd::JobsTracker.new
5
+ end
6
+ let(:x) { Struct.new(:perform).new(true) }
7
+ it 'sends a stat' do
8
+ expect(InstStatsd::Statsd).to receive(:count)
9
+ .with(array_including(/\.failed$/), 1, 1, short_stat: :failed, tags: {})
10
+
11
+ x.delay.perform
12
+ Delayed::Job.first.fail!
13
+ end
14
+ end
15
+ end
@@ -12,7 +12,6 @@ RSpec.describe InstJobsStatsd::JobsTracker do
12
12
 
13
13
  describe '.initialize' do
14
14
  it 'enables everything' do
15
- expect(InstJobsStatsd::Stats::Counters::Failed).to receive(:enable)
16
15
  expect(InstJobsStatsd::Stats::Counters::Run).to receive(:enable)
17
16
 
18
17
  expect(InstJobsStatsd::Stats::Periodic::Failed).to receive(:enable)
@@ -44,12 +44,12 @@ RSpec.describe InstJobsStatsd::Naming do
44
44
  describe '.dd_job_tags' do
45
45
  it 'works' do
46
46
  job = double(tag: 'Account.run_reports_later', shard: double(id: 101), strand: 'special')
47
- expect(InstJobsStatsd::Naming.dd_job_tags(job)).to eq({ tag: 'Account.run_reports_later', jobshard: 101})
47
+ expect(InstJobsStatsd::Naming.dd_job_tags(job)).to eq(tag: 'Account.run_reports_later', jobshard: 101)
48
48
  end
49
49
 
50
50
  it 'properly munges job tags' do
51
51
  job = double(tag: 'Quizzes::Quiz#do_something', strand: nil)
52
- expect(InstJobsStatsd::Naming.dd_job_tags(job)).to eq({ tag: 'Quizzes-Quiz.do_something'})
52
+ expect(InstJobsStatsd::Naming.dd_job_tags(job)).to eq(tag: 'Quizzes-Quiz.do_something')
53
53
  end
54
54
  end
55
55
  end
@@ -18,7 +18,7 @@ RSpec.describe InstJobsStatsd::Stats::Counters::Run do
18
18
 
19
19
  it do
20
20
  expect(InstStatsd::Statsd).to receive(:count)
21
- .twice.with(array_including(/\.run$/), 1, 1, { short_stat: anything, tags: {} })
21
+ .twice.with(array_including(/\.run$/), 1, 1, short_stat: anything, tags: {})
22
22
  Delayed::Job.all.each do |job|
23
23
  Delayed::Worker.lifecycle.run_callbacks(:perform, {}, job) {}
24
24
  end
@@ -24,7 +24,7 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Failed do
24
24
 
25
25
  it do
26
26
  expect(InstStatsd::Statsd).to receive(:gauge)
27
- .with(array_including(/\.failed_depth$/), 1, 1, { short_stat: anything, tags: {} })
27
+ .with(array_including(/\.failed_depth$/), 1, 1, short_stat: anything, tags: {})
28
28
  InstJobsStatsd::Stats::Periodic::Failed.report_failed_depth
29
29
  end
30
30
  end
@@ -28,13 +28,13 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Queue do
28
28
 
29
29
  it do
30
30
  expect(InstStatsd::Statsd).to receive(:gauge)
31
- .with(array_including(/\.queue_depth$/), 1, 1, { short_stat: anything, tags: {} })
31
+ .with(array_including(/\.queue_depth$/), 1, 1, short_stat: anything, tags: {})
32
32
  InstJobsStatsd::Stats::Periodic::Queue.report_queue_depth
33
33
  end
34
34
 
35
35
  it do
36
36
  expect(InstStatsd::Statsd).to receive(:gauge)
37
- .with(array_including(/\.queue_depth$/), 2, 1, { short_stat: anything, tags: {} })
37
+ .with(array_including(/\.queue_depth$/), 2, 1, short_stat: anything, tags: {})
38
38
  Timecop.freeze(2.minutes.from_now) do
39
39
  InstJobsStatsd::Stats::Periodic::Queue.report_queue_depth
40
40
  end
@@ -42,7 +42,7 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Queue do
42
42
 
43
43
  it do
44
44
  expect(InstStatsd::Statsd).to receive(:gauge)
45
- .with(array_including(/\.queue_depth$/), 3, 1, { short_stat: anything, tags: {} })
45
+ .with(array_including(/\.queue_depth$/), 3, 1, short_stat: anything, tags: {})
46
46
  Timecop.freeze(20.minutes.from_now) do
47
47
  InstJobsStatsd::Stats::Periodic::Queue.report_queue_depth
48
48
  end
@@ -66,17 +66,17 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Queue do
66
66
 
67
67
  it do
68
68
  expect(InstStatsd::Statsd).to receive(:gauge)
69
- .ordered.with(array_including(/\.queue_age_total$/), number_near(0), 1, { short_stat: anything, tags: {} })
69
+ .ordered.with(array_including(/\.queue_age_total$/), number_near(0), 1, short_stat: anything, tags: {})
70
70
  expect(InstStatsd::Statsd).to receive(:gauge)
71
- .ordered.with(array_including(/\.queue_age_max$/), number_near(0), 1, { short_stat: anything, tags: {} })
71
+ .ordered.with(array_including(/\.queue_age_max$/), number_near(0), 1, short_stat: anything, tags: {})
72
72
  InstJobsStatsd::Stats::Periodic::Queue.report_queue_age
73
73
  end
74
74
 
75
75
  it do
76
76
  expect(InstStatsd::Statsd).to receive(:gauge)
77
- .ordered.with(array_including(/\.queue_age_total$/), number_near(180), 1, { short_stat: anything, tags: {} })
77
+ .ordered.with(array_including(/\.queue_age_total$/), number_near(180), 1, short_stat: anything, tags: {})
78
78
  expect(InstStatsd::Statsd).to receive(:gauge)
79
- .ordered.with(array_including(/\.queue_age_max$/), number_near(120), 1, { short_stat: anything, tags: {} })
79
+ .ordered.with(array_including(/\.queue_age_max$/), number_near(120), 1, short_stat: anything, tags: {})
80
80
  Timecop.freeze(2.minutes.from_now) do
81
81
  InstJobsStatsd::Stats::Periodic::Queue.report_queue_age
82
82
  end
@@ -84,9 +84,9 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Queue do
84
84
 
85
85
  it do
86
86
  expect(InstStatsd::Statsd).to receive(:gauge)
87
- .ordered.with(array_including(/\.queue_age_total$/), number_near(2940), 1, { short_stat: anything, tags: {} })
87
+ .ordered.with(array_including(/\.queue_age_total$/), number_near(2940), 1, short_stat: anything, tags: {})
88
88
  expect(InstStatsd::Statsd).to receive(:gauge)
89
- .ordered.with(array_including(/\.queue_age_max$/), number_near(1200), 1, { short_stat: anything, tags: {} })
89
+ .ordered.with(array_including(/\.queue_age_max$/), number_near(1200), 1, short_stat: anything, tags: {})
90
90
  Timecop.freeze(20.minutes.from_now) do
91
91
  InstJobsStatsd::Stats::Periodic::Queue.report_queue_age
92
92
  end
@@ -25,7 +25,7 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Run do
25
25
 
26
26
  it do
27
27
  expect(InstStatsd::Statsd).to receive(:gauge)
28
- .with(array_including(/\.run_depth$/), 1, 1, { short_stat: anything, tags: {} })
28
+ .with(array_including(/\.run_depth$/), 1, 1, short_stat: anything, tags: {})
29
29
  InstJobsStatsd::Stats::Periodic::Run.report_run_depth
30
30
  end
31
31
  end
@@ -44,9 +44,9 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Run do
44
44
 
45
45
  it do
46
46
  expect(InstStatsd::Statsd).to receive(:gauge)
47
- .ordered.with(array_including(/\.run_age_total$/), number_near(0), 1, { short_stat: anything, tags: {} })
47
+ .ordered.with(array_including(/\.run_age_total$/), number_near(0), 1, short_stat: anything, tags: {})
48
48
  expect(InstStatsd::Statsd).to receive(:gauge)
49
- .ordered.with(array_including(/\.run_age_max$/), number_near(0), 1, { short_stat: anything, tags: {} })
49
+ .ordered.with(array_including(/\.run_age_max$/), number_near(0), 1, short_stat: anything, tags: {})
50
50
  InstJobsStatsd::Stats::Periodic::Run.report_run_age
51
51
  end
52
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inst-jobs-statsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Slade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-08 00:00:00.000000000 Z
11
+ date: 2021-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inst-jobs
@@ -241,10 +241,10 @@ extra_rdoc_files: []
241
241
  files:
242
242
  - lib/inst-jobs-statsd.rb
243
243
  - lib/inst_jobs_statsd/default_tracking.rb
244
+ - lib/inst_jobs_statsd/ext/job.rb
244
245
  - lib/inst_jobs_statsd/jobs_tracker.rb
245
246
  - lib/inst_jobs_statsd/naming.rb
246
247
  - lib/inst_jobs_statsd/stats/counters.rb
247
- - lib/inst_jobs_statsd/stats/counters/failed.rb
248
248
  - lib/inst_jobs_statsd/stats/counters/run.rb
249
249
  - lib/inst_jobs_statsd/stats/periodic.rb
250
250
  - lib/inst_jobs_statsd/stats/periodic/failed.rb
@@ -258,11 +258,14 @@ files:
258
258
  - spec/factories/jobs.rb
259
259
  - spec/factories/workers.rb
260
260
  - spec/gemfiles/42.gemfile
261
+ - spec/gemfiles/42.gemfile.lock
261
262
  - spec/gemfiles/51.gemfile
263
+ - spec/gemfiles/51.gemfile.lock
262
264
  - spec/gemfiles/60.gemfile
265
+ - spec/gemfiles/60.gemfile.lock
266
+ - spec/inst_jobs_statsd/ext/job_spec.rb
263
267
  - spec/inst_jobs_statsd/jobs_tracker_spec.rb
264
268
  - spec/inst_jobs_statsd/naming_spec.rb
265
- - spec/inst_jobs_statsd/stats/counters/failed_spec.rb
266
269
  - spec/inst_jobs_statsd/stats/counters/run_spec.rb
267
270
  - spec/inst_jobs_statsd/stats/periodic/failed_spec.rb
268
271
  - spec/inst_jobs_statsd/stats/periodic/queue_spec.rb
@@ -300,24 +303,27 @@ signing_key:
300
303
  specification_version: 4
301
304
  summary: Stats reporting for inst-jobs
302
305
  test_files:
306
+ - spec/spec_helper.rb
307
+ - spec/inst_statsd/default_tracking_spec.rb
308
+ - spec/setup_test_db.rb
303
309
  - spec/inst_jobs_statsd/naming_spec.rb
310
+ - spec/inst_jobs_statsd/jobs_tracker_spec.rb
311
+ - spec/inst_jobs_statsd/stats/timing/perform_spec.rb
312
+ - spec/inst_jobs_statsd/stats/timing/pop_spec.rb
313
+ - spec/inst_jobs_statsd/stats/timing/failed_spec.rb
314
+ - spec/inst_jobs_statsd/stats/periodic/queue_spec.rb
304
315
  - spec/inst_jobs_statsd/stats/periodic/failed_spec.rb
305
316
  - spec/inst_jobs_statsd/stats/periodic/run_spec.rb
306
- - spec/inst_jobs_statsd/stats/periodic/queue_spec.rb
307
- - spec/inst_jobs_statsd/stats/timing/failed_spec.rb
308
- - spec/inst_jobs_statsd/stats/timing/pop_spec.rb
309
- - spec/inst_jobs_statsd/stats/timing/perform_spec.rb
310
- - spec/inst_jobs_statsd/stats/periodic_spec.rb
311
- - spec/inst_jobs_statsd/stats/counters/failed_spec.rb
312
317
  - spec/inst_jobs_statsd/stats/counters/run_spec.rb
313
318
  - spec/inst_jobs_statsd/stats/timing_spec.rb
314
- - spec/inst_jobs_statsd/jobs_tracker_spec.rb
315
- - spec/spec_helper.rb
316
- - spec/setup_test_db.rb
319
+ - spec/inst_jobs_statsd/stats/periodic_spec.rb
320
+ - spec/inst_jobs_statsd/ext/job_spec.rb
317
321
  - spec/matchers.rb
322
+ - spec/gemfiles/51.gemfile
323
+ - spec/gemfiles/51.gemfile.lock
324
+ - spec/gemfiles/42.gemfile.lock
318
325
  - spec/gemfiles/60.gemfile
326
+ - spec/gemfiles/60.gemfile.lock
319
327
  - spec/gemfiles/42.gemfile
320
- - spec/gemfiles/51.gemfile
321
328
  - spec/factories/workers.rb
322
329
  - spec/factories/jobs.rb
323
- - spec/inst_statsd/default_tracking_spec.rb
@@ -1,28 +0,0 @@
1
- module InstJobsStatsd
2
- module Stats
3
- module Counters
4
- module Failed
5
- def self.enable
6
- enable_failed_count
7
- end
8
-
9
- def self.enable_failed_count
10
- return if Delayed::Job::Failed < AfterCreateHook
11
- Delayed::Job::Failed.include AfterCreateHook
12
- end
13
-
14
- module AfterCreateHook
15
- def self.included(base)
16
- base.after_create do
17
- InstJobsStatsd::Stats::Counters::Failed.report_failed_count(self)
18
- end
19
- end
20
- end
21
-
22
- def self.report_failed_count(job)
23
- Counters.report_count(:failed, 1, job: job)
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,20 +0,0 @@
1
- RSpec.describe InstJobsStatsd::Stats::Counters::Failed do
2
- describe '.enable' do
3
- it 'enables all the things' do
4
- expect(InstJobsStatsd::Stats::Counters::Failed).to receive(:enable_failed_count)
5
- InstJobsStatsd::Stats::Counters::Failed.enable
6
- end
7
- end
8
-
9
- describe '.report_failed_count' do
10
- let(:x) { Struct.new(:perform).new(true) }
11
- it do
12
- expect(InstStatsd::Statsd).to receive(:count)
13
- .with(array_including(/\.failed$/), 1, 1, { short_stat: :failed, tags: {} })
14
-
15
- InstJobsStatsd::Stats::Counters::Failed.enable_failed_count
16
- x.delay.perform
17
- Delayed::Job.first.fail!
18
- end
19
- end
20
- end