inst-jobs-statsd 2.2.0 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/inst-jobs-statsd.rb +22 -20
  3. data/lib/inst_jobs_statsd/default_tracking.rb +3 -1
  4. data/lib/inst_jobs_statsd/ext/job.rb +2 -0
  5. data/lib/inst_jobs_statsd/jobs_tracker.rb +2 -0
  6. data/lib/inst_jobs_statsd/naming.rb +19 -24
  7. data/lib/inst_jobs_statsd/stats/counters/complete.rb +2 -0
  8. data/lib/inst_jobs_statsd/stats/counters/create.rb +2 -0
  9. data/lib/inst_jobs_statsd/stats/counters/run.rb +2 -0
  10. data/lib/inst_jobs_statsd/stats/counters.rb +2 -0
  11. data/lib/inst_jobs_statsd/stats/periodic/failed.rb +2 -0
  12. data/lib/inst_jobs_statsd/stats/periodic/queue.rb +3 -1
  13. data/lib/inst_jobs_statsd/stats/periodic/run.rb +3 -1
  14. data/lib/inst_jobs_statsd/stats/periodic.rb +6 -2
  15. data/lib/inst_jobs_statsd/stats/timing/failed.rb +2 -0
  16. data/lib/inst_jobs_statsd/stats/timing/perform.rb +2 -0
  17. data/lib/inst_jobs_statsd/stats/timing/pop.rb +2 -0
  18. data/lib/inst_jobs_statsd/stats/timing.rb +7 -3
  19. data/lib/inst_jobs_statsd/version.rb +3 -1
  20. metadata +80 -85
  21. data/spec/factories/jobs.rb +0 -9
  22. data/spec/factories/workers.rb +0 -9
  23. data/spec/gemfiles/60.gemfile +0 -7
  24. data/spec/inst_jobs_statsd/ext/job_spec.rb +0 -17
  25. data/spec/inst_jobs_statsd/jobs_tracker_spec.rb +0 -30
  26. data/spec/inst_jobs_statsd/naming_spec.rb +0 -56
  27. data/spec/inst_jobs_statsd/stats/counters/complete_spec.rb +0 -27
  28. data/spec/inst_jobs_statsd/stats/counters/create_spec.rb +0 -27
  29. data/spec/inst_jobs_statsd/stats/counters/run_spec.rb +0 -27
  30. data/spec/inst_jobs_statsd/stats/periodic/failed_spec.rb +0 -31
  31. data/spec/inst_jobs_statsd/stats/periodic/queue_spec.rb +0 -95
  32. data/spec/inst_jobs_statsd/stats/periodic/run_spec.rb +0 -53
  33. data/spec/inst_jobs_statsd/stats/periodic_spec.rb +0 -63
  34. data/spec/inst_jobs_statsd/stats/timing/failed_spec.rb +0 -25
  35. data/spec/inst_jobs_statsd/stats/timing/perform_spec.rb +0 -35
  36. data/spec/inst_jobs_statsd/stats/timing/pop_spec.rb +0 -34
  37. data/spec/inst_jobs_statsd/stats/timing_spec.rb +0 -35
  38. data/spec/inst_statsd/default_tracking_spec.rb +0 -16
  39. data/spec/matchers.rb +0 -3
  40. data/spec/setup_test_db.rb +0 -45
  41. data/spec/spec_helper.rb +0 -61
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10d4bb1c1c2d71c7a93df1ccd59657c96f871dd65b4e90ea7430fdf7b6da4991
4
- data.tar.gz: f8af74f6d0e5abd4ec7f490ad592ee75c2909126574d889d275d7e8a2227df8d
3
+ metadata.gz: d5760a670863e6b529a17f1443c45b360ed9762b35ad9fe432a4bd66c5b3e90d
4
+ data.tar.gz: 0efe20cd91f2dcb8cb55b5f4df13c372aa2f1b60ff2401c5379a453ed16e1bae
5
5
  SHA512:
