kubernetes-health 3.12.1 → 3.12.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f1527d74312ef1d4c77095b8ee8c87f65dee6308e6340a697cee5bcedfe40f2
4
- data.tar.gz: 1671089c58d3f7ba73e015a830e2622b324216a21ef25e9a7dc86d1b21527aa5
3
+ metadata.gz: 69c1ed0bafbc26dfa3d4cf60ed954557841469e134131a58826c5b17dbd2dd6e
4
+ data.tar.gz: 6300a0c9d587f641cd649b0715162f701544560a39a69bfbaab40d16dc0c482d
5
5
  SHA512:
6
- metadata.gz: a4b6ad22f24f40d719ab62cf1b14d45c9e4030d899a0370e774d5deface1ebfebfe13feea5047b4c12de09cdf3b4421f05f58165bd086dbc8755f941755c3459
7
- data.tar.gz: e35f96cbfc2a13a5c49ce2d6e98d1e9c51bdb660e81ce3990d0481a2d7e3a7793dcf349579b1994555d255e22d7f0d63b54f08194bec8d518f662090a26924f1
6
+ metadata.gz: b622eb35caa632f931a22c4da90c6613ac65307d8def6a635ef91f73709a65b0d303f77ea9752e0a0e9e90e5b87d90892237a86cc4e7fd5bdf77fbb334697385
7
+ data.tar.gz: 749a290a82252eb12a526c06fa84c201ef83d5e4122610ad1de0aa84683e316459515e1a174e6360104b4bd01d407f7ad9f0652b9ae25eb2b8c056ce1b82c334
data/README.md CHANGED
@@ -16,7 +16,7 @@ This gem opens a dedicated HTTP port to allow Kubernetes to monitor your Rails a
16
16
  Add this line to your application's Gemfile:
17
17
 
18
18
  ```ruby
19
- gem 'kubernetes-health', '~> 3.7'
19
+ gem 'kubernetes-health', '~> 3.12.1'
20
20
  ```
21
21
 
22
22
  ## Enabling puma plugin
@@ -1,5 +1,5 @@
1
1
  module Kubernetes
2
2
  module Health
3
- VERSION = '3.12.1'.freeze
3
+ VERSION = '3.12.4'.freeze
4
4
  end
5
5
  end
@@ -54,11 +54,13 @@ module Puma
54
54
  end
55
55
 
56
56
  def generate_extended_puma_stats
57
- return {} if @launcher.nil?
58
-
59
- puma_stats = @launcher.stats
57
+ begin
58
+ puma_stats = @launcher.stats
59
+ rescue NoMethodError
60
+ puma_stats = {}
61
+ end
60
62
  # On puma <= 4 puma_stats is a String
61
- puma_stats = JSON.parse(puma_stats, symbolize_names: true) unless puma_stats.is_a?(Hash)
63
+ puma_stats = JSON.parse(puma_stats, symbolize_names: true) if puma_stats.is_a?(String)
62
64
  # Including usage stats.
63
65
  puma_stats = merge_worker_status(puma_stats) if puma_stats[:worker_status].present?
64
66
  puma_stats[:usage] = (1 - puma_stats[:pool_capacity].to_f / puma_stats[:max_threads]).round(2) if puma_stats[:pool_capacity].present?
@@ -87,6 +89,8 @@ module Puma
87
89
  end
88
90
 
89
91
  def puma_already_started?(extended_puma_stats)
92
+ return false if extended_puma_stats.empty?
93
+
90
94
  if extended_puma_stats[:booted_workers].present?
91
95
  # Cluster Mode
92
96
  extended_puma_stats[:booted_workers].positive?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubernetes-health
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.12.1
4
+ version: 3.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wagner Caixeta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-28 00:00:00.000000000 Z
11
+ date: 2024-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler