rails-autoscale-sidekiq 1.1.0 → 1.2.1

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: 13c6bd1e98a94c63ae9721ee5f5fe8a0704e0c319e0e59c7f363cbea26ef6789
4
- data.tar.gz: a78902faee8159c7d80d89ef721de20e719faef1b3479fc215a5701571f0e6e1
3
+ metadata.gz: 6f03a9d4e15d94b3512f570d2831b07158d7513edb1aef1f1f6e9591947481ab
4
+ data.tar.gz: f8b6ac6c8923b46a8e9f4d5a3b511798a21a0633552e9aa041d2eff385802eb1
5
5
  SHA512:
6
- metadata.gz: ce5c1e4dc29c81547db9cdcc8a647af096902448cb597c6c33cb30adf0f5fa66a9900a3296454cecf48702561428df6b4a6977abe49b5aa76ef4d289de7ea4de
7
- data.tar.gz: 0e801667705cb9781f4a5a5f520e81a991a63ac204f50400c988f11fb6f744a0a52f0f45dfe3faeb4de3520349d80002754228889629578206e06b6d91962ee4
6
+ metadata.gz: 0a199e5122ea03ecca8cb06146e6b691ccc0c7b9afa8e5637509e19dd6c440b7715936715558bc34eed865850bf69e981b375eb71e6da75cdb0719bcd629d83c
7
+ data.tar.gz: 50eec05653c48bd455a8ddac3f977983520ace2d1fad85b37af16cd2f1a58ce3c58e2375df2a276e654b8b80859fb45d019762c2f7b32738a486449e5a954b3a
data/Gemfile CHANGED
@@ -1,8 +1,10 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gemspec
3
+ gemspec name: "judoscale-sidekiq"
4
4
 
5
- gem "rails-autoscale-core", path: "../rails-autoscale-core"
5
+ gem "judoscale-ruby", path: "../judoscale-ruby"
6
+ gem "sidekiq", "~> 7.0"
6
7
  gem "minitest"
7
8
  gem "rake"
9
+ gem "rake-release"
8
10
  gem "debug"
data/Gemfile-sidekiq-5 CHANGED
@@ -1,8 +1,9 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gemspec
3
+ gemspec name: "judoscale-sidekiq"
4
4
 
5
- gem "rails-autoscale-core", path: "../rails-autoscale-core"
5
+ gem "judoscale-ruby", path: "../judoscale-ruby"
6
6
  gem "sidekiq", "~> 5.0"
7
7
  gem "minitest"
8
8
  gem "rake"
9
+ gem "rake-release"
data/Gemfile.lock CHANGED
@@ -1,18 +1,19 @@
1
1
  PATH
2
- remote: ../rails-autoscale-core
2
+ remote: ../judoscale-ruby
3
3
  specs:
4
- rails-autoscale-core (1.1.0)
4
+ judoscale-ruby (1.2.1)
5
5
 
6
6
  PATH
7
7
  remote: .
8
8
  specs:
9
- rails-autoscale-sidekiq (1.1.0)
10
- rails-autoscale-core
9
+ judoscale-sidekiq (1.2.1)
10
+ judoscale-ruby
11
11
  sidekiq (>= 5.0)
12
12
 
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
+ concurrent-ruby (1.1.10)
16
17
  connection_pool (2.3.0)
17
18
  debug (1.6.2)
18
19
  irb (>= 1.3.6)
@@ -21,15 +22,19 @@ GEM
21
22
  irb (1.4.1)
22
23
  reline (>= 0.3.0)
23
24
  minitest (5.15.0)
24
- rack (2.2.4)
25
+ rack (3.0.0)
25
26
  rake (13.0.6)
26
- redis (4.8.0)
27
+ rake-release (1.3.0)
28
+ bundler (>= 1.11, < 3)
29
+ redis-client (0.11.1)
30
+ connection_pool
27
31
  reline (0.3.1)
28
32
  io-console (~> 0.5)
29
- sidekiq (6.5.7)
30
- connection_pool (>= 2.2.5)
31
- rack (~> 2.0)
32
- redis (>= 4.5.0, < 5)
33
+ sidekiq (7.0.1)
34
+ concurrent-ruby (< 2)
35
+ connection_pool (>= 2.3.0)
36
+ rack (>= 2.2.4)
37
+ redis-client (>= 0.9.0)
33
38
 
34
39
  PLATFORMS
35
40
  arm64-darwin-20
@@ -39,10 +44,12 @@ PLATFORMS
39
44
 
40
45
  DEPENDENCIES
41
46
  debug
47
+ judoscale-ruby!
48
+ judoscale-sidekiq!
42
49
  minitest