6
- metadata.gz: 26f9240b397a8012fd8173c1a4658c53b7106eeecb4c2c833c82e2dc7963b4b73bb38bd442b469fcd551636f49c998daea5c8f7d7d929e5f7b3c0e1ac5361172
7
- data.tar.gz: 8704615a3f54eed9d808930932ebb293818ab7af537bfc8e3a88cff6de685e3e6b3153342f643d1547f84f8a4c34b1181cc2d830cc3a91520b5e5e398d093d1c
6
+ metadata.gz: 1a35e512b5a4b8a1e87205fa97a03922d70b95298635dda6d5778e9bcd110bb02b74dfd36791a963ca169dddbaafcac448c2e33beb1d640b27955f793138d990
7
+ data.tar.gz: bd8808fa5e79266049f4cc9852df42c8bea046fc19d96c0402831df006e1c2a982a8d0475f12ac603bc0b0baf7224585546f78b79b3a650611f06d67cc1fe283
@@ -1,27 +1,29 @@
1
- require 'inst-jobs'
2
- require 'inst_statsd'
1
+ # frozen_string_literal: true
3
2
 
4
- require_relative 'inst_jobs_statsd/version'
3
+ require "inst-jobs"
4
+ require "inst_statsd"
5
5
 
6
- require_relative 'inst_jobs_statsd/default_tracking'
7
- require_relative 'inst_jobs_statsd/jobs_tracker'
6
+ require_relative "inst_jobs_statsd/version"
8
7
 
9
- require_relative 'inst_jobs_statsd/naming'
8
+ require_relative "inst_jobs_statsd/default_tracking"
9
+ require_relative "inst_jobs_statsd/jobs_tracker"
10
10
 
11
- require_relative 'inst_jobs_statsd/stats/counters'
12
- require_relative 'inst_jobs_statsd/stats/counters/create'
13
- require_relative 'inst_jobs_statsd/stats/counters/run'
14
- require_relative 'inst_jobs_statsd/stats/counters/complete'
11
+ require_relative "inst_jobs_statsd/naming"
15
12
 
16
- require_relative 'inst_jobs_statsd/stats/periodic'
17
- require_relative 'inst_jobs_statsd/stats/periodic/failed'
18
- require_relative 'inst_jobs_statsd/stats/periodic/queue'
19
- require_relative 'inst_jobs_statsd/stats/periodic/run'
13
+ require_relative "inst_jobs_statsd/stats/counters"
14
+ require_relative "inst_jobs_statsd/stats/counters/create"
15
+ require_relative "inst_jobs_statsd/stats/counters/run"
16
+ require_relative "inst_jobs_statsd/stats/counters/complete"
20
17
 
21
- require_relative 'inst_jobs_statsd/stats/timing'
22
- require_relative 'inst_jobs_statsd/stats/timing/failed'
23
- require_relative 'inst_jobs_statsd/stats/timing/perform'
24
- require_relative 'inst_jobs_statsd/stats/timing/pop'
25
- require_relative 'inst_jobs_statsd/ext/job'
18
+ require_relative "inst_jobs_statsd/stats/periodic"
19
+ require_relative "inst_jobs_statsd/stats/periodic/failed"
20
+ require_relative "inst_jobs_statsd/stats/periodic/queue"
21
+ require_relative "inst_jobs_statsd/stats/periodic/run"
26
22
 
27
- ::InstStatsd::DefaultTracking.include InstJobsStatsd::DefaultTracking
23
+ require_relative "inst_jobs_statsd/stats/timing"
24
+ require_relative "inst_jobs_statsd/stats/timing/failed"
25
+ require_relative "inst_jobs_statsd/stats/timing/perform"
26
+ require_relative "inst_jobs_statsd/stats/timing/pop"
27
+ require_relative "inst_jobs_statsd/ext/job"
28
+
29
+ InstStatsd::DefaultTracking.include InstJobsStatsd::DefaultTracking
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Defines InstStatsd::DefaultTracking.track_jobs
2
4
  # to be consistent with InstStatsd::DefaultTracking.track_sql etc
3
5
  module InstJobsStatsd
@@ -8,7 +10,7 @@ module InstJobsStatsd
8
10
 
9
11
  module ClassMethods
10
12
  def track_jobs(enable_periodic_queries: true)
11
- @jobs_tracker ||= JobsTracker.new(enable_periodic_queries: enable_periodic_queries)
13
+ @jobs_tracker ||= JobsTracker.new(enable_periodic_queries: enable_periodic_queries) # rubocop:disable Naming/MemoizedInstanceVariableName
12
14
  end
13
15
  end
14
16
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Ext
3
5
  module Job
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  class JobsTracker
3
5
  def self.track(enable_periodic_queries: true)
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Naming
3
- BASENAME = 'delayedjob'.freeze
5
+ BASENAME = "delayedjob"
4
6
 
5
7
  # The root prefix for all stat names
6
8
  # TODO: Make this configurable
@@ -8,10 +10,6 @@ module InstJobsStatsd
8
10
  BASENAME
9
11
  end
