sidekiq-statsd 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 9b8a4ac6c1f0743a23deef99ff8c15a6945bcbef
4
- data.tar.gz: da3531070c7e1a356781764c921f5585f2f860f5
3
+ metadata.gz: e503321ba26e952392c4fab627b35d93f2fa479f
4
+ data.tar.gz: 8e34258548cf2c0cbe099874821b6b67e76dd019
5
5
  SHA512:
6
- metadata.gz: 3252525ba7a1000a6a61468f0de9680bd6fd728c67db1e24ab6d6e8f87f31ac25a60a4c8bb9e43b8824cb5a680958aeb059ef56b26356a50662623cdffafe0d1
7
- data.tar.gz: 4cdd5df80775b6e5827254152369e53f4b9d119d52baa771ca314e69e1e8ce7b223125ba43612b06cbceebc4f00a8cdbed11abf6737eb59e3f4c381a71d0dec1
6
+ metadata.gz: 01c88a2d9f2a5d9f543d371fad1e0aade1a56b13d601c086c8379cae36c95be8b928609e103ef9d37e1ff5d059fb1bf01df70028d3406b52f5c5a39c9af86bd4
7
+ data.tar.gz: affdca31989581d3e757645c2a4189c203c2a2503f9946aa473faf62226053194a095308e3807533c76c5255be5f8913b970acc00b56eeb33fd9211bf0f99c2f
data/.travis.yml CHANGED
@@ -1,9 +1,22 @@
1
1
  language: ruby
2
+ services:
3
+ - redis
2
4
  rvm:
3
- - 1.9.3
4
5
  - jruby-19mode
5
6
  - rbx-19mode
7
+ - 1.9.3
6
8
  - 2.0.0
9
+ - 2.1.0
10
+ - 2.1.1
11
+ env:
12
+ matrix:
13
+ - SIDEKIQ_VERSION="~> 2.6.0"
14
+ - SIDEKIQ_VERSION="~> 2.17.0"
15
+ - SIDEKIQ_VERSION="~> 3.0.0"
16
+ matrix:
17
+ allow_failures:
18
+ - rvm: jruby-19mode
19
+ - rvm: rbx-19mode
7
20
  branches:
8
21
  only:
9
22
  - master
@@ -11,8 +24,3 @@ notifications:
11
24
  email:
12
25
  recipients:
13
26
  - pablo@pablocantero.com
14
- matrix:
15
- allow_failures:
16
- - rvm: jruby-19mode
17
- - rvm: rbx-19mode
18
- - rvm: 2.0.0
data/Gemfile CHANGED
@@ -1,4 +1,24 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in sidekiq-throttler.gemspec
1
+ source 'https://rubygems.org'
4
2
  gemspec
