puma_doctor 0.0.1 → 0.0.2
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 +5 -5
- data/README.md +14 -15
- data/lib/puma_doctor/capistrano.rb +13 -9
- data/lib/puma_doctor/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a4d7779c89964a27406f825666c8d0b66d5c59229ed5a8aca1fdd7320afbb327
|
4
|
+
data.tar.gz: a5266fccb10905f148b3c039647425518efecb1b2935ac6833a16e18cbd2bd7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08ebfe16659dc621aae8d3753aad335c38eb495a44184a5886793d7a6d4778db2daaf6fdaf36e3938f245585360df09f7cd243498efdfa540676ede557909719'
|
7
|
+
data.tar.gz: 979dde8be119435cd6d9ac74cf3ce4ed19df4a9cb85ae6d23441f67b37297d673e868b089804475201189993ad9b0562a429030bacb753e4ea50ee9e15acc3c9
|
data/README.md
CHANGED
@@ -4,6 +4,20 @@ Inspired by ( https://github.com/schneems/puma_worker_killer ). Idea is to run
|
|
4
4
|
separate process as a daemon to measure puma memory and restart worker when memory
|
5
5
|
threshold reached.
|
6
6
|
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'puma_doctor'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install puma_doctor
|
20
|
+
|
7
21
|
## Usage
|
8
22
|
|
9
23
|
### Running from ruby code.
|
@@ -65,21 +79,6 @@ Available options with defaults:
|
|
65
79
|
|
66
80
|
You can always see what `puma_doctor` is doing by reading logs.
|
67
81
|
|
68
|
-
|
69
|
-
## Installation
|
70
|
-
|
71
|
-
Add this line to your application's Gemfile:
|
72
|
-
|
73
|
-
gem 'puma_doctor'
|
74
|
-
|
75
|
-
And then execute:
|
76
|
-
|
77
|
-
$ bundle
|
78
|
-
|
79
|
-
Or install it yourself as:
|
80
|
-
|
81
|
-
$ gem install puma_doctor
|
82
|
-
|
83
82
|
## TODO
|
84
83
|
|
85
84
|
Test
|
@@ -13,11 +13,7 @@ namespace :puma_doctor do
|
|
13
13
|
desc 'Config daemon. Generate and send puma_doctor.rb'
|
14
14
|
task :config do
|
15
15
|
on roles(:app), in: :sequence, wait: 5 do
|
16
|
-
|
17
|
-
if File.file?(path)
|
18
|
-
erb = File.read(path)
|
19
|
-
upload! StringIO.new(ERB.new(erb).result(binding)), fetch(:puma_doctor_daemon_file)
|
20
|
-
end
|
16
|
+
config
|
21
17
|
end
|
22
18
|
end
|
23
19
|
|
@@ -25,7 +21,7 @@ namespace :puma_doctor do
|
|
25
21
|
task :start do
|
26
22
|
on roles(:app), in: :sequence, wait: 5 do
|
27
23
|
within release_path do
|
28
|
-
|
24
|
+
config
|
29
25
|
execute :bundle, :exec, :ruby, fetch(:puma_doctor_daemon_file), 'start'
|
30
26
|
end
|
31
27
|
end
|
@@ -35,7 +31,7 @@ namespace :puma_doctor do
|
|
35
31
|
task :stop do
|
36
32
|
on roles(:app), in: :sequence, wait: 5 do
|
37
33
|
within release_path do
|
38
|
-
|
34
|
+
config
|
39
35
|
execute :bundle, :exec, :ruby, fetch(:puma_doctor_daemon_file), 'stop'
|
40
36
|
end
|
41
37
|
end
|
@@ -45,7 +41,7 @@ namespace :puma_doctor do
|
|
45
41
|
task :restart do
|
46
42
|
on roles(:app), in: :sequence, wait: 5 do
|
47
43
|
within release_path do
|
48
|
-
|
44
|
+
config
|
49
45
|
execute :bundle, :exec, :ruby, fetch(:puma_doctor_daemon_file), 'restart'
|
50
46
|
end
|
51
47
|
end
|
@@ -54,9 +50,17 @@ namespace :puma_doctor do
|
|
54
50
|
desc 'Check if config file exixts on server. If not - create and upload one.'
|
55
51
|
task :check do
|
56
52
|
on roles(:app), in: :sequence, wait: 5 do
|
57
|
-
|
53
|
+
config unless test "[ -f #{fetch(:puma_doctor_daemon_file)} ]"
|
58
54
|
end
|
59
55
|
end
|
60
56
|
|
61
57
|
after 'deploy:finished', 'puma_doctor:restart'
|
58
|
+
|
59
|
+
def config
|
60
|
+
path = File.expand_path("../daemon_template.rb.erb", __FILE__)
|
61
|
+
if File.file?(path)
|
62
|
+
erb = File.read(path)
|
63
|
+
upload! StringIO.new(ERB.new(erb).result(binding)), fetch(:puma_doctor_daemon_file)
|
64
|
+
end
|
65
|
+
end
|
62
66
|
end
|
data/lib/puma_doctor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puma_doctor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Krasynskyi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|
@@ -104,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
|
-
|
108
|
-
rubygems_version: 2.2.0
|
107
|
+
rubygems_version: 3.0.1
|
109
108
|
signing_key:
|
110
109
|
specification_version: 4
|
111
110
|
summary: Process to keep your puma workers healthy.
|