sidekiq-instrument 0.2.0 → 0.4.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
- SHA1:
3
- metadata.gz: 391051ad42c61a79e0a2301b8eba92c8e1056b85
4
- data.tar.gz: caa51ab4eaa2492c7167eb730aebea764b0af7d1
2
+ SHA256:
3
+ metadata.gz: e96e8e7a4d3b2dbb86d2ab4be8c52873d1ddf88a1e4b608ed914e46b506a1f11
4
+ data.tar.gz: 64dacd4a762f0548f92201572b971b91efe58c9fe568958ef1c9ff3268853ffa
5
5
  SHA512:
6
- metadata.gz: 7ae21fbedab0ad3f1946007f8709d6ced2116cd01aefda7326e159ff8c65aad3860eee5cd6952a9fafbb4602a3287e731f61cfd8fdfa952fc5ec6b2ddf84ce44
7
- data.tar.gz: f8cede5f20b0b591b62cd02bc7c212a34b904fd885727e0d7dc6e03d81a4e1e506ff7c3551f00d2589174c3443512bd52ba78aa7305ac2bb64d454f8f85b22fd
6
+ metadata.gz: e9989ff9bf4b93726cb7253e3be785ad019531ec5d4f103a72c3b6661b2a3e67c49e8f5ec8aa687b2dc7dca37013bf0c29caf378ed7060575f3a3c3203877728
7
+ data.tar.gz: 1cbcd46fb20b2040da7d6d3d0ad8244fb39527733baa61a9f80d57bb418eba48c3a7ff1703fdc9eab757e5e5251bb8bbd08ce3cee96ab6784a813779a5bb0e52
data/.travis.yml CHANGED
@@ -1,9 +1,20 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.3.0
4
+ - 2.5.8
5
+ - 2.6.6
6
+ - 2.7.2
5
7
 
6
8
  services:
7
9
  - redis-server
8
10
 
9
- before_install: gem install bundler -v 1.12.1
11
+ before_install: gem install bundler -v 2.0.2
12
+
13
+ deploy:
14
+ provider: rubygems
15
+ api_key:
16
+ secure: T0S2ipyvGkY2qL6oxcgZgBl+krGR3qFlL4vNyzy+rvaZAV8YNijQiM7YyggTLhnKai3SxuHjzN1ZiT7vzlklJn9k2qRhU1uVq4xW+YX6yVNBBbugJGqNuyw3p2BUOga83ES2jA/Kby9mLAJEebS5LmupapSCeElsmhYzXIlV9SYH1mZV4CHQ06Luv3r1DQ8z1cwrB+5N+Y9TNV1wXa/LbuxJPl6jgxN0oJ+RFU7lTHtovMwyL+wRXLiRpZc2k6dH0IUo03QxYVCUDIvShdX26WfzF+fpSPRgOHnbJeaBTbeuxntFzEDy6Td2hpRQWP31i+/8BzPWGCLqUfS55uQqFM06UI/vnZnbe8NlI57gzw6yJHPsFoyg8Cw/3TABhw+SEOoMyBdued4RGKF6EgYsx3hW+KUhEvncnBg6F7jRdZgtHmk6s8iU+/d39pgQh4AiCJQOhINErAnnH2P5hM3TDoZYQlkUjw0FQ0F8bTmRKJq4JhMyvtwMutvMuSIN+8q7utNTxzFquvYcmAcNYafsmuC7Qtvpqi0iVzQ3f3c+SCljcvEnUEf66+xufkn79eSAYcCrL/FdZOdBEiXpaY2wdtJO7Kr66BMhzGCjlO8YQoDw0pgsES9Uy5H1JtfphjWzHWYdiYDBoofFURE1jO/pJ9V9dp9ezzOcvW4faZhL8ho=
17
+ gem: sidekiq-instrument
18
+ on:
19
+ tags: true
20
+ repo: enova/sidekiq-instrument
data/README.md CHANGED
@@ -70,6 +70,10 @@ For each job, the following metrics will be reported:
70
70
  The metric names can be changed by overriding the `statsd_metric_name`
71
71
  method in your worker classes.
72
72
 
73
+ For each queue, the following metrics will be reported:
74
+ 1. **shared.sidekiq._queue_.size**: gauge of how many jobs are in the queue
75
+ 1. **shared.sidekiq._queue_.latency**: gauge of how long the oldest job has been in the queue
76
+
73
77
  ## Worker
74
78
  There is a worker, `Sidekiq::Instrument::Worker`, that submits gauges
75
79
  for various interesting statistics; namely, the bulk of the information in `Sidekiq::Stats`
@@ -5,7 +5,8 @@ module Sidekiq::Instrument
5
5
  include Sidekiq::Instrument::MetricNames
6
6
 
7
7
  def call(worker_class, job, queue, redis_pool)