10
12
 
11
- def self.configure(strand_filter: nil)
12
- @strand_filter = strand_filter
13
- end
14
-
15
13
  def self.qualified_names(stat_name, job)
16
14
  names = ["#{basename}.#{stat_name}"]
17
15
  tagged = tagged_stat(names[0], job)
@@ -37,29 +35,27 @@ module InstJobsStatsd
37
35
  def self.dd_job_tags(job)
38
36
  tags = dd_region_tags
39
37
  return tags unless job
40
- tags = custom_tags(job, tags)
38
+
39
+ tags[:cluster] = job.current_shard&.database_server&.id if job.respond_to?(:current_shard)
40
+ tags[:priority] = job.priority
41
+ tags.compact!
42
+
41
43
  return tags unless job.tag
42
- return tags if job.tag =~ /Class:0x/
44
+ return tags if job.tag.include?("Class:0x")
43
45
 
44
46
  method_tag, obj_tag = split_to_tag(job)
45
47
  tag = obj_tag
46
- tag = [obj_tag, method_tag].join('.') if method_tag.present?
48
+ tag = [obj_tag, method_tag].join(".") if method_tag.present?
47
49
  tags[:tag] = tag
48
50
  tags
49
51
  end
50
52
 
51
- def self.custom_tags(job, tags)
52
- tags[:jobshard] = job.shard.id if job.respond_to?(:shard)
53
- tags[:strand] = job.strand if job&.strand && @strand_filter&.call(job)
54
- tags
55
- end
56
-
57
53
  # this converts Foo#bar" or "Foo.bar" into "Foo and "bar",
58
54
  # and makes sure the values are valid to be used for statsd names
59
55
  def self.job_tags(job)
60
56
  return unless job
61
57
  return unless job.tag
62
- return if job.tag =~ /Class:0x/
58
+ return if job.tag.include?("Class:0x")
63
59
 
64
60
  method_tag, obj_tag = split_to_tag(job)
65
61
  tags = [obj_tag]
@@ -70,26 +66,25 @@ module InstJobsStatsd
70
66
  # We are using all existing stat names here because we do not want
71
67
  # to break existing dependencies on the non-regioned data
72
68
  def self.region_tags(stat_names)
73
- return unless ENV['INST_JOBS_STATSD_NAMESPACE']
69
+ return unless ENV["INST_JOBS_STATSD_NAMESPACE"]
74
70
 
75
71
  stat_names.map do |name|
76
72
  name
77
- .split('.')
78
- .insert(2, ENV['INST_JOBS_STATSD_NAMESPACE'])
79
- .join('.')
73
+ .split(".")
74
+ .insert(2, ENV["INST_JOBS_STATSD_NAMESPACE"])
75
+ .join(".")
80
76
  end
81
77
  end
82
78
 
83
79
  def self.dd_region_tags
84
- return {} unless ENV['INST_JOBS_STATSD_NAMESPACE']
85
- { namespace: ENV['INST_JOBS_STATSD_NAMESPACE'] }
86
- end
80
+ return {} unless ENV["INST_JOBS_STATSD_NAMESPACE"]
87
81
 
88
- private
82
+ { namespace: ENV["INST_JOBS_STATSD_NAMESPACE"] }
83
+ end
89
84
 
90
85
  def self.split_to_tag(job)
