puma-status 1.4 → 1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/core.rb +9 -7
- data/lib/helpers.rb +2 -2
- data/lib/puma-status.rb +6 -6
- data/lib/stats.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edca43a85e295ab116159f64a2f938f08ca8bb228d3c9a1858e3e6b1c2af42d5
|
4
|
+
data.tar.gz: ed4e67eef12e37bc463573ab8e1b2e2f7d7b04654e23615ff68461822e2af74e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ac75cb6ba28f5e69856fc93144cd0cd06543281da12654ea15d95e1281b571e6c4caf9d81f466cdd48b21819f4e47f6d205ccffc95130c1a17a55d58ae46f15
|
7
|
+
data.tar.gz: 1ab7b9ee34dd4674bea3398f6d4c69431e4c64cac105d4651bf0f0dcad113223727be6984373b1ee7f8a678c4b91db36ba3f7d117696aac57e39b433582d4cf6
|
data/lib/core.rb
CHANGED
@@ -76,11 +76,13 @@ def hydrate_stats(stats, puma_state, state_file_path)
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def format_stats(stats)
|
79
|
-
master_line = "#{stats.pid} (#{stats.state_file_path})
|
79
|
+
master_line = "#{stats.pid} (#{stats.state_file_path})"
|
80
|
+
master_line += " Version: #{stats.version} |" if stats.version
|
81
|
+
master_line += " Uptime: #{seconds_to_human(stats.uptime)}"
|
80
82
|
master_line += " | Phase: #{stats.phase}" if stats.phase
|
81
83
|
|
82
84
|
if stats.booting?
|
83
|
-
master_line += " #{
|
85
|
+
master_line += " #{yellow("booting")}"
|
84
86
|
else
|
85
87
|
master_line += " | Load: #{color(75, 50, stats.load, asciiThreadLoad(stats.running_threads, stats.spawned_threads, stats.max_threads))}"
|
86
88
|
master_line += " | Req: #{stats.requests_count}" if stats.requests_count
|
@@ -90,15 +92,15 @@ def format_stats(stats)
|
|
90
92
|
worker_line = " └ #{wstats.pid.to_s.rjust(5, ' ')} CPU: #{color(75, 50, wstats.pcpu, wstats.pcpu.to_s.rjust(5, ' '))}% Mem: #{color(1000, 750, wstats.mem, wstats.mem.to_s.rjust(4, ' '))} MB Uptime: #{seconds_to_human(wstats.uptime)}"
|
91
93
|
|
92
94
|
if wstats.booting?
|
93
|
-
worker_line += " #{
|
95
|
+
worker_line += " #{yellow("booting")}"
|
94
96
|
elsif wstats.killed?
|
95
|
-
worker_line += " #{
|
97
|
+
worker_line += " #{red("killed")}"
|
96
98
|
else
|
97
99
|
worker_line += " | Load: #{color(75, 50, wstats.load, asciiThreadLoad(wstats.running_threads, wstats.spawned_threads, wstats.max_threads))}"
|
98
|
-
worker_line += " | Phase: #{
|
100
|
+
worker_line += " | Phase: #{red(wstats.phase)}" if wstats.phase != stats.phase
|
99
101
|
worker_line += " | Req: #{wstats.requests_count}" if wstats.requests_count
|
100
|
-
worker_line += " Queue: #{
|
101
|
-
worker_line += " Last checkin: #{
|
102
|
+
worker_line += " Queue: #{red(wstats.backlog.to_s)}" if wstats.backlog > 0
|
103
|
+
worker_line += " Last checkin: #{red(wstats.last_checkin)}" if wstats.last_checkin >= 10
|
102
104
|
end
|
103
105
|
|
104
106
|
worker_line
|
data/lib/helpers.rb
CHANGED
data/lib/puma-status.rb
CHANGED
@@ -19,22 +19,22 @@ def run
|
|
19
19
|
format_stats(get_stats(state_file_path))
|
20
20
|
rescue Errno::ENOENT => e
|
21
21
|
if e.message =~ /#{state_file_path}/
|
22
|
-
errors << "#{
|
22
|
+
errors << "#{yellow(state_file_path)} doesn't exists"
|
23
23
|
elsif e.message =~ /connect\(2\) for [^\/]/
|
24
|
-
errors << "#{
|
24
|
+
errors << "#{yellow("Relative Unix socket")}: the Unix socket of the control app has a relative path. Please, ensure you are running from the same folder has puma."
|
25
25
|
else
|
26
|
-
errors << "#{
|
26
|
+
errors << "#{red(state_file_path)} an unhandled error occured: #{e.inspect}"
|
27
27
|
end
|
28
28
|
nil
|
29
29
|
rescue Errno::EISDIR => e
|
30
30
|
if e.message =~ /#{state_file_path}/
|
31
|
-
errors << "#{
|
31
|
+
errors << "#{yellow(state_file_path)} isn't a state file"
|
32
32
|
else
|
33
|
-
errors << "#{
|
33
|
+
errors << "#{red(state_file_path)} an unhandled error occured: #{e.inspect}"
|
34
34
|
end
|
35
35
|
nil
|
36
36
|
rescue => e
|
37
|
-
errors << "#{
|
37
|
+
errors << "#{red(state_file_path)} an unhandled error occured: #{e.inspect}"
|
38
38
|
nil
|
39
39
|
end
|
40
40
|
end
|
data/lib/stats.rb
CHANGED
@@ -154,4 +154,10 @@ class Stats
|
|
154
154
|
def load
|
155
155
|
running_threads/total_threads.to_f*100
|
156
156
|
end
|
157
|
+
|
158
|
+
def version
|
159
|
+
return nil unless @stats.key?('versions')
|
160
|
+
|
161
|
+
"#{@stats['versions']['puma']}/#{@stats['versions']['ruby']['engine']}#{@stats['versions']['ruby']['version']}p#{@stats['versions']['ruby']['patchlevel']}"
|
162
|
+
end
|
157
163
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puma-status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoann Lecuyer
|
@@ -119,14 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
119
|
requirements:
|
120
120
|
- - ">="
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: 2.
|
122
|
+
version: 2.5.0
|
123
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
124
|
requirements:
|
125
125
|
- - ">="
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
|
-
rubygems_version: 3.0.
|
129
|
+
rubygems_version: 3.4.0.dev
|
130
130
|
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: Command-line tool for puma to display information about running request/process
|