43
- rails-autoscale-core!
44
- rails-autoscale-sidekiq!
45
50
  rake
51
+ rake-release
52
+ sidekiq (~> 7.0)
46
53
 
47
54
  BUNDLED WITH
48
55
  2.3.9
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/gem_tasks"
3
+ require "rake/release"
4
4
  require "rake/testtask"
5
5
 
6
6
  Rake::TestTask.new(:test) do |t|
@@ -0,0 +1,30 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "judoscale/sidekiq/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "judoscale-sidekiq"
7
+ spec.version = Judoscale::Sidekiq::VERSION
8
+ spec.authors = ["Adam McCrea", "Carlos Antonio da Silva"]
9
+ spec.email = ["adam@adamlogic.com"]
10
+
11
+ spec.summary = "This gem provides Sidekiq integration with the Judoscale autoscaling add-on for Heroku."
12
+ spec.homepage = "https://judoscale.com"
13
+ spec.license = "MIT"
14
+
15
+ spec.metadata = {
16
+ "homepage_uri" => "https://judoscale.com",
17
+ "bug_tracker_uri" => "https://github.com/judoscale/judoscale-ruby/issues",
18
+ "documentation_uri" => "https://judoscale.com/docs",
19
+ "changelog_uri" => "https://github.com/judoscale/judoscale-ruby/blob/main/CHANGELOG.md",
20
+ "source_code_uri" => "https://github.com/judoscale/judoscale-ruby"
21
+ }
22
+
23
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ spec.require_paths = ["lib"]
25
+
26
+ spec.required_ruby_version = ">= 2.6.0"
27
+
28
+ spec.add_dependency "judoscale-ruby"
29
+ spec.add_dependency "sidekiq", ">= 5.0"
30
+ end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rails_autoscale/job_metrics_collector"
4
- require "rails_autoscale/metric"
3
+ require "judoscale/job_metrics_collector"
4
+ require "judoscale/metric"
5
5
 
6
- module RailsAutoscale
6
+ module Judoscale
7
7
  module Sidekiq
8
- class MetricsCollector < RailsAutoscale::JobMetricsCollector
8
+ class MetricsCollector < Judoscale::JobMetricsCollector
9
9
  def self.adapter_config
10
- RailsAutoscale::Config.instance.sidekiq
10
+ Judoscale::Config.instance.sidekiq
11
11
  end
12
12
 
13
13
  def collect
@@ -21,7 +21,10 @@ module RailsAutoscale
21
21
  if track_busy_jobs?
22
22
  busy_counts = Hash.new { |h, k| h[k] = 0 }
23
23
  ::Sidekiq::Workers.new.each do |pid, tid, work|
24
- busy_counts[work.dig("payload", "queue")] += 1
24
+ payload = work["payload"]
25
+ # payload is unparsed in Sidekiq 7
26
+ payload = JSON.parse(payload) if payload.is_a?(String)
27
+ busy_counts[payload["queue"]] += 1
25
28
  end
26
29
  end
27
30
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module RailsAutoscale
3
+ module Judoscale
4
4
  module Sidekiq
5
- VERSION = "1.1.0"
5
+ VERSION = "1.2.1"
6
6
  end
