sidekiq-statsd 0.1.5 → 1.0.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: 0e70c72f2d9107ff88383d3e2f8a90fdddc8ec22
4
- data.tar.gz: bf3d374265929d5955fcffd003b30f32182134da
2
+ SHA256:
3
+ metadata.gz: e7c691fdc841e5a3f80e8e00ad7fd9b67008f82254d8e73a7b4af06598534559
4
+ data.tar.gz: c73db3ee678d3fd3078e3c5fcf934e9e3c3b786df72bd5b5402ceb8d97f7e030
5
5
  SHA512:
6
- metadata.gz: 4a07e5fd441caf1440f02926a7cef1972413ad11fb68a06574e5eca8530299a74f03acc068481fb63f28df63ebb27dc5736fc627fcac343c3d70fd9ce3732083
7
- data.tar.gz: d8120db511be1257e6f6c7f7cce380806145d93b2f0af4729ff113df2f988dae4c7a04d6b26bfe3a6c121300b2c2346b9278d6157b991a808cee94c68fdf38a3
6
+ metadata.gz: d5058163f365e1bf7f5a96f8796388268003df228cda4cde5a4a38733d5263f58100e198244aa4d990fd0aa864c3b9fc419dd03549f8a078f97bd7b5ef8a7db0
7
+ data.tar.gz: 62d253d5b5484a372d181bbf3b33cfd577ced1cb5fef22b068d605618911a2b37187cb32ccb810c9283602edbf3349f5e2f529871ea1b5beeee3da422209884b
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.4.0
data/.travis.yml CHANGED
@@ -2,21 +2,20 @@ language: ruby
2
2
  services:
3
3
  - redis
4
4
  rvm:
5
- - jruby-19mode
6
- - rbx-19mode
7
- - 1.9.3
8
- - 2.0.0
9
- - 2.1.0
10
- - 2.1.1
5
+ - 2.4.0
6
+ - 2.5.0
7
+ - 2.6.0
11
8
  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
9
+ - SIDEKIQ_VERSION="~> 2.7.0"
10
+ - SIDEKIQ_VERSION="~> 3.0.0"
11
+ - SIDEKIQ_VERSION="~> 4.0.0"
12
+ - SIDEKIQ_VERSION="~> 5.0.0"
13
+ - SIDEKIQ_VERSION="~> 6.0.0"
14
+ jobs:
15
+ exclude:
16
+ # Sidekiq 6 requires Ruby 2.5+
17
+ - rvm: 2.4.0
18
+ env: SIDEKIQ_VERSION="~> 6.0.0"
20
19
  branches:
21
20
  only:
22
21
  - master
data/CHANGELOG.md CHANGED
@@ -0,0 +1,4 @@
1
+ # 1.0.0
2
+
3
+ * Pin minimum Ruby version to 2.4
4
+ * Pin minimum Sidekiq version to 2.7
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ group :development do
9
9
  gem 'yard'
10
10
  gem 'redcarpet', platforms: [:ruby]
11
11
 
12
- gem 'rspec', '~> 2.14.1'
12
+ gem 'rspec'
13
13
  gem 'rspec-redis_helper'
14
14
  gem 'timecop'
