rails-autoscale-sidekiq 1.7.0 → 1.7.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: af8496830022ab28558082f22f4ded87f0c3a331356102856b1e6eaa926a5cdb
4
- data.tar.gz: 0ecbf714c22d88c36992bf00f1fa2889be8e1f2bb92f108650309a5972a74e4a
3
+ metadata.gz: 1c7623182d70bf6f9a7ab75c04be529acb2567371ba58908e6b0c7b267ce114f
4
+ data.tar.gz: b85361ad556ed86ebdf99c85a98d9df55824df4242df35fb9f71c74772640a62
5
5
  SHA512:
6
- metadata.gz: 2d9ead31c6ceaf118e7dcfa0730db83ca0694b9dc5b89adc92e848dd7cf121524318158e30304a621ed1430a4c991f7f901916710425f92f43bd714d4a200565
7
- data.tar.gz: 5d8e41de837b65aaa2c1930a6ce919a979e1fc59390dfe1dd76f88d72d684a2ffb7ce2c7903baba9d79f88291cf0f1af00a5617ebd4d0268d1954ff4d4b0d8a1
6
+ metadata.gz: 1c9db564237b7a474fd46394ede32ae5caa72b97280e096cb7ffb9aa262c1519d2dbc4ac55b81eafa98d7af34b831fda8b74f6b07a08a4185d53cffa1492d7cf
7
+ data.tar.gz: 38ffa65c7c566c43ae34b9d218bcadb429b4858116d9ab731f13d535b7f24a1cd699c4ac62b91abdde1c7bc9077d0af5bd995e87514cdadd3f66277479afeff2
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "judoscale/sidekiq"
3
+ require "judoscale-sidekiq"
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.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam McCrea
@@ -10,36 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-05-03 00:00:00.000000000 Z
13
+ date: 2024-07-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: rails-autoscale-core
16
+ name: judoscale-sidekiq
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.7.0
21
+ version: 1.7.1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.7.0
29
- - !ruby/object:Gem::Dependency
30
- name: sidekiq
31
- requirement: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: '5.0'
36
- type: :runtime
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: '5.0'
28
+ version: 1.7.1
43
29
  description:
44
30
  email:
45
31
  - hello@judoscale.com
@@ -47,17 +33,7 @@ executables: []
47
33
  extensions: []
48
34
  extra_rdoc_files: []
49
35
  files:
50
- - Gemfile
51
- - Gemfile-sidekiq-5
52
- - Gemfile-sidekiq-6
53
- - Rakefile
54
- - judoscale-sidekiq.gemspec
55
- - lib/judoscale-sidekiq.rb
56
- - lib/judoscale/sidekiq.rb
57
- - lib/judoscale/sidekiq/metrics_collector.rb
58
- - lib/judoscale/sidekiq/version.rb
59
36
  - lib/rails-autoscale-sidekiq.rb
60
- - rails-autoscale-sidekiq.gemspec
61
37
  homepage: https://judoscale.com
62
38
  licenses:
63
39
  - MIT
@@ -75,14 +51,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
51
  requirements:
76
52
  - - ">="
77
53
  - !ruby/object:Gem::Version
78
- version: 2.6.0
54
+ version: '0'
79
55
  required_rubygems_version: !ruby/object:Gem::Requirement
80
56
  requirements:
81
57
  - - ">="
82
58
  - !ruby/object:Gem::Version
83
59
  version: '0'
84
60
  requirements: []
85
- rubygems_version: 3.4.10
61
+ rubygems_version: 3.5.11
86
62
  signing_key:
87
63
  specification_version: 4
