judoscale-ruby 1.13.4 → 1.14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9bf6350ab170b86f70461084c4e22bc462826e58c83811ba00068050f6677d8
4
- data.tar.gz: 0ddbfb24c27cce98a0ce7cc4e24af1a0df7733e92a06010023643dad2b25bed9
3
+ metadata.gz: c1fe24cbbe8ed0273365f0196db6ca21b6cb8c60ef47fea48529aca2d82c0e7b
4
+ data.tar.gz: 39ee733f05cca42367f879caedf68c88d57bb59112fa65e3a0a4d50bb91dc306
5
5
  SHA512:
6
- metadata.gz: 14f1dee46bbf8f676500f6c9674aabb876e69e3dd18305eb420813a8ee0b72d86f8e084ac788d9b38879c46a972ccc16a8207057052d7068e748ab0899213d4f
7
- data.tar.gz: 770ccd3b9725fea1dcff4dfe7d2bbacdda6ec843252dbc42f3e8c30863889550bcc0040781310223ef58d85f757bff84b7d2d14baa9ca7ef70d8c58bb85b0262
6
+ metadata.gz: b3664ec21deeab2ebf2e994700312de0902e99edac2da15b036b42d34ebd949ab05c191c4bc2edf998ecd75ecaf6821ca587c338cf2139fb0c3c1d0a7b1bfd2a
7
+ data.tar.gz: eb58b5a54d7adb29f3decf6d4abc201e8a6cd0cabce97556dfa67e0e3ea65bf535016cdd3b31f2ad1e959de7ab7e19da6bfa51dc3ba5d4fa0bb2f8608b0a250d
@@ -15,8 +15,8 @@ module Judoscale
15
15
  end
16
16
 
17
17
  # Most platforms expose opaque, non-ordinal instance ids (Render, ECS, Fly,
18
- # Railway, custom), so by default no instance is redundant or ephemeral.
19
- # Platforms that have those concepts override these.
18
+ # Railway, Hatchbox, custom), so by default no instance is redundant or
19
+ # ephemeral. Platforms that have those concepts override these.
20
20
  def redundant_instance?
21
21
  false
22
22
  end
@@ -45,11 +45,17 @@ module Judoscale
45
45
  Fly.new env["FLY_MACHINE_ID"]
46
46
  elsif env.include?("RAILWAY_REPLICA_ID")
47
47
  Railway.new env["RAILWAY_REPLICA_ID"]
48
+ elsif env.include?("HATCHBOX_SERVER_NAME")
49
+ # Hatchbox passes each server's name (e.g. "web1") into its containers.
50
+ Hatchbox.new env["HATCHBOX_SERVER_NAME"]
48
51
  elsif env.include?("CONTAINER")
49
52
  # Scalingo exposes the container type and index (e.g. "web-1") via CONTAINER.
50
53
  Scalingo.new env["CONTAINER"]
51
54
  else
52
- Unknown.new ""
55
+ # Docker and Kubernetes set HOSTNAME to the container or pod name, which
56
+ # tells instances apart on platforms we don't otherwise detect. On
57
+ # Northflank it's the pod name shown as the container id in its UI.
58
+ Unknown.new env["HOSTNAME"]
53
59
  end
54
60
  end
55
61
 
@@ -105,6 +111,9 @@ module Judoscale
105
111
  class Railway < Platform
106
112
  end
107
113
 
114
+ class Hatchbox < Platform
115
+ end
116
+
108
117
  # User-provided container id via JUDOSCALE_CONTAINER.
109
118
  class Custom < Platform
110
119
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Judoscale
4
- VERSION = "1.13.4"
4
+ VERSION = "1.14.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judoscale-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.4
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam McCrea