Révision 17f78427
Whitespace cleanup
- remove trailing whitespace
- remove empty lines at the end of files
| plugins/passenger/passenger_status | ||
|---|---|---|
| 1 | 1 |
#!/usr/bin/env ruby |
| 2 |
|
|
| 2 |
|
|
| 3 | 3 |
def output_config |
| 4 | 4 |
puts <<-END |
| 5 | 5 |
graph_category webserver |
| ... | ... | |
| 24 | 24 |
END |
| 25 | 25 |
exit 0 |
| 26 | 26 |
end |
| 27 |
|
|
| 27 |
|
|
| 28 | 28 |
def output_values |
| 29 | 29 |
status = `sudo passenger-status` |
| 30 | 30 |
unless $?.success? |
| ... | ... | |
| 33 | 33 |
end |
| 34 | 34 |
status =~ /max\s+=\s+(\d+)/ |
| 35 | 35 |
puts "max.value #{$1}"
|
| 36 |
|
|
| 36 |
|
|
| 37 | 37 |
status =~ /count\s+=\s+(\d+)/ |
| 38 | 38 |
puts "running.value #{$1}"
|
| 39 |
|
|
| 39 |
|
|
| 40 | 40 |
status =~ /active\s+=\s+(\d+)/ |
| 41 | 41 |
puts "active.value #{$1}"
|
| 42 |
|
|
| 42 |
|
|
| 43 | 43 |
status =~ /Waiting on global queue:\s+(\d+)/ |
| 44 | 44 |
puts "waiting.value #{$1}"
|
| 45 | 45 |
|
| ... | ... | |
| 47 | 47 |
status.scan(/Sessions: (\d+)/).flatten.each { |count| total_sessions += count.to_i }
|
| 48 | 48 |
puts "sessions.value #{total_sessions}"
|
| 49 | 49 |
end |
| 50 |
|
|
| 50 |
|
|
| 51 | 51 |
if ARGV[0] == "config" |
| 52 | 52 |
output_config |
| 53 | 53 |
else |
Formats disponibles : Unified diff