health-monitor-rails 9.4.0 → 10.0.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: 4e3901481f04e5dbca447ec01e0e551dc0d6788b82e48ecc681fdf598f7d1094
4
- data.tar.gz: 1fb26a9ff50047e499d810834b0c44b354d23e5587dabb9d8da7d6dca2e7fa85
3
+ metadata.gz: 0502db2e6a54cf73defc3f9333fe3a157c79d8b5b2a4122fd65b6f54c48c76c5
4
+ data.tar.gz: 1b1a0591c7660abf3d38f8b0dd5c21761125f5a9da46bfc3283b2a46f49d40a8
5
5
  SHA512:
6
- metadata.gz: 2074e27e809d298e5b65eeef3d8a3c8b6215ae530f056a66cec0d8f561bdf04e45cefa62f5e7af14f5dc2457bd6823db671ff4ce8fdbd6aa6ccde486bb67c0d9
7
- data.tar.gz: b62478c0bbcbd00295ab63a4846397ace4882d49508385faeb7cd794e3f09b1127a532603320c1567727882965cd840b59352a537913a488119bb8ee238a58c3
6
+ metadata.gz: cc7cd0673bf3c88b9ba7e146c171aee8a98630205b65b1603e1ed39b161bb288cd76a0875ea977725a30bf8914adb4a60232d71be6882e7c865239c364931af2
7
+ data.tar.gz: bb1e311ee5dabda3fa4c1bd141467caf1c7469ba1c1873189e5f3c165ad8c7387c930ccdb94122fcce6d54359a7ae84dea58d3f200b1ce14a51616030589fb9f
data/README.md CHANGED
@@ -214,7 +214,7 @@ HealthMonitor.configure do |config|
214
214
  end
215
215
  end
216
216
 
217
- # To configure specific queues
217
+ # Sidekiq with specific queues
218
218
  HealthMonitor.configure do |config|
219
219
  config.sidekiq.configure do |sidekiq_config|
220
220
  sidekiq_config.add_queue_configuration('critical', latency: 10.seconds, queue_size: 20)
@@ -224,7 +224,7 @@ end
224
224
  ```
225
225
 
226
226
  ```ruby
227
- # Redis
227
+ # Redis with existing connection
228
228
  HealthMonitor.configure do |config|
229
229
  config.redis.configure do |redis_config|
230
230
  redis_config.connection = Redis.current # Use your custom redis connection
@@ -236,7 +236,7 @@ end
236
236
  Additionally, you can configure an explicit URL:
237
237
 
238
238
  ```ruby
239
- # Redis
239
+ # Redis with a URL configuration
240
240
  HealthMonitor.configure do |config|
241
241
  config.redis.configure do |redis_config|
242
242
  redis_config.url = 'redis://user:pass@example.redis.com:90210/'
@@ -245,12 +245,25 @@ HealthMonitor.configure do |config|
245
245
  end
246
246
  ```
247
247
 
248
+ Or via a connection pool:
249
+
250
+ ```ruby
251
+ # Redis using Connection Pools
252
+ HealthMonitor.configure do |config|
253
+ config.redis.configure do |redis_config|
254
+ redis_config.connection = ConnectionPool.new(size: 5) { Redis.new } # Use your custom connection pool
255
+ end
256
+ end
257
+ ```
258
+
248
259
  The currently supported settings are:
249
260
 
250
261
  #### Sidekiq
251
262
 
252
263
  * `latency`: the latency (in seconds) of a queue (now - when the oldest job was enqueued) which is considered unhealthy (the default is 30 seconds, but larger processing queue should have a larger latency value).
253
264
  * `queue_size`: the size (maximum) of a queue which is considered unhealthy (the default is 100).
265
+ * `default_queue`: the default queue to check.
266
+ * `add_queue_configuration`: add specific configuration per queue.
254
267
 
255
268
  #### Redis
256
269
 
@@ -8,8 +8,15 @@ module HealthMonitor
8
8
 
9
9
  class Database < Base
10
10
  def check!
11
- # Check connection to the DB:
12
- ActiveRecord::Migrator.current_version
11
+ failed_databases = []
12
+
13
+ ActiveRecord::Base.connection_handler.all_connection_pools.each do |cp|
14
+ cp.connection.check_version
15
+ rescue Exception
16
+ failed_databases << cp.db_config.name
17
+ end
18
+
19
+ raise "unable to connect to: #{failed_databases.uniq.join(',')}" unless failed_databases.empty?
13
20
  rescue Exception => e
14
21
  raise DatabaseException.new(e.message)
15
22
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HealthMonitor
4
- VERSION = '9.4.0'
4
+ VERSION = '10.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: health-monitor-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.4.0
4
+ version: 10.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonid Beder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-10 00:00:00.000000000 Z
11
+ date: 2023-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '6.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4.0'
26
+ version: '6.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: appraisal
29
29
  requirement: !ruby/object:Gem::Requirement