Module satellite :: Class Satellite
[show private | hide private]
[frames | no frames]

Class Satellite


represents a co2 satellite host. has it's own proxy to call methods on the satellite, and holds various statistical data as instance variables.
Method Summary
  __init__(self, host_id, addr, notify_pass, debug_method, nick, plugins)
  __repr__(self)
  __str__(self)
float get_ctime(self)
get creation time (= registration time).
  get_dump_data(self)
dictionary get_props(self)
get the satellite's properties.
dictionary, format: 'host_id':string, the satellites ID; 'addr': tuple, the satellite's address; 'plugins': list, loaded plugins; 'ctime': iso8601 DateTime, timestamp of registration (creation); 'recv_time': iso8601 DateTime, timestamp of most recent receive; 'recv_count': int, number of messages received; 'send_time': iso8601 DateTime, timestamp of most recent send; 'send_count': int, number of messages sent; 'ping_fails': int, number of currently unanswered pings, reset to 0 on successful ping; 'ping_current': float, most recent ping delay; 'ping_min': float, minimum ping time; 'ping_max': float, maximum ping time; 'ping_avg': float, average ping time; 'ping_count': int, number of successfull pings get_status(self)
get the satellites status, as known to the relay.
  get_status_raw(self)
int inc_ping_fails(self)
increment the counter for failed pings by one.
  notify(self, param_dict)
calls the satellites notify method, calls Satellite.touch_recv_time.
  notify_thread(self, param_dict)
notify calls are threaded, so a lame satellite or a bad connection don't hurt the relay.
  set_ping_current(self, dt)
set the value of the latest successful ping request, increment the ping counter by one, calculate the new ping average, set counter for failed pings to 0.
  set_props(self, props_dict)
set the satellite's properties.
  touch_recv_time(self)
updates self.recv_time, called whenever a notify-call goes out through self.proxy, and increments self.recv_count by one.
  touch_send_time(self)
updates self.send_time, called whenever a relay-call comes in from that satellite, and increments self.send_count by one.

Class Variable Summary
tuple __props__

Method Details

__init__(self, host_id, addr, notify_pass, debug_method, nick='', plugins=[])
(Constructor)

Parameters:
host_id - the satellite's ID
           (type=string)
addr - the address of the satellite
           (type=tuple (<host>, <port>))
notify_pass - relay/notify "password"
           (type=string)
debug_method - the global debug method
           (type=method object)
nick - optional nickname
           (type=string)
plugins - optional plugin names (loaded by the satellite)
           (type=list of strings)

get_ctime(self)

get creation time (= registration time).
Returns:
timestamp of creation (=registration), seconds since epoche
           (type=float)

get_props(self)

get the satellite's properties.
Returns:
properties
           (type=dictionary)

get_status(self)

get the satellites status, as known to the relay.
Returns:
various data about this satellite
           (type=dictionary, format: 'host_id':string, the satellites ID; 'addr': tuple, the satellite's address; 'plugins': list, loaded plugins; 'ctime': iso8601 DateTime, timestamp of registration (creation); 'recv_time': iso8601 DateTime, timestamp of most recent receive; 'recv_count': int, number of messages received; 'send_time': iso8601 DateTime, timestamp of most recent send; 'send_count': int, number of messages sent; 'ping_fails': int, number of currently unanswered pings, reset to 0 on successful ping; 'ping_current': float, most recent ping delay; 'ping_min': float, minimum ping time; 'ping_max': float, maximum ping time; 'ping_avg': float, average ping time; 'ping_count': int, number of successfull pings)

inc_ping_fails(self)

increment the counter for failed pings by one. called by pinger.Pinger when a ping request raises an exception or is not returned within client.Co2Proxy's sockettimeout.
Returns:
the updated number of failed pings
           (type=int)

notify(self, param_dict)

calls the satellites notify method, calls Satellite.touch_recv_time.
Parameters:
param_dict - data to be relayed
           (type=dictionary)

notify_thread(self, param_dict)

notify calls are threaded, so a lame satellite or a bad connection don't hurt the relay. called by Satellite.notify.
Parameters:
param_dict - data to be relayed, simply passed on)

set_ping_current(self, dt)

set the value of the latest successful ping request, increment the ping counter by one, calculate the new ping average, set counter for failed pings to 0.
Parameters:
dt - pingtime
           (type=float)

set_props(self, props_dict)

set the satellite's properties.
Parameters:
props_dict - property data
           (type=dictionary, keys must match Satellite.__props__)

touch_recv_time(self)

updates self.recv_time, called whenever a notify-call goes out through self.proxy, and increments self.recv_count by one.

touch_send_time(self)

updates self.send_time, called whenever a relay-call comes in from that satellite, and increments self.send_count by one.

Class Variable Details

__props__

Type:
tuple
Value:
('host_id',
 'nick',
 'addr',
 'ctime',
 'recv_time',
 'send_time',
 'recv_count',
 'recv_count',
...                                                                    

Generated by Epydoc 1.1 on Thu Oct 16 16:37:23 2003 http://epydoc.sf.net