rt_health_monitor 0.8.0.pre.rc1 → 0.8.0

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: 13cb464b9e81668abf4c5dc72a0f48c6e1834e0ebb4e19dcbe51a73ee5a1cb5e
4
- data.tar.gz: 66d0c9256a656bbf89ffa4abb59ba4bb5ee81cb38be3281effc4899fb44bac3b
3
+ metadata.gz: 29ef2a8b6dbcb15e9907509cd8492093223ea64936b8defaf70c0d23da579303
4
+ data.tar.gz: 3cc46a14eb1eff4d33a21ee5577c11fc47bd92d2992aa6bb3f48bc0494861715
5
5
  SHA512:
6
- metadata.gz: 6f26b2584e91dfd22b718412fcbbb7d970e074e78b844cd494628b0f0a322f308297840440aac31fbc1cbea32a89598a5023e063722d8d3a0a46dd987188d2b4
7
- data.tar.gz: '092792193524f8f4f553299cbed038f4371daf1bba63ec6d42d4d2ec807891aa6e2bdcf9152c69e41b15c813f5024ef020efc77886584d05ac65e405b282af80'
6
+ metadata.gz: 1fdd9ce1c136b4b0c94919922c701e8de13f24c8369ba9fe8c90c5c36642a9963f7f0c5a0e0dd78ea28dc0261a7be3d1696578868e24002146e9330e0cf6bd8d
7
+ data.tar.gz: c2c78c6dc7bec506708f6473bff73b8f064dfc6944790a6b626bcc81c7c3af4f7d0ccfbc085a7e242e9d35817463e99968bdcd7c5798ca66e989a148bc81992d
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ Gemfile.lock
@@ -2,6 +2,15 @@ Changelog
2
2
  ===
3
3
 
4
4
  master
5
+ ---
6
+
7
+ v0.8.0
8
+ ---
9
+
10
+ - Renamed gem to `rt_health_monitor`. The directory names are still the same,
11
+ so you don't have to change your `require`s yet.
12
+ - Refactored HealthMonitor middleware
13
+ - The middleware now returns 503 instead of 200 if one of the checks failed.
5
14
 
6
15
  v0.7.2
7
16
  ---
data/README.md CHANGED
@@ -1,14 +1,26 @@
1
- Purpose
2
- =======
1
+ # rt_health_monitor
3
2
 
