health_monitor_lb 1.0.0 → 1.1.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/app/controllers/{health_monitor → health_monitor_lb}/application_controller.rb +1 -1
- data/app/controllers/{health_monitor → health_monitor_lb}/health_controller.rb +1 -1
- data/app/services/{health_monitor → health_monitor_lb}/health_check_service.rb +2 -2
- data/bin/rails +1 -1
- data/config/routes.rb +1 -1
- data/lib/health_monitor_lb/engine.rb +5 -0
- data/lib/health_monitor_lb/version.rb +3 -0
- data/lib/{health_monitor.rb → health_monitor_lb.rb} +3 -3
- data/spec/controllers/{health_monitor/health_controller_spec.rb → health_monitor_lb/health_controller_lb_spec.rb} +5 -5
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/log/test.log +27 -0
- data/spec/{health_monitor_spec.rb → health_monitor_lb_spec.rb} +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +9 -10
- data/lib/health_monitor/engine.rb +0 -5
- data/lib/health_monitor/version.rb +0 -3
- data/lib/tasks/health_monitor_tasks.rake +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10859ba4ff5c605345ae3a5980c47a573a058fe5b890574a0fcc702b6318cbb1
|
4
|
+
data.tar.gz: 286432d349f9e20743264685a4f3a97ee5852c6239f01bfab043129019fcb166
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c38c71932fbc6115176d05bec121fc1ab3b0437daa7b06160799a00711b6604b5c5ef92e44b065267a68279bfa57ef78d0eb76960bf233a2721e23eae7260e9c
|
7
|
+
data.tar.gz: f6532a9558d78a8c715020bc42445f05c879d66b668969d32921e6d64585dd78683002e560fe5c82252e24ad9f9d0ccf0264a780603bc4582b48f0514125605c
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module HealthMonitorLb
|
2
2
|
class HealthCheckService
|
3
3
|
def call
|
4
4
|
status = { rails_version: Rails::VERSION::STRING }
|
@@ -6,7 +6,7 @@ module HealthMonitor
|
|
6
6
|
.merge(postgres_check)
|
7
7
|
.merge(redis_check)
|
8
8
|
|
9
|
-
|
9
|
+
HealthMonitorLb.additional_health_checks.each do |health_check_klass|
|
10
10
|
status = status.merge(health_check_klass.safe_constantize.health_check)
|
11
11
|
end
|
12
12
|
|
data/bin/rails
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# installed from the root of your application.
|
4
4
|
|
5
5
|
ENGINE_ROOT = File.expand_path('..', __dir__)
|
6
|
-
ENGINE_PATH = File.expand_path('../lib/
|
6
|
+
ENGINE_PATH = File.expand_path('../lib/health_monitor_lb/engine', __dir__)
|
7
7
|
APP_PATH = File.expand_path('../spec/dummy/config/application', __dir__)
|
8
8
|
|
9
9
|
# Set up gems listed in the Gemfile.
|
data/config/routes.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require "
|
2
|
-
require "
|
1
|
+
require "health_monitor_lb/version"
|
2
|
+
require "health_monitor_lb/engine"
|
3
3
|
|
4
|
-
module
|
4
|
+
module HealthMonitorLb
|
5
5
|
mattr_accessor :additional_health_checks
|
6
6
|
@@additional_health_checks = []
|
7
7
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
|
-
module
|
3
|
+
module HealthControllerLbSpec
|
4
4
|
class TestHealthCheck
|
5
5
|
def self.health_check
|
6
6
|
{ 'test_health_check' => 'ok' }
|
@@ -8,8 +8,8 @@ module HealthControllerSpec
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
describe
|
12
|
-
routes {
|
11
|
+
describe HealthMonitorLb::HealthController, type: :controller do
|
12
|
+
routes { HealthMonitorLb::Engine.routes }
|
13
13
|
|
14
14
|
context 'not authorized' do
|
15
15
|
it 'returns unauthorized without a token' do
|
@@ -27,14 +27,14 @@ describe HealthMonitor::HealthController, type: :controller do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'handles custom checks' do
|
30
|
-
|
30
|
+
HealthMonitorLb.additional_health_checks = ['HealthControllerLbSpec::TestHealthCheck']
|
31
31
|
|
32
32
|
get :index, params: { API_TOKEN: ENV['HEALTH_MONITOR_API_TOKEN'] }
|
33
33
|
expect(response.status).to eq(200)
|
34
34
|
|
35
35
|
expect(response.parsed_body).to include({ 'rails_version' => Rails::VERSION::STRING, 'ruby' => 'ok', 'test_health_check' => 'ok' })
|
36
36
|
|
37
|
-
|
37
|
+
HealthMonitorLb.additional_health_checks = []
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
@@ -5,7 +5,7 @@ require "rails/all"
|
|
5
5
|
# Require the gems listed in Gemfile, including any gems
|
6
6
|
# you've limited to :test, :development, or :production.
|
7
7
|
Bundler.require(*Rails.groups)
|
8
|
-
require "
|
8
|
+
require "health_monitor_lb"
|
9
9
|
|
10
10
|
module Dummy
|
11
11
|
class Application < Rails::Application
|
data/spec/dummy/config/routes.rb
CHANGED
data/spec/dummy/log/test.log
CHANGED
@@ -182,3 +182,30 @@ Completed 200 OK in 94ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 386)
|
|
182
182
|
Processing by HealthMonitor::HealthController#index as HTML
|
183
183
|
Parameters: {"API_TOKEN"=>"[FILTERED]"}
|
184
184
|
Completed 200 OK in 93ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 184)
|
185
|
+
Processing by HealthMonitorLb::HealthController#index as HTML
|
186
|
+
Filter chain halted as :check_api_token rendered or redirected
|
187
|
+
Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 282)
|
188
|
+
Processing by HealthMonitorLb::HealthController#index as HTML
|
189
|
+
Parameters: {"API_TOKEN"=>"[FILTERED]"}
|
190
|
+
Completed 500 Internal Server Error in 109ms (ActiveRecord: 0.0ms | Allocations: 355)
|
191
|
+
Processing by HealthMonitorLb::HealthController#index as HTML
|
192
|
+
Parameters: {"API_TOKEN"=>"[FILTERED]"}
|
193
|
+
Completed 500 Internal Server Error in 107ms (ActiveRecord: 0.0ms | Allocations: 153)
|
194
|
+
Processing by HealthMonitorLb::HealthController#index as HTML
|
195
|
+
Filter chain halted as :check_api_token rendered or redirected
|
196
|
+
Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 282)
|
197
|
+
Processing by HealthMonitorLb::HealthController#index as HTML
|
198
|
+
Parameters: {"API_TOKEN"=>"[FILTERED]"}
|
199
|
+
Completed 200 OK in 98ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 385)
|
200
|
+
Processing by HealthMonitorLb::HealthController#index as HTML
|
201
|
+
Parameters: {"API_TOKEN"=>"[FILTERED]"}
|
202
|
+
Completed 500 Internal Server Error in 98ms (ActiveRecord: 0.0ms | Allocations: 208)
|
203
|
+
Processing by HealthMonitorLb::HealthController#index as HTML
|
204
|
+
Filter chain halted as :check_api_token rendered or redirected
|
205
|
+
Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 282)
|
206
|
+
Processing by HealthMonitorLb::HealthController#index as HTML
|
207
|
+
Parameters: {"API_TOKEN"=>"[FILTERED]"}
|
208
|
+
Completed 200 OK in 112ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 385)
|
209
|
+
Processing by HealthMonitorLb::HealthController#index as HTML
|
210
|
+
Parameters: {"API_TOKEN"=>"[FILTERED]"}
|
211
|
+
Completed 200 OK in 106ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 185)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require "rails_helper"
|
3
3
|
|
4
|
-
RSpec.describe
|
4
|
+
RSpec.describe HealthMonitorLb do
|
5
5
|
it "has a version number" do
|
6
|
-
expect(
|
6
|
+
expect(HealthMonitorLb::VERSION).not_to be nil
|
7
7
|
end
|
8
8
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: health_monitor_lb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alan Hecht
|
@@ -93,16 +93,15 @@ extra_rdoc_files: []
|
|
93
93
|
files:
|
94
94
|
- README.md
|
95
95
|
- Rakefile
|
96
|
-
- app/controllers/
|
97
|
-
- app/controllers/
|
98
|
-
- app/services/
|
96
|
+
- app/controllers/health_monitor_lb/application_controller.rb
|
97
|
+
- app/controllers/health_monitor_lb/health_controller.rb
|
98
|
+
- app/services/health_monitor_lb/health_check_service.rb
|
99
99
|
- bin/rails
|
100
100
|
- config/routes.rb
|
101
|
-
- lib/
|
102
|
-
- lib/
|
103
|
-
- lib/
|
104
|
-
-
|
105
|
-
- spec/controllers/health_monitor/health_controller_spec.rb
|
101
|
+
- lib/health_monitor_lb.rb
|
102
|
+
- lib/health_monitor_lb/engine.rb
|
103
|
+
- lib/health_monitor_lb/version.rb
|
104
|
+
- spec/controllers/health_monitor_lb/health_controller_lb_spec.rb
|
106
105
|
- spec/dummy/Rakefile
|
107
106
|
- spec/dummy/app/assets/config/manifest.js
|
108
107
|
- spec/dummy/app/assets/stylesheets/application.css
|
@@ -152,7 +151,7 @@ files:
|
|
152
151
|
- spec/dummy/public/apple-touch-icon.png
|
153
152
|
- spec/dummy/public/favicon.ico
|
154
153
|
- spec/dummy/tmp/development_secret.txt
|
155
|
-
- spec/
|
154
|
+
- spec/health_monitor_lb_spec.rb
|
156
155
|
- spec/rails_helper.rb
|
157
156
|
- spec/spec_helper.rb
|
158
157
|
licenses:
|