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 +4 -4
- data/lib/rails-autoscale-sidekiq.rb +1 -1
- metadata +7 -31
- data/Gemfile +0 -9
- data/Gemfile-sidekiq-5 +0 -8
- data/Gemfile-sidekiq-6 +0 -8
- data/Rakefile +0 -15
- data/judoscale-sidekiq.gemspec +0 -30
- data/lib/judoscale/sidekiq/metrics_collector.rb +0 -52
- data/lib/judoscale/sidekiq/version.rb +0 -7
- data/lib/judoscale/sidekiq.rb +0 -15
- data/lib/judoscale-sidekiq.rb +0 -3
- data/rails-autoscale-sidekiq.gemspec +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c7623182d70bf6f9a7ab75c04be529acb2567371ba58908e6b0c7b267ce114f
|
4
|
+
data.tar.gz: b85361ad556ed86ebdf99c85a98d9df55824df4242df35fb9f71c74772640a62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c9db564237b7a474fd46394ede32ae5caa72b97280e096cb7ffb9aa262c1519d2dbc4ac55b81eafa98d7af34b831fda8b74f6b07a08a4185d53cffa1492d7cf
|
7
|
+
data.tar.gz: 38ffa65c7c566c43ae34b9d218bcadb429b4858116d9ab731f13d535b7f24a1cd699c4ac62b91abdde1c7bc9077d0af5bd995e87514cdadd3f66277479afeff2
|
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.
|
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-
|
13
|
+
date: 2024-07-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
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.
|
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.
|
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:
|
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.
|
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
data/Gemfile-sidekiq-5
DELETED
data/Gemfile-sidekiq-6
DELETED
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
|
data/judoscale-sidekiq.gemspec
DELETED
@@ -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
|
data/lib/judoscale/sidekiq.rb
DELETED
@@ -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)
|
data/lib/judoscale-sidekiq.rb
DELETED
@@ -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
|