module NginxTop
Constants
- REQUESTS
- VERSION
Public Class Methods
bar(status)
click to toggle source
# File lib/nginxtop.rb, line 16 def self.bar(status) n = (IO.console.winsize.last * 0.25 * (( 100 * count(status)/REQUESTS.count))/100).to_i rescue 0 "|" * n end
count(status)
click to toggle source
# File lib/nginxtop.rb, line 12 def self.count(status) REQUESTS.select{ |r| r.status_verb == status }.count end
uptime()
click to toggle source
# File lib/nginxtop.rb, line 21 def self.uptime time_diff = Time.now - Listener::START_TIME Time.at(time_diff.to_i.abs).utc.strftime "%H:%M:%S" end