class Resources::Statistics

Public Instance Methods

list() click to toggle source
# File lib/pvdgm-bs-client/resources/statistics.rb, line 5
def list

  filter = Proc.new do | key |
    if options[:all_stats]
      true
    else
      not key =~ /(^cmd-|^max-|^pid|^version|^rusage|^binlog|^id)/
    end
  end

  result = get("beanstalk")
  puts "\nBeanstalk global statistics"
  table = Terminal::Table.new headings: [ 'Key', 'Value' ] do | t |
    result.keys.sort.each do | key |
      next unless filter.call(key)
      t << [ key, result[key] ]
    end
  end
  puts table
  puts
end