Class: FastestServer::LinuxPing

Inherits:
Ping
  • Object
show all
Defined in:
lib/fastest_server/ping.rb

Constant Summary collapse

REGEX_PING =
/PING.*/
REGEX_FILTER =
/\(|\)|:/
REGEX_LOSS =
/(?<loss>\d*)% packet loss/
REGEX_STAT =
/(?<min>\d*.\d*)\/(?<avg>\d*.\d*)\/(?<max>\d*.\d*)\/(?<stddev>\d*.\d*) ms/

Instance Method Summary collapse

Methods inherited from Ping

get_count, #initialize, #method_missing, #parsed, perform, #perform, set_count

Constructor Details

This class inherits a constructor from FastestServer::Ping

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class FastestServer::Ping

Instance Method Details

#execute_ping_commandObject



100
101
102
103
104
# File 'lib/fastest_server/ping.rb', line 100

def execute_ping_command
  result = `ping -c #{Ping.get_count} -q #@server`
  status = $?
  [result, $?]
end