4
- * Get information about your applications health status easily
3
+ [![Gem Version](https://badge.fury.io/rb/rt_health_monitor.svg)](https://badge.fury.io/rb/rt_health_monitor)
5
4
 
6
- Usage
7
- =====
5
+ Get information about your applications health status easily.
8
6
 
9
- Add the gem to your Gemfile
7
+ ## Installation
10
8
 
11
- gem 'rt_health_monitor', require: 'health_monitor'
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'rt_health_monitor', require: 'health_monitor'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install rt_health_monitor
22
+
23
+ ## Usage
12
24
 
13
25
  Add the middleware to your config.
14
26
 
@@ -16,101 +28,118 @@ Add the middleware to your config.
16
28
 
17
29
  Add to you Rails configuration (config/application.rb)
18
30
 
19
- module <ApplicationName>
20
- class Application < Rails::Application
21
- config.middleware.use ::HealthMonitorMiddleware, "your_application_name"
22
- end
23
- end
31
+ ```ruby
32
+ module <ApplicationName>
33
+ class Application < Rails::Application
34
+ config.middleware.use ::HealthMonitorMiddleware, "your_application_name"
35
+ end
36
+ end
37
+ ```
24
38
 
25
39
  ### Sinatra
26
40
 
27
41
  Add to config.ru
28
42
 
29
- use HealthMonitorMiddleware, "your_application_name"
43
+ ```ruby
44
+ use HealthMonitorMiddleware, "your_application_name"
45
+ ```
30
46
 
31
47
  ### Padrino
32
48
 
33
49
  Add to config/apps.rb
34
50
 
35
- Padrino.use(HealthMonitorMiddleware, "your_application_name")
36
-
51
+ ```ruby
52
+ Padrino.use(HealthMonitorMiddleware, "your_application_name")
53
+ ```
37
54
 
38
55
  ## Configure your dependencies
39
56
 
40
- Put into some place which is loaded on startup, like config/initializer/health_monitor_initializer.rb
57
+ Put into some place which is loaded on startup, like
58
+ `config/initializer/health_monitor_initializer.rb`
59
+
60
+ ```ruby
61
+ HealthMonitorMiddleware.add("simple", name: "MySQL") { User.where{id > 0}.limit(1) }
41
62
 
42
- HealthMonitorMiddleware.add("simple", name: "MySQL") { User.where{id > 0}.limit(1) }
43
-
44
- HealthMonitorMiddleware.add("service", name: 'some_service_name') { RestClient.get(File.join(service-url, 'healthmonitor')) }
63
+ HealthMonitorMiddleware.add("service", name: 'some_service_name') { RestClient.get(File.join(service-url, 'healthmonitor')) }
64
+ ```
45
65
 
46
- Simple-Monitor needs some block which returns true or false for up an down state. Service-Monitor needs an block which returns a complete status response in JSON format. This may be just the health-monitor used by a service.
66
+ Simple-Monitor needs some block which returns true or false for up an down
67
+ state. Service-Monitor needs an block which returns a complete status response
68
+ in JSON format. This may be just the health-monitor used by a service.
47
69
 
48
70
  ## Outcome
49
71
 
50
- As soon as the middleware is configured and your application is running, you can acess the health monitor status page adding 'healthmonitor' to your url. It does not depend on the given path.
72
+ As soon as the middleware is configured and your application is running, you can
73
+ acess the health monitor status page adding 'health_monitor' to your url. It does
74
+ not depend on the given path.
51
75
 
52
- http://your_application_url_with_some_path/healthmonitor
76
+ http://your_application_url_with_some_path/health_monitor
53
77
 
54
- This would lead to the following output f.e.:
78
+ This would lead to the following output:
55
79
 
80
+ ```json
81
+ {
82
+ "status": "down",
83
+ "name": "my app",
84
+ "simple": [
56
85
  {
57
- status: "down",
58
- name: "my app",
59
- simple: [
60
- {
61
- status: "up",
62
- name: "MySQL",
63
- time: 0.2758502960205078
64
- },
65
- {
66
- status: "up",
67
- name: "Memcached",
68
- time: 1.4078617095947266
69
- },
70
- {
71
- status: "up",
72
- name: "Resque",
73
- time: 3.2737255096435547
74
- }
75
- ],
76
- service: [
77
- {
78
- status: "down",
79
- name: "routes",
80
- time: 1295.3431606292725
81
- },
82
- {
83
- status: "up",
84
- name: "appendix",
85
- info: {
86
- simple: [
87
- {
88
- status: "up",
89
- name: "MongoDB",
90
- time: 6.000041961669922
91
- },
92
- {
93
- status: "up",
94
- name: "MySQL",
95
- time: 0
96
- }
97
- ]
98
- },
99
- time: 23.989439010620117
86
+ "status": "up",
87
+ "name": "MySQL",
88
+ "time": 0.2758502960205078
89
+ },
90
+ {
91
+ "status": "up",
92
+ "name": "Memcached",
93
+ "time": 1.4078617095947266
94
+ },
95
+ {
96
+ "status": "up",
97
+ "name": "Resque",
98
+ "time": 3.2737255096435547
99
+ }
100
+ ],
101
+ "service": [
102
+ {
103
+ "status": "down",
104
+ "name": "routes",
105
+ "time": 1295.3431606292725
106
+ },
107
+ {
108
+ "status": "up",
109
+ "name": "appendix",
110
+ "info": {
111
+ "simple": [
112
+ {
113
+ "status": "up",
114
+ "name": "MongoDB",
115
+ "time": 6.000041961669922
116
+ },
117
+ {
118
+ "status": "up",
119
+ "name": "MySQL",
120
+ "time": 0
121
+ }
122
+ ]
100
123
  },
124
+ "time": 23.989439010620117
125
+ },
101
126
  ...
102
- }
127
+ ]
128
+ }
129
+ ```
103
130
 
104
131
 
105
132
  ## Sidekiq Health Check Task
106
133
 
107
- A task for performing a Sidekiq health check is also included. To use that, just add the following line to your `Rakefile`
134
+ A task for performing a Sidekiq health check is also included. To use that, just
135
+ add the following line to your `Rakefile`
108
136
 
109
137
  ```ruby
110
138
  require "health_monitor/rake_task"
111
139
  ```
112
140
 
113
- You must have a `environment` task in your `Rakefile` which loads the environment. Rails already provides such a task.
141
+ You must have a `environment` task in your `Rakefile` which loads the
142
+ environment. Rails already provides such a task.
114
143
 
115
144
  A simple environment task looks like this:
116
145
 
@@ -1,3 +1,3 @@
1
1
  class HealthMonitor
2
- VERSION = "0.8.0.pre.rc1"
2
+ VERSION = "0.8.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rt_health_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.pre.rc1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fuehrlinger
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2018-04-16 00:00:00.000000000 Z
13
+ date: 2018-04-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -107,9 +107,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - ">"
110
+ - - ">="
111
111
  - !ruby/object:Gem::Version
112
- version: 1.3.1
112
+ version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
115
  rubygems_version: 2.7.3