15
15
  gem 'simplecov'
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -7,7 +7,7 @@ Sidekiq StatsD is a [Sidekiq server middleware](https://github.com/mperham/sidek
7
7
 
8
8
  ## Compatibility
9
9
 
10
- Sidekiq::Statsd is tested against MRI 1.9.3.
10
+ Sidekiq::Statsd is tested against [several Ruby versions](.travis.yml#L4).
11
11
 
12
12
  ## Installation
13
13
 
@@ -60,4 +60,4 @@ If you have a [statsd instance](https://github.com/github/statsd-ruby) you can p
60
60
 
61
61
  ## License
62
62
 
63
- MIT Licensed. See LICENSE.txt for details.
63
+ MIT Licensed. See [LICENSE](LICENSE) for details.
@@ -1,6 +1,6 @@
1
1
  module Sidekiq
2
2
  module Statsd
3
- VERSION = '0.1.5'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
6
6
 
@@ -18,6 +18,8 @@ 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.6"
21
+ gem.add_dependency "sidekiq", ">= 2.7"
22
22
  gem.add_dependency "statsd-ruby", ">= 1.1.0"
23
+
24
+ gem.required_ruby_version = '>= 2.4.0'
23
25
  end
@@ -14,7 +14,7 @@ describe Sidekiq::Statsd::ServerMiddleware do
14
14
  let(:broken_job) { ->{ raise 'error' } }
15
15
 
16
16
  before do
17
- ::Statsd.stub_chain(:new, :batch).and_yield(client)
17
+ allow_any_instance_of(::Statsd).to receive(:batch).and_yield(client)
18
18
  end
19
19
 
20
20
  it "doesn't initialize a ::Statsd client if passed-in" do
@@ -39,8 +39,9 @@ describe Sidekiq::Statsd::ServerMiddleware do
39
39
  it "uses the custom metric name prefix options" do
40
40
  expect(client)
41
41
  .to receive(:time)
42
- .with("development.application.sidekiq.#{worker_name}.processing_time", &clean_job)
42
+ .with("development.application.sidekiq.#{worker_name}.processing_time")
43
43
  .once
44
+ .and_yield
44
45
 
45
46
  described_class
46
47
  .new(env: 'development', prefix: 'application.sidekiq')
@@ -59,7 +60,7 @@ describe Sidekiq::Statsd::ServerMiddleware do
59
60
  end
60
61
 
61
62
  it "doesn't gauge sidekiq stats" do
62
- Sidekiq::Stats.stub(:new).and_return(sidekiq_stats)
63
+ allow(Sidekiq::Stats).to receive(:new) { sidekiq_stats }
63
64
 
64
65
  expect(sidekiq_stats).not_to receive(:enqueued)
65
66
  expect(sidekiq_stats).not_to receive(:retry_size)
@@ -88,8 +89,9 @@ describe Sidekiq::Statsd::ServerMiddleware do
88
89
  it "times the process execution" do
89
90
  expect(client)
90
91
  .to receive(:time)
91
- .with("production.worker.#{worker_name}.processing_time", &job)
92
+ .with("production.worker.#{worker_name}.processing_time")
92
93
  .once
94
+ .and_yield
93
95
 
94
96
  middleware.call(worker, msg, queue, &job)
95
97
  end
@@ -105,7 +107,8 @@ describe Sidekiq::Statsd::ServerMiddleware do
105
107
  before do
106
108
  allow(client)
107
109
  .to receive(:time)
108
- .with("production.worker.#{worker_name}.processing_time", &job)
110
+ .with("production.worker.#{worker_name}.processing_time")
111
+ .and_yield
109
112
  end
110
113
 
111
114
  it "increments failure counter" do
@@ -114,7 +117,7 @@ describe Sidekiq::Statsd::ServerMiddleware do
114
117
  .with("production.worker.#{worker_name}.failure")
115
118
  .once
116
119
 
117
- expect{ middleware.call(worker, msg, queue, &job) }.to raise_error
120
+ expect{ middleware.call(worker, msg, queue, &job) }.to raise_error('error')
118
121
  end
119
122
  end
120
123
 
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,6 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
3
3
 
4
- WORKERS = File.join(File.dirname(__FILE__), "app", "workers")
5
- $LOAD_PATH.unshift(WORKERS)
6
-
7
4
  unless ENV["CI"]
8
5
  require "simplecov"
9
6
  SimpleCov.start do
@@ -12,17 +9,8 @@ unless ENV["CI"]
12
9
  end
13
10
  end
14
11
 
15
- require "rspec"
16
- require "timecop"
17
-
18
12
  require "sidekiq-statsd"
19
13
 
20
- # Autoload every worker for the test suite that sits in spec/app/workers
21
- Dir[File.join(WORKERS, "*.rb")].sort.each do |file|
22
- name = File.basename(file, ".rb")
23
- autoload name.camelize.to_sym, name
24
- end
25
-
26
14
  RSpec.configure do |config|
27
15
  # Run specs in random order to surface order dependencies. If you find an
28
16
  # order dependency and want to debug it, you can fix the order by providing
@@ -33,4 +21,4 @@ end
33
21
 
34
22
  # Requires supporting files with custom matchers and macros, etc,
35
23
  # in ./support/ and its subdirectories.
36
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
24
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
@@ -3,8 +3,8 @@ shared_examples "a resilient gauge reporter" do
3
3
  let(:queue_stats) { double(size: 3, latency: 4.2) }
4
4
 
5
5
  before do
6
- Sidekiq::Stats.stub(:new).and_return(sidekiq_stats)
7
- Sidekiq::Queue.stub(:new).with('mailer').and_return(queue_stats)
6
+ allow(Sidekiq::Stats).to receive(:new) { sidekiq_stats }
7
+ allow(Sidekiq::Queue).to receive(:new).with('mailer') { queue_stats }
8
8
  end
9
9
 
10
10
  it "gauges enqueued jobs" do
@@ -1,11 +1,4 @@
1
- require "sidekiq/util"
2
- Sidekiq.logger.level = Logger::ERROR
3
-
4
1
  require "rspec-redis_helper"
5
- RSpec::RedisHelper::CONFIG = { :url => "redis://localhost/15", :namespace => "testy" }
6
-
7
- require "sidekiq/redis_connection"
8
- REDIS = Sidekiq::RedisConnection.create(RSpec::RedisHelper::CONFIG)
9
2
 
10
3
  RSpec.configure do |spec|
11
4
  spec.include RSpec::RedisHelper, redis: true
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.5
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Cantero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-07 00:00:00.000000000 Z
11
+ date: 2019-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '2.6'
33
+ version: '2.7'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '2.6'
40
+ version: '2.7'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: statsd-ruby
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -62,12 +62,13 @@ extra_rdoc_files: []
62
62
  files:
63
63
  - ".gitignore"
64
64
  - ".pryrc"
65
+ - ".ruby-version"
65
66
  - ".travis.yml"
66
67
  - ".yardopts"
67
68
  - CHANGELOG.md
68
69
  - Gemfile
69
70
  - Guardfile
70
- - LICENSE.txt
71
+ - LICENSE
71
72
  - README.md
72
73
  - Rakefile
73
74
  - lib/sidekiq-statsd.rb
@@ -75,7 +76,6 @@ files:
75
76
  - lib/sidekiq/statsd/version.rb
76
77
  - sidekiq-statsd.gemspec
77
78
  - spec/sidekiq/statsd/server_middleware_spec.rb
78
- - spec/spec.opts
79
79
  - spec/spec_helper.rb
80
80
  - spec/support/shared_examples_for_a_resilient_gauge_reporter.rb
81
81
  - spec/support/sidekiq.rb
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
90
  requirements:
91
91
  - - ">="
92
92
  - !ruby/object:Gem::Version
93
- version: '0'
93
+ version: 2.4.0
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - ">="
@@ -98,15 +98,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  requirements: []
100
100
  rubyforge_project:
101
- rubygems_version: 2.2.5
101
+ rubygems_version: 2.7.6.2
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: Sidekiq StatsD is a Sidekiq server middleware to send Sidekiq worker metrics
105
105
  through statsd.
106
106
  test_files:
107
107
  - spec/sidekiq/statsd/server_middleware_spec.rb
108
- - spec/spec.opts
109
108
  - spec/spec_helper.rb
110
109
  - spec/support/shared_examples_for_a_resilient_gauge_reporter.rb
111
110
  - spec/support/sidekiq.rb
112
- has_rdoc:
data/spec/spec.opts DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format progress