7
7
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "judoscale-ruby"
4
+ require "judoscale/config"
5
+ require "judoscale/sidekiq/version"
6
+ require "judoscale/sidekiq/metrics_collector"
7
+ require "sidekiq/api"
8
+
9
+ Judoscale.add_adapter :"judoscale-sidekiq",
10
+ {
11
+ adapter_version: Judoscale::Sidekiq::VERSION,
12
+ framework_version: ::Sidekiq::VERSION
13
+ },
14
+ metrics_collector: Judoscale::Sidekiq::MetricsCollector,
15
+ expose_config: Judoscale::Config::JobAdapterConfig.new(:sidekiq)
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "judoscale/sidekiq"
@@ -1,23 +1,23 @@
1
1
  lib = File.expand_path("../lib", __FILE__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "rails_autoscale/sidekiq/version"
3
+ require "judoscale/sidekiq/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "rails-autoscale-sidekiq"
7
- spec.version = RailsAutoscale::Sidekiq::VERSION
7
+ spec.version = Judoscale::Sidekiq::VERSION
8
8
  spec.authors = ["Adam McCrea", "Carlos Antonio da Silva"]
9
9
  spec.email = ["adam@adamlogic.com"]
10
10
 
11
- spec.summary = "This gem provides Sidekiq integration with the Rails Autoscale autoscaling add-on for Heroku."
12
- spec.homepage = "https://railsautoscale.com"
11
+ spec.summary = "This gem provides Sidekiq integration with the Judoscale autoscaling add-on for Heroku."
12
+ spec.homepage = "https://judoscale.com"
13
13
  spec.license = "MIT"
14
14
 
15
15
  spec.metadata = {
16
- "homepage_uri" => "https://railsautoscale.com",
17
- "bug_tracker_uri" => "https://github.com/rails-autoscale/rails-autoscale-gems/issues",
18
- "documentation_uri" => "https://railsautoscale.com/docs",
19
- "changelog_uri" => "https://github.com/rails-autoscale/rails-autoscale-gems/blob/main/CHANGELOG.md",
20
- "source_code_uri" => "https://github.com/rails-autoscale/rails-autoscale-gems"
16
+ "homepage_uri" => "https://judoscale.com",
17
+ "bug_tracker_uri" => "https://github.com/judoscale/judoscale-ruby/issues",
18
+ "documentation_uri" => "https://judoscale.com/docs",
19
+ "changelog_uri" => "https://github.com/judoscale/judoscale-ruby/blob/main/CHANGELOG.md",
20
+ "source_code_uri" => "https://github.com/judoscale/judoscale-ruby"
21
21
  }
22
22
 
23
23
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -25,6 +25,6 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.required_ruby_version = ">= 2.6.0"
27
27
 
28
- spec.add_dependency "rails-autoscale-core"
28
+ spec.add_dependency "judoscale-ruby"
29
29
  spec.add_dependency "sidekiq", ">= 5.0"
30
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-autoscale-sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam McCrea
@@ -9,10 +9,10 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-10-10 00:00:00.000000000 Z
12
+ date: 2022-11-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rails-autoscale-core
15
+ name: judoscale-ruby
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - ">="
@@ -50,20 +50,21 @@ files:
50
50
  - Gemfile-sidekiq-5
51
51
  - Gemfile.lock
52
52
  - Rakefile
53
- - lib/rails-autoscale-sidekiq.rb
54
- - lib/rails_autoscale/sidekiq.rb
55
- - lib/rails_autoscale/sidekiq/metrics_collector.rb
56
- - lib/rails_autoscale/sidekiq/version.rb
53
+ - judoscale-sidekiq.gemspec
54
+ - lib/judoscale-sidekiq.rb
55
+ - lib/judoscale/sidekiq.rb
56
+ - lib/judoscale/sidekiq/metrics_collector.rb
57
+ - lib/judoscale/sidekiq/version.rb
57
58
  - rails-autoscale-sidekiq.gemspec
58
- homepage: https://railsautoscale.com
59
+ homepage: https://judoscale.com
59
60
  licenses:
60
61
  - MIT
61
62
  metadata:
62
- homepage_uri: https://railsautoscale.com
63
- bug_tracker_uri: https://github.com/rails-autoscale/rails-autoscale-gems/issues
64
- documentation_uri: https://railsautoscale.com/docs
65
- changelog_uri: https://github.com/rails-autoscale/rails-autoscale-gems/blob/main/CHANGELOG.md
66
- source_code_uri: https://github.com/rails-autoscale/rails-autoscale-gems
63
+ homepage_uri: https://judoscale.com
64
+ bug_tracker_uri: https://github.com/judoscale/judoscale-ruby/issues
65
+ documentation_uri: https://judoscale.com/docs
66
+ changelog_uri: https://github.com/judoscale/judoscale-ruby/blob/main/CHANGELOG.md
67
+ source_code_uri: https://github.com/judoscale/judoscale-ruby
67
68
  post_install_message:
68
69
  rdoc_options: []
69
70
  require_paths:
@@ -82,6 +83,6 @@ requirements: []
82
83
  rubygems_version: 3.2.32
83
84
  signing_key:
84
85
  specification_version: 4
85
- summary: This gem provides Sidekiq integration with the Rails Autoscale autoscaling
86
- add-on for Heroku.
86
+ summary: This gem provides Sidekiq integration with the Judoscale autoscaling add-on
87
+ for Heroku.
87
88
  test_files: []
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rails_autoscale/sidekiq"
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rails-autoscale-core"
4
- require "rails_autoscale/config"
5
- require "rails_autoscale/sidekiq/version"
6
- require "rails_autoscale/sidekiq/metrics_collector"
7
- require "sidekiq/api"
8
-
9
- RailsAutoscale.add_adapter :"rails-autoscale-sidekiq",
10
- {
11
- adapter_version: RailsAutoscale::Sidekiq::VERSION,
12
- framework_version: ::Sidekiq::VERSION
13
- },
14
- metrics_collector: RailsAutoscale::Sidekiq::MetricsCollector,
15
- expose_config: RailsAutoscale::Config::JobAdapterConfig.new(:sidekiq)