88
64
  summary: Autoscaling for Sidekiq workers.
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec name: "judoscale-sidekiq"
4
-
5
- gem "judoscale-ruby", path: "../judoscale-ruby"
6
- gem "sidekiq", "~> 7.0"
7
- gem "minitest"
8
- gem "rake"
9
- gem "debug"
data/Gemfile-sidekiq-5 DELETED
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec name: "judoscale-sidekiq"
4
-
5
- gem "judoscale-ruby", path: "../judoscale-ruby"
6
- gem "sidekiq", "~> 5.0"
7
- gem "minitest"
8
- gem "rake"
data/Gemfile-sidekiq-6 DELETED
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec name: "judoscale-sidekiq"
4
-
5
- gem "judoscale-ruby", path: "../judoscale-ruby"
6
- gem "sidekiq", "~> 6.0"
7
- gem "minitest"
8
- gem "rake"
data/Rakefile DELETED
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rake/testtask"
4
-
5
- Rake::TestTask.new(:test) do |t|
6
- t.libs = %w[lib test]
7
- t.pattern = "test/**/*_test.rb"
8
- end
9
-
10
- Rake::TestTask.new(:bench) do |t|
11
- t.libs = %w[lib test]
12
- t.pattern = "test/benchmarks/**/*_benchmark.rb"
13
- end
14
-
15
- task default: :test
@@ -1,30 +0,0 @@
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", "Jon Sullivan"]
9
- spec.email = ["hello@judoscale.com"]
10
-
11
- spec.summary = "Autoscaling for Sidekiq workers."
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", Judoscale::Sidekiq::VERSION
29
- spec.add_dependency "sidekiq", ">= 5.0"
30
- end
@@ -1,52 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "judoscale/job_metrics_collector"
4
- require "judoscale/metric"
5
-
6
- module Judoscale
7
- module Sidekiq
8
- class MetricsCollector < Judoscale::JobMetricsCollector
9
- def self.adapter_config
10
- Judoscale::Config.instance.sidekiq
11
- end
12
-
13
- def collect
14
- metrics = []
15
- queues_by_name = ::Sidekiq::Queue.all.each_with_object({}) do |queue, obj|
16
- obj[queue.name] = queue
17
- end
18
-
19
- self.queues |= queues_by_name.keys
20
-
21
- if track_busy_jobs?
22
- busy_counts = Hash.new { |h, k| h[k] = 0 }
23
- ::Sidekiq::Workers.new.each do |pid, tid, work|
24
- # Sidekiq 7.2 added a new Sidekiq::Work type; hash access is deprecated
25
- payload = work.payload if work.respond_to?(:payload)
26
- payload ||= work["payload"]
27
- # payload is unparsed in Sidekiq 7
28
- payload = JSON.parse(payload) if payload.is_a?(String)
29
- busy_counts[payload["queue"]] += 1
30
- end
31
- end
32
-
33
- queues.each do |queue_name|
34
- queue = queues_by_name.fetch(queue_name) { |name| ::Sidekiq::Queue.new(name) }
35
- latency_ms = (queue.latency * 1000).ceil
36
- depth = queue.size
37
-
38
- metrics.push Metric.new(:qt, latency_ms, Time.now, queue_name)
39
- metrics.push Metric.new(:qd, depth, Time.now, queue_name)
40
-
41
- if track_busy_jobs?
42
- busy_count = busy_counts[queue_name]
43
- metrics.push Metric.new(:busy, busy_count, Time.now, queue_name)
44
- end
45
- end
46
-
47
- log_collection(metrics)
48
- metrics
49
- end
50
- end
51
- end
52
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Judoscale
4
- module Sidekiq
5
- VERSION = "1.7.0"
6
- end
7
- end
@@ -1,15 +0,0 @@
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)
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "judoscale/sidekiq"
@@ -1,30 +0,0 @@
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 = "rails-autoscale-sidekiq"
7
- spec.version = Judoscale::Sidekiq::VERSION
8
- spec.authors = ["Adam McCrea", "Carlos Antonio da Silva", "Jon Sullivan"]
9
- spec.email = ["hello@judoscale.com"]
10
-
11
- spec.summary = "Autoscaling for Sidekiq workers."
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 "rails-autoscale-core", Judoscale::Sidekiq::VERSION
29
- spec.add_dependency "sidekiq", ">= 5.0"
30
- end