rails-autoscale-solid_queue 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-solid_queue.rb +1 -1
- metadata +7 -29
- data/Gemfile +0 -9
- data/Rakefile +0 -11
- data/judoscale-solid_queue.gemspec +0 -30
- data/lib/judoscale/solid_queue/metrics_collector.rb +0 -63
- data/lib/judoscale/solid_queue/version.rb +0 -7
- data/lib/judoscale/solid_queue.rb +0 -15
- data/lib/judoscale-solid_queue.rb +0 -3
- data/rails-autoscale-solid_queue.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: a9ac87bdf87c775f730c15fd862fa6389bd6ef5a4d1a5b20bb729c2bb3e1f983
|
4
|
+
data.tar.gz: 7230371458edd999fa8293cceee84a86703692507be2203d22cc566061b94a9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a095b44bfa3050e8abb36e2ef9455ff517f84f6bd695c0e0f4c1069485970f3672a8e353f70c11c05573c3a30c697ce7f22dcac40813494b54d83862f818ef03
|
7
|
+
data.tar.gz: df95c2e57e7ac16e0aaa1655c30a7071798a427aacb8bf82e3515960f66856cac68db60eb638335d4f1421cd646a79df775eb5c3c02b7b4c33faaa4174d02fb8
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-autoscale-solid_queue
|
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-solid_queue
|
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: solid_queue
|
31
|
-
requirement: !ruby/object:Gem::Requirement
|
32
|
-
requirements:
|
33
|
-
- - ">="
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: '0.3'
|
36
|
-
type: :runtime
|
37
|
-
prerelease: false
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
39
|
-
requirements:
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '0.3'
|
28
|
+
version: 1.7.1
|
43
29
|
description:
|
44
30
|
email:
|
45
31
|
- hello@judoscale.com
|
@@ -47,15 +33,7 @@ executables: []
|
|
47
33
|
extensions: []
|
48
34
|
extra_rdoc_files: []
|
49
35
|
files:
|
50
|
-
- Gemfile
|
51
|
-
- Rakefile
|
52
|
-
- judoscale-solid_queue.gemspec
|
53
|
-
- lib/judoscale-solid_queue.rb
|
54
|
-
- lib/judoscale/solid_queue.rb
|
55
|
-
- lib/judoscale/solid_queue/metrics_collector.rb
|
56
|
-
- lib/judoscale/solid_queue/version.rb
|
57
36
|
- lib/rails-autoscale-solid_queue.rb
|
58
|
-
- rails-autoscale-solid_queue.gemspec
|
59
37
|
homepage: https://judoscale.com
|
60
38
|
licenses:
|
61
39
|
- MIT
|
@@ -73,14 +51,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
51
|
requirements:
|
74
52
|
- - ">="
|
75
53
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
54
|
+
version: '0'
|
77
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
56
|
requirements:
|
79
57
|
- - ">="
|
80
58
|
- !ruby/object:Gem::Version
|
81
59
|
version: '0'
|
82
60
|
requirements: []
|
83
|
-
rubygems_version: 3.
|
61
|
+
rubygems_version: 3.5.11
|
84
62
|
signing_key:
|
85
63
|
specification_version: 4
|
86
64
|
summary: Autoscaling for Solid Queue workers.
|
data/Gemfile
DELETED
data/Rakefile
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/solid_queue/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "judoscale-solid_queue"
|
7
|
-
spec.version = Judoscale::SolidQueue::VERSION
|
8
|
-
spec.authors = ["Adam McCrea", "Carlos Antonio da Silva", "Jon Sullivan"]
|
9
|
-
spec.email = ["hello@judoscale.com"]
|
10
|
-
|
11
|
-
spec.summary = "Autoscaling for Solid Queue 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.7.0"
|
27
|
-
|
28
|
-
spec.add_dependency "judoscale-ruby", Judoscale::SolidQueue::VERSION
|
29
|
-
spec.add_dependency "solid_queue", ">= 0.3"
|
30
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "judoscale/job_metrics_collector"
|
4
|
-
require "judoscale/job_metrics_collector/active_record_helper"
|
5
|
-
require "judoscale/metric"
|
6
|
-
|
7
|
-
module Judoscale
|
8
|
-
module SolidQueue
|
9
|
-
class MetricsCollector < Judoscale::JobMetricsCollector
|
10
|
-
include ActiveRecordHelper
|
11
|
-
|
12
|
-
def self.adapter_config
|
13
|
-
Judoscale::Config.instance.solid_queue
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.collect?(config)
|
17
|
-
super && ActiveRecordHelper.table_exists_for_model?(::SolidQueue::Job)
|
18
|
-
end
|
19
|
-
|
20
|
-
def initialize
|
21
|
-
super
|
22
|
-
|
23
|
-
queue_names = run_silently do
|
24
|
-
::SolidQueue::Job.distinct.pluck(:queue_name)
|
25
|
-
end
|
26
|
-
self.queues |= queue_names
|
27
|
-
end
|
28
|
-
|
29
|
-
def collect
|
30
|
-
metrics = []
|
31
|
-
time = Time.now.utc
|
32
|
-
|
33
|
-
oldest_execution_time_by_queue = run_silently do
|
34
|
-
::SolidQueue::ReadyExecution.group(:queue_name).minimum(:created_at)
|
35
|
-
end
|
36
|
-
self.queues |= oldest_execution_time_by_queue.keys
|
37
|
-
|
38
|
-
if track_busy_jobs?
|
39
|
-
busy_count_by_queue = run_silently do
|
40
|
-
::SolidQueue::Job.joins(:claimed_execution).group(:queue_name).count
|
41
|
-
end
|
42
|
-
self.queues |= busy_count_by_queue.keys
|
43
|
-
end
|
44
|
-
|
45
|
-
queues.each do |queue|
|
46
|
-
run_at = oldest_execution_time_by_queue[queue]
|
47
|
-
latency_ms = run_at ? ((time - run_at) * 1000).ceil : 0
|
48
|
-
latency_ms = 0 if latency_ms < 0
|
49
|
-
|
50
|
-
metrics.push Metric.new(:qt, latency_ms, time, queue)
|
51
|
-
|
52
|
-
if track_busy_jobs?
|
53
|
-
busy_count = busy_count_by_queue[queue] || 0
|
54
|
-
metrics.push Metric.new(:busy, busy_count, Time.now, queue)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
log_collection(metrics)
|
59
|
-
metrics
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "solid_queue"
|
4
|
-
require "judoscale-ruby"
|
5
|
-
require "judoscale/config"
|
6
|
-
require "judoscale/solid_queue/version"
|
7
|
-
require "judoscale/solid_queue/metrics_collector"
|
8
|
-
|
9
|
-
Judoscale.add_adapter :"judoscale-solid_queue",
|
10
|
-
{
|
11
|
-
adapter_version: Judoscale::SolidQueue::VERSION,
|
12
|
-
framework_version: ::SolidQueue::VERSION
|
13
|
-
},
|
14
|
-
metrics_collector: Judoscale::SolidQueue::MetricsCollector,
|
15
|
-
expose_config: Judoscale::Config::JobAdapterConfig.new(:solid_queue)
|
@@ -1,30 +0,0 @@
|
|
1
|
-
lib = File.expand_path("../lib", __FILE__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require "judoscale/solid_queue/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "rails-autoscale-solid_queue"
|
7
|
-
spec.version = Judoscale::SolidQueue::VERSION
|
8
|
-
spec.authors = ["Adam McCrea", "Carlos Antonio da Silva", "Jon Sullivan"]
|
9
|
-
spec.email = ["hello@judoscale.com"]
|
10
|
-
|
11
|
-
spec.summary = "Autoscaling for Solid Queue 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.7.0"
|
27
|
-
|
28
|
-
spec.add_dependency "rails-autoscale-core", Judoscale::SolidQueue::VERSION
|
29
|
-
spec.add_dependency "solid_queue", ">= 0.3"
|
30
|
-
end
|