judoscale-ruby 1.8.2 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/judoscale/config.rb +35 -15
- data/lib/judoscale/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 89e1c234767f82a457f3e3d9ddc185fb7229e0f4e8de84fd9861c51c07e27b9c
|
|
4
|
+
data.tar.gz: 3f899a16cb1454e3720468702db0401c17f684a5b8d7263b3830e97038cfea37
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8183357c4717a609224e3bf8a15ef567d19e71d1b5de1027faa25e0480af7870eb44290a02929352a29d1c5b8581345218cc1bdd264ccf5cdf91eae0e5fa5ede
|
|
7
|
+
data.tar.gz: 71b1c714b3c1979394d39237873c28f40c2881151c53fac0f23a42d225686d3f76f31a10bbf792d6f31aac0e40a6d2e32eb064bb156cbbb9aeee9fa92a29dfc5
|
data/lib/judoscale/config.rb
CHANGED
|
@@ -93,24 +93,28 @@ module Judoscale
|
|
|
93
93
|
|
|
94
94
|
self.class.adapter_configs.each(&:reset)
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
96
|
+
@current_runtime_container =
|
|
97
|
+
if ENV.include?("DYNO")
|
|
98
|
+
RuntimeContainer.new ENV["DYNO"]
|
|
99
|
+
elsif ENV.include?("RENDER_INSTANCE_ID")
|
|
100
|
+
# Deprecated API url using the service ID for legacy render services not using `JUDOSCALE_URL`.
|
|
101
|
+
@api_base_url ||= "https://adapter.judoscale.com/api/#{ENV["RENDER_SERVICE_ID"]}"
|
|
102
|
+
|
|
103
|
+
instance = ENV["RENDER_INSTANCE_ID"].delete_prefix("#{ENV["RENDER_SERVICE_ID"]}-")
|
|
104
|
+
RuntimeContainer.new instance
|
|
105
|
+
elsif ENV.include?("ECS_CONTAINER_METADATA_URI")
|
|
106
|
+
instance = ENV["ECS_CONTAINER_METADATA_URI"].split("/").last
|
|
107
|
+
RuntimeContainer.new instance
|
|
108
|
+
elsif ENV.include?("RAILWAY_REPLICA_ID")
|
|
109
|
+
RuntimeContainer.new ENV["RAILWAY_REPLICA_ID"]
|
|
110
|
+
else
|
|
111
|
+
# Unsupported platform...
|
|
112
|
+
RuntimeContainer.new("")
|
|
113
|
+
end
|
|
110
114
|
end
|
|
111
115
|
|
|
112
116
|
def log_level=(new_level)
|
|
113
|
-
@log_level =
|
|
117
|
+
@log_level = get_severity_log_level(new_level)
|
|
114
118
|
end
|
|
115
119
|
|
|
116
120
|
def as_json
|
|
@@ -127,5 +131,21 @@ module Judoscale
|
|
|
127
131
|
def ignore_large_requests?
|
|
128
132
|
@max_request_size_bytes
|
|
129
133
|
end
|
|
134
|
+
|
|
135
|
+
private
|
|
136
|
+
|
|
137
|
+
def get_severity_log_level(log_level)
|
|
138
|
+
return nil if log_level.to_s.strip.empty?
|
|
139
|
+
|
|
140
|
+
upcased_log_level = log_level.to_s.upcase
|
|
141
|
+
|
|
142
|
+
if ::Logger::Severity.const_defined?(upcased_log_level)
|
|
143
|
+
::Logger::Severity.const_get(upcased_log_level)
|
|
144
|
+
else
|
|
145
|
+
logger.warn "Invalid log_level detected: #{log_level}"
|
|
146
|
+
|
|
147
|
+
nil
|
|
148
|
+
end
|
|
149
|
+
end
|
|
130
150
|
end
|
|
131
151
|
end
|
data/lib/judoscale/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: judoscale-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam McCrea
|
|
8
8
|
- Carlos Antonio da Silva
|
|
9
9
|
- Jon Sullivan
|
|
10
|
-
autorequire:
|
|
10
|
+
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2025-01-17 00:00:00.000000000 Z
|
|
14
14
|
dependencies: []
|
|
15
|
-
description:
|
|
15
|
+
description:
|
|
16
16
|
email:
|
|
17
17
|
- hello@judoscale.com
|
|
18
18
|
executables: []
|
|
@@ -43,7 +43,7 @@ metadata:
|
|
|
43
43
|
documentation_uri: https://judoscale.com/docs
|
|
44
44
|
changelog_uri: https://github.com/judoscale/judoscale-ruby/blob/main/CHANGELOG.md
|
|
45
45
|
source_code_uri: https://github.com/judoscale/judoscale-ruby
|
|
46
|
-
post_install_message:
|
|
46
|
+
post_install_message:
|
|
47
47
|
rdoc_options: []
|
|
48
48
|
require_paths:
|
|
49
49
|
- lib
|
|
@@ -58,8 +58,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
59
|
version: '0'
|
|
60
60
|
requirements: []
|
|
61
|
-
rubygems_version: 3.5.
|
|
62
|
-
signing_key:
|
|
61
|
+
rubygems_version: 3.5.22
|
|
62
|
+
signing_key:
|
|
63
63
|
specification_version: 4
|
|
64
64
|
summary: Autoscaling for Ruby.
|
|
65
65
|
test_files: []
|