inst-jobs-statsd 1.3.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da19d398392f2c835e41b4c4e5c8090670e2a9be9e7db4b92e40dbf513d3af92
4
- data.tar.gz: a96644d13a948749cd23f41fa1bd93a588962693c8857723e97b62693ce9751f
3
+ metadata.gz: c7d2f71f91477c6e30a43226165ea6506e6e7b186f3fcf4876ce3b99d8595cd1
4
+ data.tar.gz: a57c33ba7eb726155f0aa767a18dffc7cfb39f0faae21c51133d233076f7954d
5
5
  SHA512:
6
- metadata.gz: d0979ccc421c624de3127f7dd63e0b43913a92262a5895cfac07fde37c5a681552e17d84ba4d0eadb66eb3a3c43cf69a2fcf7628eba9a24244f565fb47194380
7
- data.tar.gz: 660fe2b7ed35660a7c33e1525eaeec9beff4a89c5d1690f6edb070ffc16220266d280bf4ec797a9e8f80042004ebd7b8bbdfd05d6641080a3fe686a5b9891f15
6
+ metadata.gz: 7a692a9342cceb3ab900493cda108515956203e30d83acd048b96f3da2a9978f59ea711196aac5ed1c0156001847bd06548a36cd2b8e395be80a2309f077a620
7
+ data.tar.gz: 70018e665a4e434fc6828391d0f67f753fb09569db8991baee0d44bfa72c73b9b3e770d5ecf8d6e0f1173961497ca586c96c552c10dfdef746c97157aea501e1
@@ -10,7 +10,6 @@ require_relative 'inst_jobs_statsd/naming'
10
10
 
11
11
  require_relative 'inst_jobs_statsd/stats/counters'
12
12
  require_relative 'inst_jobs_statsd/stats/counters/failed'
13
- require_relative 'inst_jobs_statsd/stats/counters/orphaned'
14
13
  require_relative 'inst_jobs_statsd/stats/counters/run'
15
14
 
16
15
  require_relative 'inst_jobs_statsd/stats/periodic'
@@ -7,8 +7,8 @@ module InstJobsStatsd
7
7
  end
8
8
 
9
9
  module ClassMethods
10
- def track_jobs
11
- @jobs_tracker ||= JobsTracker.new
10
+ def track_jobs(enable_periodic_queries: true)
11
+ @jobs_tracker ||= JobsTracker.new(enable_periodic_queries: enable_periodic_queries)
12
12
  end
13
13
  end
14
14
  end
@@ -1,21 +1,22 @@
1
1
  module InstJobsStatsd
2
2
  class JobsTracker
3
- def self.track
4
- @current_tracking = new
3
+ def self.track(enable_periodic_queries: true)
4
+ @current_tracking = new(enable_periodic_queries: enable_periodic_queries)
5
5
  yield
6
6
  tracking = @current_tracking
7
7
  @current_tracking = nil
8
8
  tracking
9
9
  end
10
10
 
11
- def initialize
11
+ def initialize(enable_periodic_queries: true)
12
12
  Stats::Counters::Failed.enable
13
- Stats::Counters::Orphaned.enable
14
13
  Stats::Counters::Run.enable
15
14
 
16
- Stats::Periodic::Failed.enable
17
- Stats::Periodic::Queue.enable
18
- Stats::Periodic::Run.enable
15
+ if enable_periodic_queries
16
+ Stats::Periodic::Failed.enable
17
+ Stats::Periodic::Queue.enable
18
+ Stats::Periodic::Run.enable
19
+ end
19
20
 
20
21
  Stats::Timing::Failed.enable
21
22
  Stats::Timing::Perform.enable
@@ -1,3 +1,3 @@
1
1
  module InstJobsStatsd
2
- VERSION = '1.3.1'.freeze
2
+ VERSION = '2.1.0'.freeze
3
3
  end