8
- klass = Object.const_get(worker_class)
8
+ # worker_class is a const in sidekiq >= 6.x
9
+ klass = Object.const_get(worker_class.to_s)
9
10
  StatsD.increment metric_name(klass.new, 'enqueue')
10
11
 
11
12
  yield
@@ -4,8 +4,8 @@ module Sidekiq::Instrument
4
4
  if worker.respond_to?(:statsd_metric_name)
5
5
  worker.send(:statsd_metric_name, event)
6
6
  else
7
- queue = worker.sidekiq_options_hash['queue']
8
- name = worker.class.name
7
+ queue = worker.class.get_sidekiq_options['queue']
8
+ name = worker.class.name.gsub('::', '_')
9
9
 
10
10
  "shared.sidekiq.#{queue}.#{name}.#{event}"
11
11
  end
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Instrument
3
- VERSION = "0.2.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
@@ -30,6 +30,10 @@ module Sidekiq::Instrument
30
30
  info.queues.each do |name, size|
31
31
  StatsD.gauge "shared.sidekiq.#{name}.size", size
32
32
  end
33
+
34
+ Sidekiq::Queue.all.each do |queue|
35
+ StatsD.gauge "shared.sidekiq.#{queue.name}.latency", queue.latency
36
+ end
33
37
  end
34
38
  end
35
39
  end
@@ -16,11 +16,11 @@ Gem::Specification.new do |spec|
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
17
  spec.require_paths = ['lib']
18
18
 
19
- spec.add_dependency 'sidekiq', '~> 4.0'
19
+ spec.add_dependency 'sidekiq', '>= 4.2', '< 7'
20
20
  spec.add_dependency 'statsd-instrument', '~> 2.0', '>= 2.0.4'
21
21
 
22
- spec.add_development_dependency 'bundler', '~> 1.12'
23
- spec.add_development_dependency 'rake', '~> 10.0'
22
+ spec.add_development_dependency 'bundler', '~> 2.0', '>= 2.0.2'
23
+ spec.add_development_dependency 'rake', '~> 12.0'
24
24
  spec.add_development_dependency 'rspec', '~> 3.0'
25
25
  spec.add_development_dependency 'pry-byebug', '~> 3.4'
26
26
  spec.add_development_dependency 'coveralls', '~> 0.8'
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-instrument
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Larraz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-18 00:00:00.000000000 Z
11
+ date: 2021-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '4.0'
22
+ version: '7'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '4.2'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '4.0'
32
+ version: '7'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: statsd-instrument
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -50,28 +56,34 @@ dependencies:
50
56
  requirements:
51
57
  - - "~>"
52
58
  - !ruby/object:Gem::Version
53
- version: '1.12'
59
+ version: '2.0'
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 2.0.2
54
63
  type: :development
55
64
  prerelease: false
56
65
  version_requirements: !ruby/object:Gem::Requirement
57
66
  requirements:
58
67
  - - "~>"
59
68
  - !ruby/object:Gem::Version
60
- version: '1.12'
69
+ version: '2.0'
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 2.0.2
61
73
  - !ruby/object:Gem::Dependency
62
74
  name: rake
63
75
  requirement: !ruby/object:Gem::Requirement
64
76
  requirements:
65
77
  - - "~>"
66
78
  - !ruby/object:Gem::Version
67
- version: '10.0'
79
+ version: '12.0'
68
80
  type: :development
69
81
  prerelease: false
70
82
  version_requirements: !ruby/object:Gem::Requirement
71
83
  requirements:
72
84
  - - "~>"
73
85
  - !ruby/object:Gem::Version
74
- version: '10.0'
86
+ version: '12.0'
75
87
  - !ruby/object:Gem::Dependency
76
88
  name: rspec
77
89
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +126,7 @@ dependencies:
114
126
  - - "~>"
115
127
  - !ruby/object:Gem::Version
116
128
  version: '0.8'
117
- description:
129
+ description:
118
130
  email:
119
131
  - mlarraz@enova.com
120
132
  executables: []
@@ -142,7 +154,7 @@ homepage: https://github.com/enova/sidekiq-instrument
142
154
  licenses:
143
155
  - MIT
144
156
  metadata: {}
145
- post_install_message:
157
+ post_install_message:
146
158
  rdoc_options: []
147
159
  require_paths:
148
160
  - lib
@@ -157,9 +169,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
169
  - !ruby/object:Gem::Version
158
170
  version: '0'
159
171
  requirements: []
160
- rubyforge_project:
161
- rubygems_version: 2.5.1
162
- signing_key:
172
+ rubygems_version: 3.1.4
173
+ signing_key:
163
174
  specification_version: 4
164
175
  summary: StatsD instrumentation for Sidekiq
165
176
  test_files: []