class documentation

class ConnectionStatisticsLogger:

Constructor: ConnectionStatisticsLogger(topic, subscriber, publisher)

View In Hierarchy

Class that monitors lots of stuff for each connection.

is created whenever a subscriber is created. is destroyed whenever its parent subscriber is destroyed. its lifecycle is therefore bound to its parent subscriber.

Method __init__ Constructor.
Method callback This method is called for every message, that is received on this subscriber.
Method sendStatistics Send out statistics. Aggregate collected stats information.
Method shutdown Undocumented
Instance Variable age_list_ Undocumented
Instance Variable arrival_time_list_ Undocumented
Instance Variable dropped_msgs_ Undocumented
Instance Variable last_pub_time Undocumented
Instance Variable last_seq_ Undocumented
Instance Variable pub Undocumented
Instance Variable pub_frequency Undocumented
Instance Variable publisher Undocumented
Instance Variable stat_bytes_last_ Undocumented
Instance Variable stat_bytes_window_ Undocumented
Instance Variable subscriber Undocumented
Instance Variable topic Undocumented
Instance Variable window_start Undocumented
def __init__(self, topic, subscriber, publisher):

Constructor.

@param topic: Name of the topic @param subscriber: Name of the subscriber @param publisher: Name of the publisher

These three should uniquely identify the connection.

def callback(self, subscriber_statistics_logger, msg, stat_bytes):

This method is called for every message, that is received on this subscriber.

this callback will keep some statistics and publish the results periodically on a topic. the publishing should probably be done asynchronically in another thread.

@param msg: The message, that has been received. The message has usually been already deserialized. However this is not always the case. (AnyMsg) @param stat_bytes: A counter, how many bytes have been moved across this connection since it exists.

Any computing-heavy stuff should be done somewhere else, as this callback has to return before the message is delivered to the user.

def sendStatistics(self, subscriber_statistics_logger):

Send out statistics. Aggregate collected stats information.

Currently done blocking. Might be moved to own thread later. But at the moment any computation done here should be rather quick.

def shutdown(self):

Undocumented

age_list_: list =

Undocumented

arrival_time_list_: list =

Undocumented

dropped_msgs_ =

Undocumented

last_pub_time =

Undocumented

last_seq_ =

Undocumented

pub =

Undocumented

pub_frequency =

Undocumented

publisher =

Undocumented

stat_bytes_last_ =

Undocumented

stat_bytes_window_ =

Undocumented

subscriber =

Undocumented

topic =

Undocumented

window_start =

Undocumented