@@ -13,7 +13,6 @@ RSpec.describe InstJobsStatsd::JobsTracker do
13
13
  describe '.initialize' do
14
14
  it 'enables everything' do
15
15
  expect(InstJobsStatsd::Stats::Counters::Failed).to receive(:enable)
16
- expect(InstJobsStatsd::Stats::Counters::Orphaned).to receive(:enable)
17
16
  expect(InstJobsStatsd::Stats::Counters::Run).to receive(:enable)
18
17
 
19
18
  expect(InstJobsStatsd::Stats::Periodic::Failed).to receive(:enable)
@@ -13,7 +13,7 @@ RSpec.describe InstJobsStatsd::Stats::Counters::Failed do
13
13
  .with(array_including(/\.failed$/), 1, 1, { short_stat: :failed, tags: {} })
14
14
 
15
15
  InstJobsStatsd::Stats::Counters::Failed.enable_failed_count
16
- x.send_later(:perform)
16
+ x.delay.perform
17
17
  Delayed::Job.first.fail!
18
18
  end
19
19
  end
@@ -13,7 +13,7 @@ RSpec.describe InstJobsStatsd::Stats::Counters::Run do
13
13
  Delayed::Worker.lifecycle.reset!
14
14
  InstJobsStatsd::Stats::Counters::Run.enable
15
15
 
16
- 2.times { x.send_later(:perform) }
16
+ 2.times { x.delay.perform }
17
17
  end
18
18
 
19
19
  it do
@@ -18,7 +18,7 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Failed do
18
18
  InstJobsStatsd::Stats::Periodic.enable_callbacks
19
19
  InstJobsStatsd::Stats::Periodic::Failed.enable_failed_depth
20
20
 
21
- x.send_later(:perform)
21
+ x.delay.perform
22
22
  Delayed::Job.first.fail!
23
23
  end
24
24
 
@@ -18,12 +18,12 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Queue do
18
18
  before do
19
19
  InstJobsStatsd::Stats::Periodic::Queue.enable_queue_depth
20
20
 
21
- x.send_later(:perform)
21
+ x.delay.perform
22
22
  Delayed::Job.first.update(locked_at: Delayed::Job.db_time_now, locked_by: 'test')
23
23
 
24
- x.send_later(:perform)
25
- x.send_later_enqueue_args(:perform, run_at: now + 1.minute)
26
- x.send_later_enqueue_args(:perform, run_at: now + 10.minutes)
24
+ x.delay.perform
25
+ x.delay(run_at: now + 1.minute).perform
26
+ x.delay(run_at: now + 10.minutes).perform
27
27
  end
28
28
 
29
29
  it do
@@ -56,12 +56,12 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Queue do
56
56
  before do
57
57
  InstJobsStatsd::Stats::Periodic::Queue.enable_queue_age
58
58
 
59
- x.send_later(:perform)
59
+ x.delay.perform
60
60
  Delayed::Job.first.update(locked_at: Delayed::Job.db_time_now, locked_by: 'test')
61
61
 
62
- x.send_later(:perform)
63
- x.send_later_enqueue_args(:perform, run_at: now + 1.minute)
64
- x.send_later_enqueue_args(:perform, run_at: now + 10.minutes)
62
+ x.delay.perform
63
+ x.delay(run_at: now + 1.minute).perform
64
+ x.delay(run_at: now + 10.minutes).perform
65
65
  end
66
66
 
67
67
  it do
@@ -18,8 +18,8 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Run do
18
18
  before do
19
19
  InstJobsStatsd::Stats::Periodic::Run.enable_run_depth
20
20
 
21
- x.send_later(:perform)
22
- x.send_later(:perform)
21
+ x.delay.perform
22
+ x.delay.perform
23
23
  Delayed::Job.first.update(locked_at: Delayed::Job.db_time_now, locked_by: 'test')
24
24
  end
25
25
 