3
+
4
+ gem 'sidekiq', ENV['SIDEKIQ_VERSION'] if ENV['SIDEKIQ_VERSION']
5
+
6
+ group :development do
7
+ gem "rake"
8
+ gem "pry"
9
+ gem "yard"
10
+ gem "redcarpet", platforms: [:ruby]
11
+
12
+ gem "rspec"
13
+ gem "rspec-redis_helper"
14
+ gem "timecop"
15
+ gem "simplecov"
16
+
17
+ gem "guard"
18
+ gem "guard-bundler"
19
+ gem "guard-rspec"
20
+ gem "guard-yard"
21
+ gem "rb-fsevent"
22
+ gem "rb-inotify"
23
+ gem "growl"
24
+ end
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Build Status](https://secure.travis-ci.org/phstc/sidekiq-statsd.png)](http://travis-ci.org/phstc/sidekiq-statsd)
4
4
  [![Dependency Status](https://gemnasium.com/phstc/sidekiq-statsd.png)](https://gemnasium.com/phstc/sidekiq-statsd)
5
5
 
6
- Sidekiq StatsD is a middleware to increment your worker executions counter (success and failures).
6
+ Sidekiq StatsD is a [Sidekiq server middleware](https://github.com/mperham/sidekiq/wiki/Middleware) to send [Sidekiq worker metrics](https://github.com/mperham/sidekiq/wiki/API#wiki-stats) through [statsd](https://github.com/reinh/statsd).
7
7
 
8
8
  ## Compatibility
9
9
 
@@ -34,7 +34,11 @@ Sidekiq.configure_server do |config|
34
34
  chain.add Sidekiq::Statsd::ServerMiddleware, env: "production", prefix: "worker", host: "localhost", port: 8125
35
35
  end
36
36
  end
37
+ ```
38
+
39
+ ### Sidekiq::Statsd::ServerMiddleware options
37
40
 
41
+ ```ruby
38
42
  # @param [Hash] options The options to initialize the StatsD client.
39
43
  # @option options [Statsd] :statsd Existing statsd client to use.
40
44
  # @option options [String] :env ("production") The env to segment the metric key (e.g. env.prefix.worker_name.success|failure).
@@ -43,6 +47,8 @@ end
43
47
  # @option options [String] :port ("8125") The StatsD port.
44
48
  ```
45
49
 
50
+ If you have a [statsd instance](https://github.com/github/statsd-ruby) you can pass it through the `:statsd` option. If not you can pass the `:host` and `:port` to connect to statsd.
51
+
46
52
  ## Contributing
47
53
 
48
54
  1. Fork it
data/Rakefile CHANGED
@@ -1,18 +1,9 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+ require "sidekiq/statsd/version"
2
4
 
3
- require "rspec/core/rake_task"
4
5
  RSpec::Core::RakeTask.new(:spec) do |spec|
5
- spec.pattern = FileList["spec/**/*_spec.rb"]
6
+ spec.pattern = FileList['spec/**/*_spec.rb']
6
7
  end
7
8
 
8
- task :default => :spec
9
-
10
- require "yard"
11
- YARD::Rake::YardocTask.new
12
-
13
- desc "Start Pry with runtime dependencies loaded"
14
- task :console, :script do |t, args|
15
- command = "bundle exec pry"
16
- command += "-r #{args[:script]}" if args[:script]
17
- sh command
18
- end
9
+ task default: :spec
@@ -54,7 +54,9 @@ module Sidekiq::Statsd
54
54
  queue_name = msg['queue']
55
55
  sidekiq_queue = Sidekiq::Queue.new(queue_name)
56
56
  b.gauge prefix('queues', queue_name, 'enqueued'), sidekiq_queue.size
57
- b.gauge prefix('queues', queue_name, 'latency'), sidekiq_queue.latency
57
+ if sidekiq_queue.respond_to?(:latency)
58
+ b.gauge prefix('queues', queue_name, 'latency'), sidekiq_queue.latency
59
+ end
58
60
  end
59
61
  end
60
62
  end
@@ -1,6 +1,6 @@
1
1
  module Sidekiq
2
2
  module Statsd
3
- VERSION = "0.1.2"
3
+ VERSION = '0.1.3'
4
4
  end
5
5
  end
6
6
 
@@ -1,4 +1,5 @@
1
1
  require "sidekiq"
2
+ require "sidekiq/api"
2
3
  require "active_support"
3
4
  require "active_support/core_ext"
4
5
 
@@ -8,8 +8,8 @@ Gem::Specification.new do |gem|
8
8
  gem.version = Sidekiq::Statsd::VERSION
9
9
  gem.authors = ["Pablo Cantero"]
10
10
  gem.email = ["pablo@pablocantero.com"]
11
- gem.description = %q{Sidekiq StatsD is a middleware to increment your worker executions counter (success and failures).}
12
- gem.summary = %q{Sidekiq StatsD is a middleware to increment your worker executions counter (success and failures).}
11
+ gem.description = %q{Sidekiq StatsD is a Sidekiq server middleware to send Sidekiq worker metrics through statsd.}
12
+ gem.summary = %q{Sidekiq StatsD is a Sidekiq server middleware to send Sidekiq worker metrics through statsd.}
13
13
  gem.homepage = "https://github.com/phstc/sidekiq-statsd"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
@@ -18,24 +18,6 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
 
20
20
  gem.add_dependency "activesupport"
21
- gem.add_dependency "sidekiq", ">= 2.5", "< 3.0"
21
+ gem.add_dependency "sidekiq", ">= 2.6"
22
22
  gem.add_dependency "statsd-ruby", ">= 1.1.0"
23
-
24
- gem.add_development_dependency "rake"
25
- gem.add_development_dependency "pry"
26
- gem.add_development_dependency "yard"
27
- gem.add_development_dependency "redcarpet"
28
-
29
- gem.add_development_dependency "rspec"
30
- gem.add_development_dependency "rspec-redis_helper"
31
- gem.add_development_dependency "timecop"
32
- gem.add_development_dependency "simplecov"
33
-
34
- gem.add_development_dependency "guard"
35
- gem.add_development_dependency "guard-bundler"
36
- gem.add_development_dependency "guard-rspec"
37
- gem.add_development_dependency "guard-yard"
38
- gem.add_development_dependency "rb-fsevent"
39
- gem.add_development_dependency "rb-inotify"
40
- gem.add_development_dependency "growl"
41
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-statsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Cantero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-10 00:00:00.000000000 Z
11
+ date: 2014-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,20 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '>='
32
32
  - !ruby/object:Gem::Version
33
- version: '2.5'
34
- - - <
35
- - !ruby/object:Gem::Version
36
- version: '3.0'
33
+ version: '2.6'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - '>='
42
39
  - !ruby/object:Gem::Version
43
- version: '2.5'
44
- - - <
45
- - !ruby/object:Gem::Version
46
- version: '3.0'
40
+ version: '2.6'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: statsd-ruby
49
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,218 +52,8 @@ dependencies:
58
52
  - - '>='
59
53
  - !ruby/object:Gem::Version
60
54
  version: 1.1.0
61
- - !ruby/object:Gem::Dependency
62
- name: rake
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - '>='
66
- - !ruby/object:Gem::Version
67
- version: '0'
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - '>='
73
- - !ruby/object:Gem::Version
74
- version: '0'
75
- - !ruby/object:Gem::Dependency
76
- name: pry
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - '>='
80
- - !ruby/object:Gem::Version
81
- version: '0'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - '>='
87
- - !ruby/object:Gem::Version
88
- version: '0'
89
- - !ruby/object:Gem::Dependency
90
- name: yard
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - '>='
94
- - !ruby/object:Gem::Version
95
- version: '0'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - '>='
101
- - !ruby/object:Gem::Version
102
- version: '0'
103
- - !ruby/object:Gem::Dependency
104
- name: redcarpet
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - '>='
115
- - !ruby/object:Gem::Version
116
- version: '0'
117
- - !ruby/object:Gem::Dependency
118
- name: rspec
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - '>='
122
- - !ruby/object:Gem::Version
123
- version: '0'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - '>='
129
- - !ruby/object:Gem::Version
130
- version: '0'
131
- - !ruby/object:Gem::Dependency
132
- name: rspec-redis_helper
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - '>='
136
- - !ruby/object:Gem::Version
137
- version: '0'
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - '>='
143
- - !ruby/object:Gem::Version
144
- version: '0'
145
- - !ruby/object:Gem::Dependency
146
- name: timecop
147
- requirement: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - '>='
150
- - !ruby/object:Gem::Version
151
- version: '0'
152
- type: :development
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - '>='
157
- - !ruby/object:Gem::Version
158
- version: '0'
159
- - !ruby/object:Gem::Dependency
160
- name: simplecov
161
- requirement: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - '>='
164
- - !ruby/object:Gem::Version
165
- version: '0'
166
- type: :development
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - '>='
171
- - !ruby/object:Gem::Version
172
- version: '0'
173
- - !ruby/object:Gem::Dependency
174
- name: guard
175
- requirement: !ruby/object:Gem::Requirement
176
- requirements:
177
- - - '>='
178
- - !ruby/object:Gem::Version
179
- version: '0'
180
- type: :development
181
- prerelease: false
182
- version_requirements: !ruby/object:Gem::Requirement
183
- requirements:
184
- - - '>='
185
- - !ruby/object:Gem::Version
186
- version: '0'
187
- - !ruby/object:Gem::Dependency
188
- name: guard-bundler
189
- requirement: !ruby/object:Gem::Requirement
190
- requirements:
191
- - - '>='
192
- - !ruby/object:Gem::Version
193
- version: '0'
194
- type: :development
195
- prerelease: false
196
- version_requirements: !ruby/object:Gem::Requirement
197
- requirements:
198
- - - '>='
199
- - !ruby/object:Gem::Version
200
- version: '0'
201
- - !ruby/object:Gem::Dependency
202
- name: guard-rspec
203
- requirement: !ruby/object:Gem::Requirement
204
- requirements:
205
- - - '>='
206
- - !ruby/object:Gem::Version
207
- version: '0'
208
- type: :development
209
- prerelease: false
210
- version_requirements: !ruby/object:Gem::Requirement
211
- requirements:
212
- - - '>='
213
- - !ruby/object:Gem::Version
214
- version: '0'
215
- - !ruby/object:Gem::Dependency
216
- name: guard-yard
217
- requirement: !ruby/object:Gem::Requirement
218
- requirements:
219
- - - '>='
220
- - !ruby/object:Gem::Version
221
- version: '0'
222
- type: :development
223
- prerelease: false
224
- version_requirements: !ruby/object:Gem::Requirement
225
- requirements:
226
- - - '>='
227
- - !ruby/object:Gem::Version
228
- version: '0'
229
- - !ruby/object:Gem::Dependency
230
- name: rb-fsevent
231
- requirement: !ruby/object:Gem::Requirement
232
- requirements:
233
- - - '>='
234
- - !ruby/object:Gem::Version
235
- version: '0'
236
- type: :development
237
- prerelease: false
238
- version_requirements: !ruby/object:Gem::Requirement
239
- requirements:
240
- - - '>='
241
- - !ruby/object:Gem::Version
242
- version: '0'
243
- - !ruby/object:Gem::Dependency
244
- name: rb-inotify
245
- requirement: !ruby/object:Gem::Requirement
246
- requirements:
247
- - - '>='
248
- - !ruby/object:Gem::Version
249
- version: '0'
250
- type: :development
251
- prerelease: false
252
- version_requirements: !ruby/object:Gem::Requirement
253
- requirements:
254
- - - '>='
255
- - !ruby/object:Gem::Version
256
- version: '0'
257
- - !ruby/object:Gem::Dependency
258
- name: growl
259
- requirement: !ruby/object:Gem::Requirement
260
- requirements:
261
- - - '>='
262
- - !ruby/object:Gem::Version
263
- version: '0'
264
- type: :development
265
- prerelease: false
266
- version_requirements: !ruby/object:Gem::Requirement
267
- requirements:
268
- - - '>='
269
- - !ruby/object:Gem::Version
270
- version: '0'
271
- description: Sidekiq StatsD is a middleware to increment your worker executions counter
272
- (success and failures).
55
+ description: Sidekiq StatsD is a Sidekiq server middleware to send Sidekiq worker
56
+ metrics through statsd.
273
57
  email:
274
58
  - pablo@pablocantero.com
275
59
  executables: []
@@ -317,8 +101,8 @@ rubyforge_project:
317
101
  rubygems_version: 2.0.14
318
102
  signing_key:
319
103
  specification_version: 4
320
- summary: Sidekiq StatsD is a middleware to increment your worker executions counter
321
- (success and failures).
104
+ summary: Sidekiq StatsD is a Sidekiq server middleware to send Sidekiq worker metrics
105
+ through statsd.
322
106
  test_files:
323
107
  - spec/sidekiq/statsd/server_middleware_spec.rb
324
108
  - spec/spec.opts