puma-status 1.5 → 1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e70794f8cca6fe403afd55f48122c046b0670e7244b0dcad9a50d860c557c69
4
- data.tar.gz: 5cbbbc03d2744a5ac27c2ca8472d3fdaf7940c21caf74327e5fb78b239427287
3
+ metadata.gz: edca43a85e295ab116159f64a2f938f08ca8bb228d3c9a1858e3e6b1c2af42d5
4
+ data.tar.gz: ed4e67eef12e37bc463573ab8e1b2e2f7d7b04654e23615ff68461822e2af74e
5
5
  SHA512:
6
- metadata.gz: 59c577ff899812624b466c06b539a25b4bc4d2cf476909525efe70e5e0ef57e0f12ebb9fe4b632600dba05e8149b6a05b6fc2680fe7d4801c19faca5d81ed5b9
7
- data.tar.gz: 61268ccb302fd12a882a9d2308702e471814fed48308ff3de109501e8bcade6b0b3d7b1c7edfec1191093f477c389f710c8416cfa9886aa00eac803e1f1a2792
6
+ metadata.gz: 0ac75cb6ba28f5e69856fc93144cd0cd06543281da12654ea15d95e1281b571e6c4caf9d81f466cdd48b21819f4e47f6d205ccffc95130c1a17a55d58ae46f15
7
+ data.tar.gz: 1ab7b9ee34dd4674bea3398f6d4c69431e4c64cac105d4651bf0f0dcad113223727be6984373b1ee7f8a678c4b91db36ba3f7d117696aac57e39b433582d4cf6
data/lib/core.rb CHANGED
@@ -82,7 +82,7 @@ def format_stats(stats)
82
82
  master_line += " | Phase: #{stats.phase}" if stats.phase
83
83
 
84
84
  if stats.booting?
85
- master_line += " #{warn("booting")}"
85
+ master_line += " #{yellow("booting")}"
86
86
  else
87
87
  master_line += " | Load: #{color(75, 50, stats.load, asciiThreadLoad(stats.running_threads, stats.spawned_threads, stats.max_threads))}"
88
88
  master_line += " | Req: #{stats.requests_count}" if stats.requests_count
@@ -92,15 +92,15 @@ def format_stats(stats)
92
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)}"
93
93
 
94
94
  if wstats.booting?
95
- worker_line += " #{warn("booting")}"
95
+ worker_line += " #{yellow("booting")}"
96
96
  elsif wstats.killed?
97
- worker_line += " #{error("killed")}"
97
+ worker_line += " #{red("killed")}"
98
98
  else
99
99
  worker_line += " | Load: #{color(75, 50, wstats.load, asciiThreadLoad(wstats.running_threads, wstats.spawned_threads, wstats.max_threads))}"
100
- worker_line += " | Phase: #{error(wstats.phase)}" if wstats.phase != stats.phase
100
+ worker_line += " | Phase: #{red(wstats.phase)}" if wstats.phase != stats.phase
101
101
  worker_line += " | Req: #{wstats.requests_count}" if wstats.requests_count
102
- worker_line += " Queue: #{error(wstats.backlog.to_s)}" if wstats.backlog > 0
103
- worker_line += " Last checkin: #{error(wstats.last_checkin)}" if wstats.last_checkin >= 10
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
104
104
  end
105
105
 
106
106
  worker_line
data/lib/helpers.rb CHANGED
@@ -4,11 +4,11 @@ def debug(str)
4
4
  puts str if ENV.key?('DEBUG')
5
5
  end
6
6
 
7
- def warn(str)
7
+ def yellow(str)
8
8
  colorize(str, :yellow)
9
9
  end
10
10
 
11
- def error(str)
11
+ def red(str)
12
12
  colorize(str, :red)
13
13
  end
14
14
 
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 << "#{warn(state_file_path)} doesn't exists"
22
+ errors << "#{yellow(state_file_path)} doesn't exists"
23
23
  elsif e.message =~ /connect\(2\) for [^\/]/
24
- errors << "#{warn("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."
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 << "#{error(state_file_path)} an unhandled error occured: #{e.inspect}"
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 << "#{warn(state_file_path)} isn't a state file"
31
+ errors << "#{yellow(state_file_path)} isn't a state file"
32
32
  else
33
- errors << "#{error(state_file_path)} an unhandled error occured: #{e.inspect}"
33
+ errors << "#{red(state_file_path)} an unhandled error occured: #{e.inspect}"
34
34
  end
35
35
  nil
36
36
  rescue => e
37
- errors << "#{error(state_file_path)} an unhandled error occured: #{e.inspect}"
37
+ errors << "#{red(state_file_path)} an unhandled error occured: #{e.inspect}"
38
38
  nil
39
39
  end
40
40
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma-status
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.5'
4
+ version: '1.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoann Lecuyer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2019-07-14 00:00:00.000000000 Z
@@ -94,8 +94,8 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.9'
97
- description:
98
- email:
97
+ description:
98
+ email:
99
99
  executables:
100
100
  - puma-status
101
101
  extensions: []
@@ -111,7 +111,7 @@ homepage: https://github.com/ylecuyer/puma-status
111
111
  licenses:
112
112
  - MIT
113
113
  metadata: {}
114
- post_install_message:
114
+ post_install_message:
115
115
  rdoc_options: []
116
116
  require_paths:
117
117
  - lib
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  requirements: []
129
129
  rubygems_version: 3.4.0.dev
130
- signing_key:
130
+ signing_key:
131
131
  specification_version: 4
132
132
  summary: Command-line tool for puma to display information about running request/process
133
133
  test_files: []