@@ -37,8 +37,8 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Run do
37
37
  before do
38
38
  InstJobsStatsd::Stats::Periodic::Run.enable_run_age
39
39
 
40
- x.send_later(:perform)
41
- x.send_later(:perform)
40
+ x.delay.perform
41
+ x.delay.perform
42
42
  Delayed::Job.first.update(locked_at: now, locked_by: 'test')
43
43
  end
44
44
 
@@ -1,4 +1,4 @@
1
- if /^2\.5/ =~ RUBY_VERSION && /51\./ =~ ENV['BUNDLE_GEMFILE'] # Limit coverage to one build
1
+ if /^2\.7/ =~ RUBY_VERSION && /51\./ =~ ENV['BUNDLE_GEMFILE'] # Limit coverage to one build
2
2
  require 'simplecov'
3
3
 
4
4
  SimpleCov.start do
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inst-jobs-statsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 2.1.0
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-01-31 00:00:00.000000000 Z
11
+ date: 2020-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inst-jobs
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.15'
19
+ version: '1.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '0.16'
22
+ version: '3.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ">="
27
+ - - ">"
28
28
  - !ruby/object:Gem::Version
29
- version: '0.15'
29
+ version: '1.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '0.16'
32
+ version: '3.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: inst_statsd
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -245,7 +245,6 @@ files:
245
245
  - lib/inst_jobs_statsd/naming.rb
246
246
  - lib/inst_jobs_statsd/stats/counters.rb
247
247
  - lib/inst_jobs_statsd/stats/counters/failed.rb
248
- - lib/inst_jobs_statsd/stats/counters/orphaned.rb
249
248
  - lib/inst_jobs_statsd/stats/counters/run.rb
250
249
  - lib/inst_jobs_statsd/stats/periodic.rb
251
250
  - lib/inst_jobs_statsd/stats/periodic/failed.rb
@@ -260,13 +259,10 @@ files:
260
259
  - spec/factories/workers.rb
261
260
  - spec/gemfiles/42.gemfile
262
261
  - spec/gemfiles/51.gemfile
263
- - spec/gemfiles/51.gemfile.lock
264
262
  - spec/gemfiles/60.gemfile
265
- - spec/gemfiles/60.gemfile.lock
266
263
  - spec/inst_jobs_statsd/jobs_tracker_spec.rb
267
264
  - spec/inst_jobs_statsd/naming_spec.rb
268
265
  - spec/inst_jobs_statsd/stats/counters/failed_spec.rb
269
- - spec/inst_jobs_statsd/stats/counters/orphaned_spec.rb
270
266
  - spec/inst_jobs_statsd/stats/counters/run_spec.rb
271
267
  - spec/inst_jobs_statsd/stats/periodic/failed_spec.rb
272
268
  - spec/inst_jobs_statsd/stats/periodic/queue_spec.rb
@@ -314,14 +310,11 @@ test_files:
314
310
  - spec/inst_jobs_statsd/stats/periodic_spec.rb
315
311
  - spec/inst_jobs_statsd/stats/counters/failed_spec.rb
316
312
  - spec/inst_jobs_statsd/stats/counters/run_spec.rb
317
- - spec/inst_jobs_statsd/stats/counters/orphaned_spec.rb
318
313
  - spec/inst_jobs_statsd/stats/timing_spec.rb
319
314
  - spec/inst_jobs_statsd/jobs_tracker_spec.rb
320
315
  - spec/spec_helper.rb
321
316
  - spec/setup_test_db.rb
322
317
  - spec/matchers.rb
323
- - spec/gemfiles/51.gemfile.lock
324
- - spec/gemfiles/60.gemfile.lock
325
318
  - spec/gemfiles/60.gemfile
326
319
  - spec/gemfiles/42.gemfile
327
320
  - spec/gemfiles/51.gemfile
