Class: TyrantManager::Commands::ProcessStatus

Inherits:
TyrantManager::Command show all
Defined in:
lib/tyrant_manager/commands/status.rb

Overview

Report the status of one ore more tyrant intances

Instance Attribute Summary

Attributes inherited from TyrantManager::Command

#manager, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TyrantManager::Command

#after, #before, #command_name, #error, find, inherited, #initialize, list, #logger

Constructor Details

This class inherits a constructor from TyrantManager::Command

Class Method Details

.command_nameObject



13
14
15
# File 'lib/tyrant_manager/commands/status.rb', line 13

def self.command_name
  'process-status'
end

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
25
# File 'lib/tyrant_manager/commands/status.rb', line 17

def run
  manager.each_instance( options['instances'] ) do |instance|
    if instance.running? then
      logger.info "#{instance.name} is running as pid #{instance.pid}"
    else
      logger.info "#{instance.name} is not running, or its pid file is gone"
    end
  end
end