91
86
  obj_tag, method_tag = job.tag.split(/[\.#]/, 2).map do |v|
92
- InstStatsd::Statsd.escape(v).gsub('::', '-')
87
+ InstStatsd::Statsd.escape(v).gsub("::", "-")
93
88
  end
94
89
  [method_tag, obj_tag]
95
90
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Stats
3
5
  module Counters
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Stats
3
5
  module Counters
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Stats
3
5
  module Counters
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Stats
3
5
  module Counters
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Stats
3
5
  module Periodic
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Stats
3
5
  module Periodic
@@ -35,7 +37,7 @@ module InstJobsStatsd
35
37
  jobs_run_at = queued_jobs_scope.limit(10_000).pluck(:run_at)
36
38
  age_secs = jobs_run_at.map { |t| Delayed::Job.db_time_now - t }
37
39
  Periodic.report_gauge(:queue_age_total, age_secs.sum)
38
- Periodic.report_gauge(:queue_age_max, age_secs.max)
40
+ Periodic.report_gauge(:queue_age_max, age_secs.max || 0)
39
41
  end
40
42
 
41
43
  def self.queued_jobs_scope
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Stats
3
5
  module Periodic
@@ -26,7 +28,7 @@ module InstJobsStatsd
26
28
  jobs_run_at = running_jobs_scope.limit(10_000).pluck(:run_at)
27
29
  age_secs = jobs_run_at.map { |t| Delayed::Job.db_time_now - t }
28
30
  Periodic.report_gauge(:run_age_total, age_secs.sum)
29
- Periodic.report_gauge(:run_age_max, age_secs.max)
31
+ Periodic.report_gauge(:run_age_max, age_secs.max || 0)
30
32
  end
31
33
 
32
34
  def self.running_jobs_scope
@@ -1,12 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Stats
3
5
  module Periodic
4
6
  def self.enable_callbacks
5
- @instance ||= Callbacks.new
7
+ @instance ||= Callbacks.new # rubocop:disable Naming/MemoizedInstanceVariableName
6
8
  end
7
9
 
8
10
  def self.add(proc)
9
11
  return unless @instance
12
+
10
13
  @instance.add(proc)
11
14
  end
12
15
 
@@ -72,6 +75,7 @@ module InstJobsStatsd
72
75
  # When the required interval of time has passed, execute the given block
73
76
  def tick
74
77
  return unless Delayed::Job.db_time_now >= @next_run
78
+
75
79
  update_next_run
76
80
  yield
77
81
  end
@@ -83,7 +87,7 @@ module InstJobsStatsd
83
87
  # from the target interval as much as possible
84
88
  def update_next_run
85
89
  ticks = ((Delayed::Job.db_time_now - @start_time) / @min_interval).floor
86
- @next_run = @start_time + (ticks + 1) * @min_interval
90
+ @next_run = @start_time + ((ticks + 1) * @min_interval)
87
91
  end
88
92
  end
89
93
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Stats
3
5
  module Timing
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Stats
3
5
  module Timing
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Stats
3
5
  module Timing
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
4
  module Stats
3
5
  module Timing
4
- def self.report_timing(stat, job: nil, timing: nil, sample_rate: 1)
6
+ def self.report_timing(stat, job: nil, timing: nil, sample_rate: 1, &block)
5
7
  stats = Naming.qualified_names(stat, job)
6
8
 
7
- if block_given?
8
- InstStatsd::Statsd.time(stats, sample_rate, short_stat: stat, tags: Naming.dd_job_tags(job)) { yield }
9
+ if block
10
+ InstStatsd::Statsd.time(stats, sample_rate, short_stat: stat, tags: Naming.dd_job_tags(job), &block)
9
11
  else
10
12
  InstStatsd::Statsd.timing(stats, timing, sample_rate, short_stat: stat, tags: Naming.dd_job_tags(job))
11
13
  end
@@ -13,12 +15,14 @@ module InstJobsStatsd
13
15
 
14
16
  def self.report_job_timing_queued(job)
15
17
  return unless job
18
+
16
19
  time_in_queue = ((Delayed::Job.db_time_now - job.run_at) * 1000).round
17
20
  report_timing(:queue, job: job, timing: time_in_queue)
18
21
  end
19
22
 
20
23
  def self.report_job_timing_failed(job)
21
24
  return unless job
25
+
22
26
  time_to_failure = ((Delayed::Job.db_time_now - job.run_at) * 1000).round
23
27
  report_timing(:failed_after, job: job, timing: time_to_failure)
24
28
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstJobsStatsd
2
- VERSION = '2.2.0'.freeze
4
+ VERSION = "3.0.2"
3
5
  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.2.0
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Slade
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-25 00:00:00.000000000 Z
11
+ date: 2023-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inst-jobs
@@ -34,24 +34,18 @@ dependencies:
34
34
  name: inst_statsd
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: 2.1.2
40
- - - "<"
37
+ - - "~>"
41
38
  - !ruby/object:Gem::Version
42
39
  version: '3.0'
43
40
  type: :runtime
44
41
  prerelease: false
45
42
  version_requirements: !ruby/object:Gem::Requirement
46
43
  requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: 2.1.2
50
- - - "<"
44
+ - - "~>"
51
45
  - !ruby/object:Gem::Version
52
46
  version: '3.0'
53
47
  - !ruby/object:Gem::Dependency
54
- name: bump
48
+ name: bundler
55
49
  requirement: !ruby/object:Gem::Requirement
56
50
  requirements:
57
51
  - - ">="
@@ -65,21 +59,21 @@ dependencies:
65
59
  - !ruby/object:Gem::Version
66
60
  version: '0'
67
61
  - !ruby/object:Gem::Dependency
68
- name: bundler
62
+ name: database_cleaner
69
63
  requirement: !ruby/object:Gem::Requirement
70
64
  requirements:
71
- - - ">="
65
+ - - "~>"
72
66
  - !ruby/object:Gem::Version
73
- version: '0'
67
+ version: '2.0'
74
68
  type: :development
75
69
  prerelease: false
76
70
  version_requirements: !ruby/object:Gem::Requirement
77
71
  requirements:
78
- - - ">="
72
+ - - "~>"
79
73
  - !ruby/object:Gem::Version
80
- version: '0'
74
+ version: '2.0'
81
75
  - !ruby/object:Gem::Dependency
82
- name: byebug
76
+ name: debug
83
77
  requirement: !ruby/object:Gem::Requirement
84
78
  requirements:
85
79
  - - ">="
@@ -93,21 +87,7 @@ dependencies:
93
87
  - !ruby/object:Gem::Version
94
88
  version: '0'
95
89
  - !ruby/object:Gem::Dependency
96
- name: database_cleaner
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "~>"
100
- - !ruby/object:Gem::Version
101
- version: '1.7'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: '1.7'
109
- - !ruby/object:Gem::Dependency
110
- name: factory_girl
90
+ name: factory_bot
111
91
  requirement: !ruby/object:Gem::Requirement
112
92
  requirements:
113
93
  - - ">="
@@ -177,19 +157,75 @@ dependencies:
177
157
  - !ruby/object:Gem::Version
178
158
  version: '3.9'
179
159
  - !ruby/object:Gem::Dependency
180
- name: rubocop
160
+ name: rubocop-factory_bot
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: '2.24'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: '2.24'
173
+ - !ruby/object:Gem::Dependency
174
+ name: rubocop-inst
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '1.0'
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - "~>"
185
+ - !ruby/object:Gem::Version
186
+ version: '1.0'
187
+ - !ruby/object:Gem::Dependency
188
+ name: rubocop-rails
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - "~>"
192
+ - !ruby/object:Gem::Version
193
+ version: '2.21'
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - "~>"
199
+ - !ruby/object:Gem::Version
200
+ version: '2.21'
201
+ - !ruby/object:Gem::Dependency
202
+ name: rubocop-rake
203
+ requirement: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - "~>"
206
+ - !ruby/object:Gem::Version
207
+ version: '0.6'
208
+ type: :development
209
+ prerelease: false
210
+ version_requirements: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - "~>"
213
+ - !ruby/object:Gem::Version
214
+ version: '0.6'
215
+ - !ruby/object:Gem::Dependency
216
+ name: rubocop-rspec
181
217
  requirement: !ruby/object:Gem::Requirement
182
218
  requirements:
183
219
  - - "~>"
184
220
  - !ruby/object:Gem::Version
185
- version: 0.48.0
221
+ version: '2.24'
186
222
  type: :development
187
223
  prerelease: false
188
224
  version_requirements: !ruby/object:Gem::Requirement
189
225
  requirements:
190
226
  - - "~>"
191
227
  - !ruby/object:Gem::Version
192
- version: 0.48.0
228
+ version: '2.24'
193
229
  - !ruby/object:Gem::Dependency
194
230
  name: simplecov
195
231
  requirement: !ruby/object:Gem::Requirement
@@ -232,7 +268,7 @@ dependencies:
232
268
  - - "~>"
233
269
  - !ruby/object:Gem::Version
234
270
  version: 1.4.0
235
- description:
271
+ description:
236
272
  email:
237
273
  - jslade@instructure.com
238
274
  executables: []
@@ -257,32 +293,12 @@ files:
257
293
  - lib/inst_jobs_statsd/stats/timing/perform.rb
258
294
  - lib/inst_jobs_statsd/stats/timing/pop.rb
259
295
  - lib/inst_jobs_statsd/version.rb
260
- - spec/factories/jobs.rb
261
- - spec/factories/workers.rb
262
- - spec/gemfiles/60.gemfile
263
- - spec/inst_jobs_statsd/ext/job_spec.rb
264
- - spec/inst_jobs_statsd/jobs_tracker_spec.rb
265
- - spec/inst_jobs_statsd/naming_spec.rb
266
- - spec/inst_jobs_statsd/stats/counters/complete_spec.rb
267
- - spec/inst_jobs_statsd/stats/counters/create_spec.rb
268
- - spec/inst_jobs_statsd/stats/counters/run_spec.rb
269
- - spec/inst_jobs_statsd/stats/periodic/failed_spec.rb
270
- - spec/inst_jobs_statsd/stats/periodic/queue_spec.rb
271
- - spec/inst_jobs_statsd/stats/periodic/run_spec.rb
272
- - spec/inst_jobs_statsd/stats/periodic_spec.rb
273
- - spec/inst_jobs_statsd/stats/timing/failed_spec.rb
274
- - spec/inst_jobs_statsd/stats/timing/perform_spec.rb
275
- - spec/inst_jobs_statsd/stats/timing/pop_spec.rb
276
- - spec/inst_jobs_statsd/stats/timing_spec.rb
277
- - spec/inst_statsd/default_tracking_spec.rb
278
- - spec/matchers.rb
279
- - spec/setup_test_db.rb
280
- - spec/spec_helper.rb
281
296
  homepage: https://github.com/instructure/inst-jobs-statsd
282
297
  licenses:
283
298
  - MIT
284
- metadata: {}
285
- post_install_message:
299
+ metadata:
300
+ rubygems_mfa_required: 'true'
301
+ post_install_message:
286
302
  rdoc_options: []
287
303
  require_paths:
288
304
  - lib
@@ -290,36 +306,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
290
306
  requirements:
291
307
  - - ">="
292
308
  - !ruby/object:Gem::Version
293
- version: '2.4'
309
+ version: '2.7'
294
310
  required_rubygems_version: !ruby/object:Gem::Requirement
295
311
  requirements:
296
312
  - - ">="
297
313
  - !ruby/object:Gem::Version
298
314
  version: '0'
299
315
  requirements: []
300
- rubygems_version: 3.1.4
301
- signing_key:
316
+ rubygems_version: 3.4.19
317
+ signing_key:
302
318
  specification_version: 4
303
319
  summary: Stats reporting for inst-jobs
304
- test_files:
305
- - spec/factories/jobs.rb
306
- - spec/factories/workers.rb
307
- - spec/gemfiles/60.gemfile
308
- - spec/inst_jobs_statsd/ext/job_spec.rb
309
- - spec/inst_jobs_statsd/jobs_tracker_spec.rb
310
- - spec/inst_jobs_statsd/naming_spec.rb
311
- - spec/inst_jobs_statsd/stats/counters/complete_spec.rb
312
- - spec/inst_jobs_statsd/stats/counters/create_spec.rb
313
- - spec/inst_jobs_statsd/stats/counters/run_spec.rb
314
- - spec/inst_jobs_statsd/stats/periodic/failed_spec.rb
315
- - spec/inst_jobs_statsd/stats/periodic/queue_spec.rb
316
- - spec/inst_jobs_statsd/stats/periodic/run_spec.rb
317
- - spec/inst_jobs_statsd/stats/periodic_spec.rb
318
- - spec/inst_jobs_statsd/stats/timing/failed_spec.rb
319
- - spec/inst_jobs_statsd/stats/timing/perform_spec.rb
320
- - spec/inst_jobs_statsd/stats/timing/pop_spec.rb
321
- - spec/inst_jobs_statsd/stats/timing_spec.rb
322
- - spec/inst_statsd/default_tracking_spec.rb
323
- - spec/matchers.rb
324
- - spec/setup_test_db.rb
325
- - spec/spec_helper.rb
320
+ test_files: []
@@ -1,9 +0,0 @@
1
- FactoryGirl.define do
2
- class JobFixture
3
- attr_accessor :tag, :run_at, :strand
4
- end
5
-
6
- factory :job_fixture, aliases: [:job] do
7
- tag 'Test::Job.perform'
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- FactoryGirl.define do
2
- class WorkerFixture
3
- attr_accessor :name
4
- end
5
-
6
- factory :worker_fixture, aliases: [:worker] do
7
- sequence(:name) { |n| "worker-#{n}" }
8
- end
9
- end
@@ -1,7 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec :path=>"../../"
4
-
5
- gem "rails", "~> 6.0"
6
- gem "sinatra", "~> 2.0.8"
7
- gem "sinatra-contrib", "~> 2.0.8"
@@ -1,17 +0,0 @@
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
- allow(InstStatsd::Statsd).to receive(:count)
9
-
10
- x.delay.perform
11
- Delayed::Job.first.fail!
12
-
13
- expect(InstStatsd::Statsd).to have_received(:count)
14
- .with(array_including(/\.failed$/), 1, 1, short_stat: :failed, tags: {})
15
- end
16
- end
17
- end