@@ -1,34 +0,0 @@
1
- module InstJobsStatsd
2
- module Stats
3
- module Counters
4
- module Orphaned
5
- def self.enable
6
- enable_orphaned_count
7
- end
8
-
9
- # The idea of the orphaned count: when a job finishes, if there
10
- # are other jobs locked_by the *same* worker, they must have been
11
- # orphaned, because they are not going to be picked up and run by
12
- # the worker -- the work queue is designed to only have one job
13
- # locked_by a worker at a time.
14
- # This is based on the symptom seen in AMS-447, where mutliple
15
- # rows of the jobs table can be (incorrectly) updated by the same
16
- # query.
17
- def self.enable_orphaned_count
18
- Delayed::Worker.lifecycle.before(:perform) do |_worker, job|
19
- report_orphaned_count(job)
20
- end
21
- end
22
-
23
- def self.report_orphaned_count(job)
24
- scope = Delayed::Job.where(
25
- 'locked_by = ? AND locked_at = ? AND id <> ?',
26
- job.locked_by, job.locked_at, job.id
27
- )
28
- count = scope.count
29
- Counters.report_count(:orphaned, count, job: job) unless count.zero?
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,227 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- inst-jobs-statsd (1.3.0)
5
- inst-jobs (>= 0.15, < 0.16)
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.0.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.8.1)
62
- diff-lcs (1.3)
63
- docile (1.3.2)
64
- dogstatsd-ruby (4.6.0)
65
- erubi (1.9.0)
66
- et-orbi (1.2.2)
67
- tzinfo
68
- factory_girl (4.9.0)
69
- activesupport (>= 3.0.0)
70
- fugit (1.3.3)
71
- et-orbi (~> 1.1, >= 1.1.8)
72
- raabro (~> 1.1)
73
- globalid (0.4.2)
74
- activesupport (>= 4.2.0)
75
- i18n (1.8.2)
76
- concurrent-ruby (~> 1.0)
77
- inst-jobs (0.15.15)
78
- activerecord (>= 4.2)
79
- activesupport (>= 4.2)
80
- after_transaction_commit (>= 1.0, < 3)
81
- fugit (~> 1.3)
82
- railties (>= 4.2)
83
- redis (> 3.0)
84
- redis-scripting (~> 1.0.1)
85
- inst_statsd (2.1.6)
86
- aroi (~> 0.0.7)
87
- dogstatsd-ruby (~> 4.2)
88
- statsd-ruby (~> 1.0)
89
- loofah (2.4.0)
90
- crass (~> 1.0.2)
91
- nokogiri (>= 1.5.9)
92
- mail (2.7.1)
93
- mini_mime (>= 0.1.1)
94
- method_source (0.9.2)
95
- mini_mime (1.0.2)
96
- mini_portile2 (2.4.0)
97
- minitest (5.14.0)
98
- multi_json (1.14.1)
99
- mustermann (1.1.1)
100
- ruby2_keywords (~> 0.0.1)
101
- nio4r (2.5.2)
102
- nokogiri (1.10.7)
103
- mini_portile2 (~> 2.4.0)
104
- parser (2.7.0.2)
105
- ast (~> 2.4.0)
106
- pg (1.2.2)
107
- powerpack (0.1.2)
108
- pry (0.12.2)
109
- coderay (~> 1.1.0)
110
- method_source (~> 0.9.0)
111
- raabro (1.1.6)
112
- rack (2.1.2)
113
- rack-protection (2.0.8.1)
114
- rack
115
- rack-test (1.1.0)
116
- rack (>= 1.0, < 3)
117
- rails (5.1.7)
118
- actioncable (= 5.1.7)
119
- actionmailer (= 5.1.7)
120
- actionpack (= 5.1.7)
121
- actionview (= 5.1.7)
122
- activejob (= 5.1.7)
123
- activemodel (= 5.1.7)
124
- activerecord (= 5.1.7)
125
- activesupport (= 5.1.7)
126
- bundler (>= 1.3.0)
127
- railties (= 5.1.7)
128
- sprockets-rails (>= 2.0.0)
129
- rails-dom-testing (2.0.3)
130
- activesupport (>= 4.2.0)
131
- nokogiri (>= 1.6)
132
- rails-html-sanitizer (1.3.0)
133
- loofah (~> 2.3)
134
- railties (5.1.7)
135
- actionpack (= 5.1.7)
136
- activesupport (= 5.1.7)
137
- method_source
138
- rake (>= 0.8.7)
139
- thor (>= 0.18.1, < 2.0)
140
- rainbow (2.2.2)
141
- rake
142
- rake (13.0.1)
143
- redis (4.1.3)
144
- redis-scripting (1.0.1)
145
- redis (>= 3.0)
146
- rspec (3.9.0)
147
- rspec-core (~> 3.9.0)
148
- rspec-expectations (~> 3.9.0)
149
- rspec-mocks (~> 3.9.0)
150
- rspec-core (3.9.1)
151
- rspec-support (~> 3.9.1)
152
- rspec-expectations (3.9.0)
153
- diff-lcs (>= 1.2.0, < 2.0)
154
- rspec-support (~> 3.9.0)
155
- rspec-mocks (3.9.1)
156
- diff-lcs (>= 1.2.0, < 2.0)
157
- rspec-support (~> 3.9.0)
158
- rspec-support (3.9.2)
159
- rubocop (0.48.1)
160
- parser (>= 2.3.3.1, < 3.0)
161
- powerpack (~> 0.1)
162
- rainbow (>= 1.99.1, < 3.0)
163
- ruby-progressbar (~> 1.7)
164
- unicode-display_width (~> 1.0, >= 1.0.1)
165
- ruby-progressbar (1.10.1)
166
- ruby2_keywords (0.0.2)
167
- simplecov (0.18.1)
168
- docile (~> 1.1)
169
- simplecov-html (~> 0.11.0)
170
- simplecov-html (0.11.0)
171
- sinatra (2.0.8.1)
172
- mustermann (~> 1.0)
173
- rack (~> 2.0)
174
- rack-protection (= 2.0.8.1)
175
- tilt (~> 2.0)
176
- sinatra-contrib (2.0.8.1)
177
- backports (>= 2.8.2)
178
- multi_json
179
- mustermann (~> 1.0)
180
- rack-protection (= 2.0.8.1)
181
- sinatra (= 2.0.8.1)
182
- tilt (~> 2.0)
183
- sprockets (3.7.2)
184
- concurrent-ruby (~> 1.0)
185
- rack (> 1, < 3)
186
- sprockets-rails (3.2.1)
187
- actionpack (>= 4.0)
188
- activesupport (>= 4.0)
189
- sprockets (>= 3.0.0)
190
- statsd-ruby (1.4.0)
191
- thor (1.0.1)
192
- thread_safe (0.3.6)
193
- tilt (2.0.10)
194
- timecop (0.9.1)
195
- tzinfo (1.2.6)
196
- thread_safe (~> 0.1)
197
- unicode-display_width (1.6.1)
198
- websocket-driver (0.6.5)
199
- websocket-extensions (>= 0.1.0)
200
- websocket-extensions (0.1.4)
201
- wwtd (1.4.0)
202
-
203
- PLATFORMS
204
- ruby
205
-
206
- DEPENDENCIES
207
- bump
208
- bundler
209
- byebug
210
- database_cleaner (~> 1.7)
211
- factory_girl
212
- inst-jobs-statsd!
213
- pg (~> 1.2)
214
- pry
215
- rails (~> 5.1.7)
216
- rake
217
- rspec (~> 3.9)
218
- rubocop (~> 0.48.0)
219
- simplecov (~> 0.17)
220
- sinatra (~> 2.0.8)
221
- sinatra-contrib (~> 2.0.8)
222
- sprockets (~> 3.7)
223
- timecop
224
- wwtd (~> 1.4.0)
225
-
226
- BUNDLED WITH
227
- 2.0.2
@@ -1,251 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- inst-jobs-statsd (1.3.0)
5
- inst-jobs (>= 0.15, < 0.16)
6
- inst_statsd (>= 2.1.2, < 3.0)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actioncable (6.0.2.1)
12
- actionpack (= 6.0.2.1)
13
- nio4r (~> 2.0)
14
- websocket-driver (>= 0.6.1)
15
- actionmailbox (6.0.2.1)
16
- actionpack (= 6.0.2.1)
17
- activejob (= 6.0.2.1)
18
- activerecord (= 6.0.2.1)
19
- activestorage (= 6.0.2.1)
20
- activesupport (= 6.0.2.1)
21
- mail (>= 2.7.1)
22
- actionmailer (6.0.2.1)
23
- actionpack (= 6.0.2.1)
24
- actionview (= 6.0.2.1)
25
- activejob (= 6.0.2.1)
26
- mail (~> 2.5, >= 2.5.4)
27
- rails-dom-testing (~> 2.0)
28
- actionpack (6.0.2.1)
29
- actionview (= 6.0.2.1)
30
- activesupport (= 6.0.2.1)
31
- rack (~> 2.0, >= 2.0.8)
32
- rack-test (>= 0.6.3)
33
- rails-dom-testing (~> 2.0)
34
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
35
- actiontext (6.0.2.1)
36
- actionpack (= 6.0.2.1)
37
- activerecord (= 6.0.2.1)
38
- activestorage (= 6.0.2.1)
39
- activesupport (= 6.0.2.1)
40
- nokogiri (>= 1.8.5)
41
- actionview (6.0.2.1)
42
- activesupport (= 6.0.2.1)
43
- builder (~> 3.1)
44
- erubi (~> 1.4)
45
- rails-dom-testing (~> 2.0)
46
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
47
- activejob (6.0.2.1)
48
- activesupport (= 6.0.2.1)
49
- globalid (>= 0.3.6)
50
- activemodel (6.0.2.1)
51
- activesupport (= 6.0.2.1)
52
- activerecord (6.0.2.1)
53
- activemodel (= 6.0.2.1)
54
- activesupport (= 6.0.2.1)
55
- activestorage (6.0.2.1)
56
- actionpack (= 6.0.2.1)
57
- activejob (= 6.0.2.1)
58
- activerecord (= 6.0.2.1)
59
- marcel (~> 0.3.1)
60
- activesupport (6.0.2.1)
61
- concurrent-ruby (~> 1.0, >= 1.0.2)
62
- i18n (>= 0.7, < 2)
63
- minitest (~> 5.1)
64
- tzinfo (~> 1.1)
65
- zeitwerk (~> 2.2)
66
- after_transaction_commit (2.0.0)
67
- activerecord (>= 5.0)
68
- aroi (0.0.7)
69
- rails (>= 3.2)
70
- ast (2.4.0)
71
- backports (3.15.0)
72
- builder (3.2.4)
73
- bump (0.8.0)
74
- byebug (11.1.1)
75
- coderay (1.1.2)
76
- concurrent-ruby (1.1.5)
77
- crass (1.0.6)
78
- database_cleaner (1.8.1)
79
- diff-lcs (1.3)
80
- docile (1.3.2)
81
- dogstatsd-ruby (4.6.0)
82
- erubi (1.9.0)
83
- et-orbi (1.2.2)
84
- tzinfo
85
- factory_girl (4.9.0)
86
- activesupport (>= 3.0.0)
87
- fugit (1.3.3)
88
- et-orbi (~> 1.1, >= 1.1.8)
89
- raabro (~> 1.1)
90
- globalid (0.4.2)
91
- activesupport (>= 4.2.0)
92
- i18n (1.8.2)
93
- concurrent-ruby (~> 1.0)
94
- inst-jobs (0.15.15)
95
- activerecord (>= 4.2)
96
- activesupport (>= 4.2)
97
- after_transaction_commit (>= 1.0, < 3)
98
- fugit (~> 1.3)
99
- railties (>= 4.2)
100
- redis (> 3.0)
101
- redis-scripting (~> 1.0.1)
102
- inst_statsd (2.1.6)
103
- aroi (~> 0.0.7)
104
- dogstatsd-ruby (~> 4.2)
105
- statsd-ruby (~> 1.0)
106
- loofah (2.4.0)
107
- crass (~> 1.0.2)
108
- nokogiri (>= 1.5.9)
109
- mail (2.7.1)
110
- mini_mime (>= 0.1.1)
111
- marcel (0.3.3)
112
- mimemagic (~> 0.3.2)
113
- method_source (0.9.2)
114
- mimemagic (0.3.4)
115
- mini_mime (1.0.2)
116
- mini_portile2 (2.4.0)
117
- minitest (5.14.0)
118
- multi_json (1.14.1)
119
- mustermann (1.1.1)
120
- ruby2_keywords (~> 0.0.1)
121
- nio4r (2.5.2)
122
- nokogiri (1.10.7)
123
- mini_portile2 (~> 2.4.0)
124
- parser (2.7.0.2)
125
- ast (~> 2.4.0)
126
- pg (1.2.2)
127
- powerpack (0.1.2)
128
- pry (0.12.2)
129
- coderay (~> 1.1.0)
130
- method_source (~> 0.9.0)
131
- raabro (1.1.6)
132
- rack (2.1.2)
133
- rack-protection (2.0.8.1)
134
- rack
135
- rack-test (1.1.0)
136
- rack (>= 1.0, < 3)
137
- rails (6.0.2.1)
138
- actioncable (= 6.0.2.1)
139
- actionmailbox (= 6.0.2.1)
140
- actionmailer (= 6.0.2.1)
141
- actionpack (= 6.0.2.1)
142
- actiontext (= 6.0.2.1)
143
- actionview (= 6.0.2.1)
144
- activejob (= 6.0.2.1)
145
- activemodel (= 6.0.2.1)
146
- activerecord (= 6.0.2.1)
147
- activestorage (= 6.0.2.1)
148
- activesupport (= 6.0.2.1)
149
- bundler (>= 1.3.0)
150
- railties (= 6.0.2.1)
151
- sprockets-rails (>= 2.0.0)
152
- rails-dom-testing (2.0.3)
153
- activesupport (>= 4.2.0)
154
- nokogiri (>= 1.6)
155
- rails-html-sanitizer (1.3.0)
156
- loofah (~> 2.3)
157
- railties (6.0.2.1)
158
- actionpack (= 6.0.2.1)
159
- activesupport (= 6.0.2.1)
160
- method_source
161
- rake (>= 0.8.7)
162
- thor (>= 0.20.3, < 2.0)
163
- rainbow (2.2.2)
164
- rake
165
- rake (13.0.1)
166
- redis (4.1.3)
167
- redis-scripting (1.0.1)
168
- redis (>= 3.0)
169
- rspec (3.9.0)
170
- rspec-core (~> 3.9.0)
171
- rspec-expectations (~> 3.9.0)
172
- rspec-mocks (~> 3.9.0)
173
- rspec-core (3.9.1)
174
- rspec-support (~> 3.9.1)
175
- rspec-expectations (3.9.0)
176
- diff-lcs (>= 1.2.0, < 2.0)
177
- rspec-support (~> 3.9.0)
178
- rspec-mocks (3.9.1)
179
- diff-lcs (>= 1.2.0, < 2.0)
180
- rspec-support (~> 3.9.0)
181
- rspec-support (3.9.2)
182
- rubocop (0.48.1)
183
- parser (>= 2.3.3.1, < 3.0)
184
- powerpack (~> 0.1)
185
- rainbow (>= 1.99.1, < 3.0)
186
- ruby-progressbar (~> 1.7)
187
- unicode-display_width (~> 1.0, >= 1.0.1)
188
- ruby-progressbar (1.10.1)
189
- ruby2_keywords (0.0.2)
190
- simplecov (0.18.1)
191
- docile (~> 1.1)
192
- simplecov-html (~> 0.11.0)
193
- simplecov-html (0.11.0)
194
- sinatra (2.0.8.1)
195
- mustermann (~> 1.0)
196
- rack (~> 2.0)
197
- rack-protection (= 2.0.8.1)
198
- tilt (~> 2.0)
199
- sinatra-contrib (2.0.8.1)
200
- backports (>= 2.8.2)
201
- multi_json
202
- mustermann (~> 1.0)
203
- rack-protection (= 2.0.8.1)
204
- sinatra (= 2.0.8.1)
205
- tilt (~> 2.0)
206
- sprockets (3.7.2)
207
- concurrent-ruby (~> 1.0)
208
- rack (> 1, < 3)
209
- sprockets-rails (3.2.1)
210
- actionpack (>= 4.0)
211
- activesupport (>= 4.0)
212
- sprockets (>= 3.0.0)
213
- statsd-ruby (1.4.0)
214
- thor (1.0.1)
215
- thread_safe (0.3.6)
216
- tilt (2.0.10)
217
- timecop (0.9.1)
218
- tzinfo (1.2.6)
219
- thread_safe (~> 0.1)
220
- unicode-display_width (1.6.1)
221
- websocket-driver (0.7.1)
222
- websocket-extensions (>= 0.1.0)
223
- websocket-extensions (0.1.4)
224
- wwtd (1.4.0)
225
- zeitwerk (2.2.2)
226
-
227
- PLATFORMS
228
- ruby
229
-
230
- DEPENDENCIES
231
- bump
232
- bundler
233
- byebug
234
- database_cleaner (~> 1.7)
235
- factory_girl
236
- inst-jobs-statsd!
237
- pg (~> 1.2)
238
- pry
239
- rails (~> 6.0)
240
- rake
241
- rspec (~> 3.9)
242
- rubocop (~> 0.48.0)
243
- simplecov (~> 0.17)
244
- sinatra (~> 2.0.8)
245
- sinatra-contrib (~> 2.0.8)
246
- sprockets (~> 3.7)
247
- timecop
248
- wwtd (~> 1.4.0)
249
-
250
- BUNDLED WITH
251
- 2.0.1
@@ -1,27 +0,0 @@
1
- RSpec.describe InstJobsStatsd::Stats::Counters::Orphaned do
2
- describe '.enable' do
3
- it 'enables all the things' do
4
- expect(InstJobsStatsd::Stats::Counters::Orphaned).to receive(:enable_orphaned_count)
5
- InstJobsStatsd::Stats::Counters::Orphaned.enable
6
- end
7
- end
8
-
9
- describe '.report_orphaned_count' do
10
- let(:x) { Struct.new(:perform).new(true) }
11
-
12
- before do
13
- Delayed::Worker.lifecycle.reset!
14
- InstJobsStatsd::Stats::Counters::Orphaned.enable
15
-
16
- 4.times { x.send_later(:perform) }
17
- Delayed::Job.order(:id).limit(3)
18
- .update_all(locked_by: 'test', locked_at: Delayed::Job.db_time_now)
19
- end
20
-
21
- it do
22
- expect(InstStatsd::Statsd).to receive(:count)
23
- .with(array_including(/\.orphaned$/), 2, 1, { short_stat: anything, tags: {} })
24
- Delayed::Worker.lifecycle.run_callbacks(:perform, nil, Delayed::Job.first) {}
25
- end
26
- end
27
- end