puma-status 0.1.3 → 0.1.4
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 +2 -2
- data/lib/stats.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ca2fb63b6be20e85ac281783c213be6227b29a268d98c743ebf5f15c8ce57af
|
4
|
+
data.tar.gz: 6ba41b60919c9271d47e1e1e94e4d3a951b49f413e51a7a85f9a8fc26bce1d5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8233f7045c47ff7172990686b5be21178d0b2df078001ddad38572aeafd8127e2a5d0dc70604f75676a58e59fdcd2139674b2f7aa970e169e2f471b833c9af69
|
7
|
+
data.tar.gz: 0ce03ee787e21a2b5f49a69d4d28089429a0f95fd993dadbb897e90883315c4bc93f2790e3490640362d0cd14c8f982618a8176e7b2111ebb1aca8630655dfe3
|
data/lib/core.rb
CHANGED
@@ -45,12 +45,12 @@ end
|
|
45
45
|
def display_stats(stats)
|
46
46
|
master_line = "#{stats.pid} (#{stats.state_file_path}) Uptime: #{seconds_to_human(stats.uptime)} "
|
47
47
|
master_line += "| Phase: #{stats.phase} " if stats.phase
|
48
|
-
master_line += "| Load: #{color(75, 50, stats.load, asciiThreadLoad(stats.running_threads, stats.
|
48
|
+
master_line += "| Load: #{color(75, 50, stats.load, asciiThreadLoad(stats.running_threads, stats.max_threads))}"
|
49
49
|
|
50
50
|
puts master_line
|
51
51
|
|
52
52
|
stats.workers.each do |wstats|
|
53
|
-
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)} | Load: #{color(75, 50, wstats.load, asciiThreadLoad(wstats.running_threads, wstats.
|
53
|
+
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)} | Load: #{color(75, 50, wstats.load, asciiThreadLoad(wstats.running_threads, wstats.max_threads))}"
|
54
54
|
worker_line += " #{("Queue: " + wstats.backlog.to_s).colorize(:red)}" if wstats.backlog > 0
|
55
55
|
worker_line += " Last checkin: #{wstats.last_checkin}" if wstats.last_checkin >= 10
|
56
56
|
worker_line += " Phase: #{wstats.phase}" if wstats.phase != stats.phase
|
data/lib/stats.rb
CHANGED
@@ -103,6 +103,10 @@ class Stats
|
|
103
103
|
workers.reduce(0) { |total, wstats| total + wstats.running_threads }
|
104
104
|
end
|
105
105
|
|
106
|
+
def max_threads
|
107
|
+
workers.reduce(0) { |total, wstats| total + wstats.max_threads }
|
108
|
+
end
|
109
|
+
|
106
110
|
def running
|
107
111
|
@stats['running'] || 0
|
108
112
|
end
|