wellness 0.1.3 → 0.2.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/.travis.yml +9 -0
- data/DOCUMENTATION.md +78 -0
- data/README.md +4 -0
- data/Rakefile +5 -1
- data/lib/wellness.rb +0 -1
- data/lib/wellness/services/sidekiq_service.rb +1 -1
- data/lib/wellness/version.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- data/wellness.gemspec +1 -0
- metadata +17 -2
- data/lib/wellness/checker.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76f9b1fdc9a32250719692af2a9edee4def359f8
|
4
|
+
data.tar.gz: d3bbe4583ca4819d3384c6393cba810f50fe38d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2797c1c8566fcd651ea5e0700b702ac0527f364cc446e356a881d98f623369420e38b9dd3842a2bc66d8542a73ddad1c4e37d80103f006c00ac3876f157e1a54
|
7
|
+
data.tar.gz: e5d938acabfa64b940ae2c37fdee7b8a07c87b6649fce5b58cb075f7915285be1f4ee943c42210ec95ac126e3dfc5c4434087ae43f577981ef80ac132df8ecf4
|
data/.travis.yml
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.0.0
|
4
|
+
- 1.9.3
|
5
|
+
notifications:
|
6
|
+
irc: "chat.freenode.net#warmwaffles"
|
7
|
+
env:
|
8
|
+
- CODECLIMATE_REPO_TOKEN=6212f00d1b8f97c85cf1e6478e12dafbb7325b3b51c6a3979aea7ea55e619c03
|
9
|
+
- CODECLIMATE_REPO_TOKEN=6212f00d1b8f97c85cf1e6478e12dafbb7325b3b51c6a3979aea7ea55e619c03
|
data/DOCUMENTATION.md
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
# HTTP Applications
|
2
|
+
|
3
|
+
Services **MUST** supply an endpoint for determining their health. Health and
|
4
|
+
status information **MUST** be supplied under the `/health` path. Responses for
|
5
|
+
health and status information **MUST** be valid json by default. Services
|
6
|
+
**MAY** be provided in other formats by supplying a `format` parameter with
|
7
|
+
appropriate values such as `xml`.
|
8
|
+
|
9
|
+
## Status
|
10
|
+
|
11
|
+
A summarized status for a given application **MUST** be available from the
|
12
|
+
route `/health/status`. The response **MUST** be one of the following:
|
13
|
+
|
14
|
+
- `{ "status": "HEALTHY" }` with HTTP status code `200`
|
15
|
+
- `{ "status": "UNHEALTHY" }` with HTTP status code `500`
|
16
|
+
|
17
|
+
## Details
|
18
|
+
|
19
|
+
Detailed status for a given application **MUST** be available from the route
|
20
|
+
`/health/details`. The response **MUST** be returned with in the following
|
21
|
+
format:
|
22
|
+
|
23
|
+
```json
|
24
|
+
{
|
25
|
+
"status": "HEALTHY",
|
26
|
+
"details": {
|
27
|
+
"requests": {
|
28
|
+
"last_hour": 512,
|
29
|
+
"last_day": 12288
|
30
|
+
},
|
31
|
+
"top_consumers": {
|
32
|
+
"last_hour": {
|
33
|
+
"foo": 128,
|
34
|
+
"bar": 64,
|
35
|
+
"baz": 32
|
36
|
+
},
|
37
|
+
"last_day": {
|
38
|
+
"foo": 3072,
|
39
|
+
"bar": 1536,
|
40
|
+
"baz": 768
|
41
|
+
}
|
42
|
+
}
|
43
|
+
},
|
44
|
+
"dependencies": {
|
45
|
+
"cache": {
|
46
|
+
"status": "HEALTHY"
|
47
|
+
},
|
48
|
+
"database": {
|
49
|
+
"status": "HEALTHY",
|
50
|
+
"details": {
|
51
|
+
"connection": "read_write",
|
52
|
+
"reads": {
|
53
|
+
"last_hour": 1234,
|
54
|
+
"last_day": 29616
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
```
|
61
|
+
|
62
|
+
## Requirements
|
63
|
+
|
64
|
+
Top level keys, `status` and `dependencies` are **REQUIRED**.
|
65
|
+
|
66
|
+
* The `status` key **MUST** have one of the values listed in the specification
|
67
|
+
for the `/health/status` response
|
68
|
+
* A `details` key is **RECOMMENDED** to be included which contains a dictionary
|
69
|
+
of any metrics the service has.
|
70
|
+
* The `dependencies` key **MUST** contain a dictionary of all services on which
|
71
|
+
your service depends on.
|
72
|
+
* Keys **MUST** be unique for each service.
|
73
|
+
* Values **MUST** be a dictionary containing at least the key `status`
|
74
|
+
* Valid values for `status`:
|
75
|
+
* `HEALTHY`
|
76
|
+
*`UNHEALTHY`
|
77
|
+
* A `details` key **MAY** be added with any additional information to report
|
78
|
+
on the service.
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Wellness
|
2
2
|
|
3
|
+
[](https://travis-ci.org/warmwaffles/wellness)
|
4
|
+
[](https://codeclimate.com/repos/52d700d0e30ba038a9003919/feed)
|
5
|
+
|
6
|
+
|
3
7
|
A rack middleware library that adds a health check to your service. It comes
|
4
8
|
with pre made services and has the option and flexibility for you to make your
|
5
9
|
own.
|
data/Rakefile
CHANGED
data/lib/wellness.rb
CHANGED
@@ -8,7 +8,7 @@ module Wellness
|
|
8
8
|
def check
|
9
9
|
sidekiq_stats = Sidekiq::Stats.new
|
10
10
|
queue = Sidekiq::Queue.new
|
11
|
-
redis = Redis.new(
|
11
|
+
redis = Redis.new(self.params.fetch(:redis))
|
12
12
|
redis_stats = redis.info.select { |k, _| KEYS.include?(k) }
|
13
13
|
workers_size = redis.scard("workers").to_i
|
14
14
|
|
data/lib/wellness/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/wellness.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wellness
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Johnston
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: codeclimate-test-reporter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: A rack middleware health check
|
56
70
|
email:
|
57
71
|
- warmwaffles@gmail.com
|
@@ -63,12 +77,13 @@ files:
|
|
63
77
|
- .rspec
|
64
78
|
- .ruby-gemset
|
65
79
|
- .ruby-version
|
80
|
+
- .travis.yml
|
81
|
+
- DOCUMENTATION.md
|
66
82
|
- Gemfile
|
67
83
|
- LICENSE.txt
|
68
84
|
- README.md
|
69
85
|
- Rakefile
|
70
86
|
- lib/wellness.rb
|
71
|
-
- lib/wellness/checker.rb
|
72
87
|
- lib/wellness/middleware.rb
|
73
88
|
- lib/wellness/services/base.rb
|
74
89
|
- lib/wellness/services/postgres_service.rb
|