Class: TyrantManager::Commands::Stats
- Inherits:
-
TyrantManager::Command
- Object
- TyrantManager::Command
- TyrantManager::Commands::Stats
- Defined in:
- lib/tyrant_manager/commands/stats.rb
Overview
List the stats about one or more instances
Instance Attribute Summary
Attributes inherited from TyrantManager::Command
Instance Method Summary collapse
Methods inherited from TyrantManager::Command
#after, #before, #command_name, command_name, #error, find, inherited, #initialize, list, #logger
Constructor Details
This class inherits a constructor from TyrantManager::Command
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/tyrant_manager/commands/stats.rb', line 13 def run manager.each_instance( ['instances'] ) do |instance| puts "Instance #{instance.name} at #{instance.home_dir}" stats = instance.stat max_width = stats.keys.collect { |k| k.length }.sort.last + 2 stats.keys.sort.each do |k| lhs = k.ljust(max_width, ".") puts " #{lhs} #{stats[k]}" end puts end end |