vitals_monitor 0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b329f8a11e4dc70ac82212ab4352f68a3a8cf0533137277cfdefb1a8b14aafc0
4
+ data.tar.gz: e4b4e56c5151f90827e815dc1b47429508e89a83ecba4443587fda9994c85f6e
5
+ SHA512:
6
+ metadata.gz: 2393320834d78ab1b4b5bc4a666cb15093d1216c1c79e59cd209ee9f6f78890710e8de6ef829a0c790002d5aefa3e0d5a70ebbc0b3b5f43c696add9f4fed375c
7
+ data.tar.gz: b6fabf5c56ebe4711243913c623eb7d10b676ae8b01ac24ca777f7201dffaa80cfcb526e46f6ea0c096ed7e9fb21d57ed76fde63597a11696d1c2352ec4a4a6b
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2025-12-01
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at landovsky@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in vitals_monitor.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+ gem "rspec-rails", "~> 6.0"
12
+ gem "sqlite3", "~> 1.4"
13
+
14
+ gem "rubocop", "~> 1.21"
data/Gemfile.lock ADDED
@@ -0,0 +1,273 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ vitals_monitor (0.1.0)
5
+ rails (>= 5.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ action_text-trix (2.1.15)
11
+ railties
12
+ actioncable (8.1.1)
13
+ actionpack (= 8.1.1)
14
+ activesupport (= 8.1.1)
15
+ nio4r (~> 2.0)
16
+ websocket-driver (>= 0.6.1)
17
+ zeitwerk (~> 2.6)
18
+ actionmailbox (8.1.1)
19
+ actionpack (= 8.1.1)
20
+ activejob (= 8.1.1)
21
+ activerecord (= 8.1.1)
22
+ activestorage (= 8.1.1)
23
+ activesupport (= 8.1.1)
24
+ mail (>= 2.8.0)
25
+ actionmailer (8.1.1)
26
+ actionpack (= 8.1.1)
27
+ actionview (= 8.1.1)
28
+ activejob (= 8.1.1)
29
+ activesupport (= 8.1.1)
30
+ mail (>= 2.8.0)
31
+ rails-dom-testing (~> 2.2)
32
+ actionpack (8.1.1)
33
+ actionview (= 8.1.1)
34
+ activesupport (= 8.1.1)
35
+ nokogiri (>= 1.8.5)
36
+ rack (>= 2.2.4)
37
+ rack-session (>= 1.0.1)
38
+ rack-test (>= 0.6.3)
39
+ rails-dom-testing (~> 2.2)
40
+ rails-html-sanitizer (~> 1.6)
41
+ useragent (~> 0.16)
42
+ actiontext (8.1.1)
43
+ action_text-trix (~> 2.1.15)
44
+ actionpack (= 8.1.1)
45
+ activerecord (= 8.1.1)
46
+ activestorage (= 8.1.1)
47
+ activesupport (= 8.1.1)
48
+ globalid (>= 0.6.0)
49
+ nokogiri (>= 1.8.5)
50
+ actionview (8.1.1)
51
+ activesupport (= 8.1.1)
52
+ builder (~> 3.1)
53
+ erubi (~> 1.11)
54
+ rails-dom-testing (~> 2.2)
55
+ rails-html-sanitizer (~> 1.6)
56
+ activejob (8.1.1)
57
+ activesupport (= 8.1.1)
58
+ globalid (>= 0.3.6)
59
+ activemodel (8.1.1)
60
+ activesupport (= 8.1.1)
61
+ activerecord (8.1.1)
62
+ activemodel (= 8.1.1)
63
+ activesupport (= 8.1.1)
64
+ timeout (>= 0.4.0)
65
+ activestorage (8.1.1)
66
+ actionpack (= 8.1.1)
67
+ activejob (= 8.1.1)
68
+ activerecord (= 8.1.1)
69
+ activesupport (= 8.1.1)
70
+ marcel (~> 1.0)
71
+ activesupport (8.1.1)
72
+ base64
73
+ bigdecimal
74
+ concurrent-ruby (~> 1.0, >= 1.3.1)
75
+ connection_pool (>= 2.2.5)
76
+ drb
77
+ i18n (>= 1.6, < 2)
78
+ json
79
+ logger (>= 1.4.2)
80
+ minitest (>= 5.1)
81
+ securerandom (>= 0.3)
82
+ tzinfo (~> 2.0, >= 2.0.5)
83
+ uri (>= 0.13.1)
84
+ ast (2.4.3)
85
+ base64 (0.3.0)
86
+ bigdecimal (3.3.1)
87
+ builder (3.3.0)
88
+ concurrent-ruby (1.3.5)
89
+ connection_pool (2.5.5)
90
+ crass (1.0.6)
91
+ date (3.5.0)
92
+ diff-lcs (1.6.2)
93
+ drb (2.2.3)
94
+ erb (6.0.0)
95
+ erubi (1.13.1)
96
+ globalid (1.3.0)
97
+ activesupport (>= 6.1)
98
+ i18n (1.14.7)
99
+ concurrent-ruby (~> 1.0)
100
+ io-console (0.8.1)
101
+ irb (1.15.3)
102
+ pp (>= 0.6.0)
103
+ rdoc (>= 4.0.0)
104
+ reline (>= 0.4.2)
105
+ json (2.16.0)
106
+ language_server-protocol (3.17.0.5)
107
+ lint_roller (1.1.0)
108
+ logger (1.7.0)
109
+ loofah (2.24.1)
110
+ crass (~> 1.0.2)
111
+ nokogiri (>= 1.12.0)
112
+ mail (2.9.0)
113
+ logger
114
+ mini_mime (>= 0.1.1)
115
+ net-imap
116
+ net-pop
117
+ net-smtp
118
+ marcel (1.1.0)
119
+ mini_mime (1.1.5)
120
+ minitest (5.26.2)
121
+ net-imap (0.5.12)
122
+ date
123
+ net-protocol
124
+ net-pop (0.1.2)
125
+ net-protocol
126
+ net-protocol (0.2.2)
127
+ timeout
128
+ net-smtp (0.5.1)
129
+ net-protocol
130
+ nio4r (2.7.5)
131
+ nokogiri (1.18.10-arm64-darwin)
132
+ racc (~> 1.4)
133
+ parallel (1.27.0)
134
+ parser (3.3.10.0)
135
+ ast (~> 2.4.1)
136
+ racc
137
+ pg (1.6.2-arm64-darwin)
138
+ pp (0.6.3)
139
+ prettyprint
140
+ prettyprint (0.2.0)
141
+ prism (1.6.0)
142
+ psych (5.2.6)
143
+ date
144
+ stringio
145
+ racc (1.8.1)
146
+ rack (3.2.4)
147
+ rack-protection (4.2.1)
148
+ base64 (>= 0.1.0)
149
+ logger (>= 1.6.0)
150
+ rack (>= 3.0.0, < 4)
151
+ rack-session (2.1.1)
152
+ base64 (>= 0.1.0)
153
+ rack (>= 3.0.0)
154
+ rack-test (2.2.0)
155
+ rack (>= 1.3)
156
+ rackup (2.2.1)
157
+ rack (>= 3)
158
+ rails (8.1.1)
159
+ actioncable (= 8.1.1)
160
+ actionmailbox (= 8.1.1)
161
+ actionmailer (= 8.1.1)
162
+ actionpack (= 8.1.1)
163
+ actiontext (= 8.1.1)
164
+ actionview (= 8.1.1)
165
+ activejob (= 8.1.1)
166
+ activemodel (= 8.1.1)
167
+ activerecord (= 8.1.1)
168
+ activestorage (= 8.1.1)
169
+ activesupport (= 8.1.1)
170
+ bundler (>= 1.15.0)
171
+ railties (= 8.1.1)
172
+ rails-dom-testing (2.3.0)
173
+ activesupport (>= 5.0.0)
174
+ minitest
175
+ nokogiri (>= 1.6)
176
+ rails-html-sanitizer (1.6.2)
177
+ loofah (~> 2.21)
178
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
179
+ railties (8.1.1)
180
+ actionpack (= 8.1.1)
181
+ activesupport (= 8.1.1)
182
+ irb (~> 1.13)
183
+ rackup (>= 1.0.0)
184
+ rake (>= 12.2)
185
+ thor (~> 1.0, >= 1.2.2)
186
+ tsort (>= 0.2)
187
+ zeitwerk (~> 2.6)
188
+ rainbow (3.1.1)
189
+ rake (13.3.1)
190
+ rdoc (6.16.1)
191
+ erb
192
+ psych (>= 4.0.0)
193
+ tsort
194
+ redis (4.8.1)
195
+ regexp_parser (2.11.3)
196
+ reline (0.6.3)
197
+ io-console (~> 0.5)
198
+ rspec (3.13.2)
199
+ rspec-core (~> 3.13.0)
200
+ rspec-expectations (~> 3.13.0)
201
+ rspec-mocks (~> 3.13.0)
202
+ rspec-core (3.13.6)
203
+ rspec-support (~> 3.13.0)
204
+ rspec-expectations (3.13.5)
205
+ diff-lcs (>= 1.2.0, < 2.0)
206
+ rspec-support (~> 3.13.0)
207
+ rspec-mocks (3.13.7)
208
+ diff-lcs (>= 1.2.0, < 2.0)
209
+ rspec-support (~> 3.13.0)
210
+ rspec-rails (6.1.5)
211
+ actionpack (>= 6.1)
212
+ activesupport (>= 6.1)
213
+ railties (>= 6.1)
214
+ rspec-core (~> 3.13)
215
+ rspec-expectations (~> 3.13)
216
+ rspec-mocks (~> 3.13)
217
+ rspec-support (~> 3.13)
218
+ rspec-support (3.13.6)
219
+ rubocop (1.81.7)
220
+ json (~> 2.3)
221
+ language_server-protocol (~> 3.17.0.2)
222
+ lint_roller (~> 1.1.0)
223
+ parallel (~> 1.10)
224
+ parser (>= 3.3.0.2)
225
+ rainbow (>= 2.2.2, < 4.0)
226
+ regexp_parser (>= 2.9.3, < 3.0)
227
+ rubocop-ast (>= 1.47.1, < 2.0)
228
+ ruby-progressbar (~> 1.7)
229
+ unicode-display_width (>= 2.4.0, < 4.0)
230
+ rubocop-ast (1.48.0)
231
+ parser (>= 3.3.7.2)
232
+ prism (~> 1.4)
233
+ ruby-progressbar (1.13.0)
234
+ securerandom (0.4.1)
235
+ sidekiq (6.0.4)
236
+ connection_pool (>= 2.2.2)
237
+ rack (>= 2.0.0)
238
+ rack-protection (>= 2.0.0)
239
+ redis (>= 4.1.0)
240
+ sqlite3 (1.7.3-arm64-darwin)
241
+ stringio (3.1.8)
242
+ thor (1.4.0)
243
+ timeout (0.4.4)
244
+ tsort (0.2.0)
245
+ tzinfo (2.0.6)
246
+ concurrent-ruby (~> 1.0)
247
+ unicode-display_width (3.2.0)
248
+ unicode-emoji (~> 4.1)
249
+ unicode-emoji (4.1.0)
250
+ uri (1.1.1)
251
+ useragent (0.16.11)
252
+ websocket-driver (0.8.0)
253
+ base64
254
+ websocket-extensions (>= 0.1.0)
255
+ websocket-extensions (0.1.5)
256
+ zeitwerk (2.7.3)
257
+
258
+ PLATFORMS
259
+ arm64-darwin-24
260
+
261
+ DEPENDENCIES
262
+ pg (~> 1.0)
263
+ rake (~> 13.0)
264
+ redis (~> 4.0)
265
+ rspec (~> 3.0)
266
+ rspec-rails (~> 6.0)
267
+ rubocop (~> 1.21)
268
+ sidekiq (~> 6.0)
269
+ sqlite3 (~> 1.4)
270
+ vitals_monitor!
271
+
272
+ BUNDLED WITH
273
+ 2.4.10
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Tomáš Landovský
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,181 @@
1
+ # VitalsMonitor
2
+
3
+ A Rails engine that provides health check endpoints for monitoring Postgres, Redis, and Sidekiq. Components can be enabled or disabled via configuration, and endpoints return HTML or JSON with appropriate HTTP status codes for external monitoring systems.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'vitals_monitor'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```bash
16
+ $ bundle install
17
+ ```
18
+
19
+ Or install it yourself as:
20
+
21
+ ```bash
22
+ $ gem install vitals_monitor
23
+ ```
24
+
25
+ ## Configuration
26
+
27
+ ### Generate Initializer
28
+
29
+ After installing the gem, generate the initializer file:
30
+
31
+ ```bash
32
+ $ rake vitals_monitor:install
33
+ ```
34
+
35
+ This command must be run from your Rails application root directory. It will:
36
+ - Generate the initializer file at `config/initializers/vitals_monitor.rb`
37
+ - Automatically add the mount statement to your `config/routes.rb` file
38
+
39
+ This will create `config/initializers/vitals_monitor.rb` with default configuration:
40
+
41
+ ```ruby
42
+ VitalsMonitor.configure do |config|
43
+ # Enable or disable specific components
44
+ # By default, all components are enabled
45
+ config.enable(:postgres)
46
+ config.enable(:redis)
47
+ config.enable(:sidekiq)
48
+
49
+ # Or disable specific components
50
+ # config.disable(:sidekiq)
51
+ end
52
+ ```
53
+
54
+ ### Manual Configuration
55
+
56
+ Alternatively, you can create the initializer file manually at `config/initializers/vitals_monitor.rb` with the configuration above.
57
+
58
+ ## Mounting the Engine
59
+
60
+ In your `config/routes.rb`, mount the engine:
61
+
62
+ ```ruby
63
+ Rails.application.routes.draw do
64
+ mount VitalsMonitor::Engine => '/vitals'
65
+ end
66
+ ```
67
+
68
+ ## Usage
69
+
70
+ ### Endpoints
71
+
72
+ #### GET /vitals
73
+
74
+ Returns the health status of all enabled components.
75
+
76
+ **HTML Response:**
77
+ - Returns 200 OK if all components are healthy
78
+ - Returns 503 Service Unavailable if any component is unhealthy
79
+
80
+ **JSON Response:**
81
+ ```json
82
+ {
83
+ "status": "healthy",
84
+ "components": {
85
+ "postgres": {
86
+ "status": "healthy",
87
+ "message": null
88
+ },
89
+ "redis": {
90
+ "status": "healthy",
91
+ "message": null
92
+ },
93
+ "sidekiq": {
94
+ "status": "healthy",
95
+ "message": "Processed: 1234, Failed: 0, Enqueued: 5"
96
+ }
97
+ }
98
+ }
99
+ ```
100
+
101
+ #### GET /vitals/:component
102
+
103
+ Returns the health status of a specific component. Valid components are: `postgres`, `redis`, `sidekiq`.
104
+
105
+ **HTML Response:**
106
+ - Returns 200 OK if the component is healthy
107
+ - Returns 503 Service Unavailable if the component is unhealthy
108
+ - Returns 404 Not Found if the component is not enabled
109
+
110
+ **JSON Response:**
111
+ ```json
112
+ {
113
+ "component": "postgres",
114
+ "status": "healthy",
115
+ "message": null
116
+ }
117
+ ```
118
+
119
+ ### Examples
120
+
121
+ Check all components:
122
+ ```bash
123
+ curl http://localhost:3000/vitals
124
+ curl http://localhost:3000/vitals.json
125
+ ```
126
+
127
+ Check a specific component:
128
+ ```bash
129
+ curl http://localhost:3000/vitals/postgres
130
+ curl http://localhost:3000/vitals/redis.json
131
+ curl http://localhost:3000/vitals/sidekiq
132
+ ```
133
+
134
+ ### Monitoring Integration
135
+
136
+ The endpoints return appropriate HTTP status codes, making them suitable for monitoring systems:
137
+
138
+ - **200 OK**: All components are healthy
139
+ - **503 Service Unavailable**: One or more components are unhealthy
140
+ - **404 Not Found**: Component is not enabled or doesn't exist
141
+
142
+ This allows you to use the endpoints with monitoring tools like:
143
+ - Kubernetes liveness/readiness probes
144
+ - AWS ELB health checks
145
+ - Nagios/Icinga checks
146
+ - Any HTTP-based monitoring system
147
+
148
+ ## Health Checks
149
+
150
+ ### PostgreSQL
151
+
152
+ Checks the database connection by executing a simple query. Requires ActiveRecord to be configured.
153
+
154
+ ### Redis
155
+
156
+ Checks the Redis connection by attempting to ping the server. Supports multiple Redis configurations:
157
+ - `Redis.current` (if available)
158
+ - `Rails.application.config.redis` (if configured)
159
+ - Sidekiq's Redis connection (if Sidekiq is available)
160
+
161
+ ### Sidekiq
162
+
163
+ Checks Sidekiq's health by accessing its statistics. Requires Sidekiq to be configured and available.
164
+
165
+ ## Development
166
+
167
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
168
+
169
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
170
+
171
+ ## Contributing
172
+
173
+ Bug reports and pull requests are welcome on GitHub at https://github.com/landovsky/vitals_monitor. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/landovsky/vitals_monitor/blob/main/CODE_OF_CONDUCT.md).
174
+
175
+ ## License
176
+
177
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
178
+
179
+ ## Code of Conduct
180
+
181
+ Everyone interacting in the VitalsMonitor project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/landovsky/vitals_monitor/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ # Load VitalsMonitor rake tasks
13
+ Dir[File.join(__dir__, "lib", "tasks", "**", "*.rake")].each { |f| load f }
14
+
15
+ task default: %i[spec rubocop]