rails-autoscale-core 1.5.4 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/judoscale-ruby.gemspec +1 -1
- data/lib/judoscale/config.rb +13 -3
- data/lib/judoscale/reporter.rb +0 -9
- data/lib/judoscale/version.rb +1 -1
- data/lib/judoscale-ruby.rb +1 -1
- data/rails-autoscale-core.gemspec +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40bcfbeb0f24259c8b3fe73b8bc616c7d90ddf6b686b8305e595ef8f4509b43d
|
4
|
+
data.tar.gz: 4d786678ce524cbdcc877dc69cd55447ac8c8abe4494c08e07055bb030c0f178
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7743fca319ec47effa3e5c6ed5e9efbd357421df3453345130baeb3f7e46b8adc04867b52c0000cbda760961e6dd94775ee6b01e5156f14c78d758ae06cd089
|
7
|
+
data.tar.gz: 6d2257ae9a63b80fe810c4d0e4dc0f6a2b815471a5b32ff450adb765bb87bc669438de1761e61fb521bf81464ca0b07db3666c3b2b52ac1b7fad1bd9b8d7db75
|
data/judoscale-ruby.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Adam McCrea", "Carlos Antonio da Silva", "Jon Sullivan"]
|
9
9
|
spec.email = ["hello@judoscale.com"]
|
10
10
|
|
11
|
-
spec.summary = "
|
11
|
+
spec.summary = "Autoscaling for Ruby."
|
12
12
|
spec.homepage = "https://judoscale.com"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
data/lib/judoscale/config.rb
CHANGED
@@ -20,10 +20,12 @@ module Judoscale
|
|
20
20
|
UUID_REGEXP = /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/
|
21
21
|
DEFAULT_QUEUE_FILTER = ->(queue_name) { !UUID_REGEXP.match?(queue_name) }
|
22
22
|
|
23
|
-
attr_accessor :identifier, :enabled, :max_queues, :queues, :queue_filter
|
23
|
+
attr_accessor :identifier, :enabled, :max_queues, :queues, :queue_filter
|
24
|
+
attr_reader :track_busy_jobs
|
24
25
|
|
25
|
-
def initialize(identifier)
|
26
|
+
def initialize(identifier, support_busy_jobs: true)
|
26
27
|
@identifier = identifier
|
28
|
+
@support_busy_jobs = support_busy_jobs
|
27
29
|
reset
|
28
30
|
end
|
29
31
|
|
@@ -34,7 +36,15 @@ module Judoscale
|
|
34
36
|
|
35
37
|
# Support for deprecated legacy env var configs.
|
36
38
|
@max_queues = (ENV["RAILS_AUTOSCALE_MAX_QUEUES"] || 20).to_i
|
37
|
-
|
39
|
+
self.track_busy_jobs = ENV["RAILS_AUTOSCALE_LONG_JOBS"] == "true"
|
40
|
+
end
|
41
|
+
|
42
|
+
def track_busy_jobs=(value)
|
43
|
+
if value && !@support_busy_jobs
|
44
|
+
raise "[#{Config.instance.log_tag}] #{identifier} does not support busy jobs"
|
45
|
+
end
|
46
|
+
|
47
|
+
@track_busy_jobs = value
|
38
48
|
end
|
39
49
|
|
40
50
|
def as_json
|
data/lib/judoscale/reporter.rb
CHANGED
@@ -72,26 +72,17 @@ module Judoscale
|
|
72
72
|
@_thread&.terminate
|
73
73
|
@_thread = nil
|
74
74
|
@pid = nil
|
75
|
-
@reported = false
|
76
75
|
end
|
77
76
|
|
78
77
|
private
|
79
78
|
|
80
79
|
def report(config, metrics)
|
81
|
-
# Make sure we report at least once, even if there are no metrics,
|
82
|
-
# so Judoscale knows the adapter is installed and running.
|
83
|
-
if @reported && metrics.empty?
|
84
|
-
logger.debug "No metrics to report - skipping"
|
85
|
-
return
|
86
|
-
end
|
87
|
-
|
88
80
|
report = Report.new(Judoscale.adapters, config, metrics)
|
89
81
|
logger.info "Reporting #{report.metrics.size} metrics"
|
90
82
|
result = AdapterApi.new(config).report_metrics(report.as_json)
|
91
83
|
|
92
84
|
case result
|
93
85
|
when AdapterApi::SuccessResponse
|
94
|
-
@reported = true
|
95
86
|
logger.debug "Reported successfully"
|
96
87
|
when AdapterApi::FailureResponse
|
97
88
|
logger.error "Reporter failed: #{result.failure_message}"
|
data/lib/judoscale/version.rb
CHANGED
data/lib/judoscale-ruby.rb
CHANGED
@@ -4,7 +4,7 @@ require "judoscale/config"
|
|
4
4
|
require "judoscale/version"
|
5
5
|
|
6
6
|
module Judoscale
|
7
|
-
# Allows configuring
|
7
|
+
# Allows configuring Judoscale through a block, usually defined during application initialization.
|
8
8
|
#
|
9
9
|
# Example:
|
10
10
|
#
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Adam McCrea", "Carlos Antonio da Silva", "Jon Sullivan"]
|
9
9
|
spec.email = ["hello@judoscale.com"]
|
10
10
|
|
11
|
-
spec.summary = "
|
11
|
+
spec.summary = "Autoscaling for Ruby."
|
12
12
|
spec.homepage = "https://judoscale.com"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-autoscale-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam McCrea
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-
|
13
|
+
date: 2024-05-03 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description:
|
16
16
|
email:
|
@@ -66,6 +66,5 @@ requirements: []
|
|
66
66
|
rubygems_version: 3.4.10
|
67
67
|
signing_key:
|
68
68
|
specification_version: 4
|
69
|
-
summary:
|
70
|
-
web and worker dynos.
|
69
|
+
summary: Autoscaling for Ruby.
|
71
70
|
test_files: []
|