Package network_monitor_udp :: Module linktest :: Class UdpmonsourceHandle
[frames] | no frames]

Class UdpmonsourceHandle

source code

This class maintains a handle to a udpmonsourcenode.py action server. It is used to create link tests that have as source a particular udpmonsourcenode.py node.

Instance Methods
 
__init__(self, action_name="performance_test")
Creates an actionlib.ActionClient object and waits for connection to the action server.
source code
 
create_test(self, name=None, **kwargs)
Creates and returns a link test.
source code
 
cancel_all_tests(self)
Cancels all currently running tests.
source code
 
get_link_capacity(self, **kwargs)
This is a convenience function that creates an adaptive bandwidth test in order to saturate and determine a link's capacity.
source code
Method Details

__init__(self, action_name="performance_test")
(Constructor)

source code 

Creates an actionlib.ActionClient object and waits for connection to the action server.

Parameters:
  • action_name (str) - action server name, by default this is "performance_test", but if the action server lives in a different namespace than the full path should be given (e.g. "/source2/performance_test")
Raises:
  • Exception - if the connection does not succeed

create_test(self, name=None, **kwargs)

source code 

Creates and returns a link test. The link test will need to be started with its start() function.

Parameters:
  • name (str) - an optional test name. This name will be used for log mesages.
  • kwargs (dict) - a dictionary of test parameters. These are the .action file parameters. See the wiki page at http://www.ros.org/wiki/network_monitor_udp for a full description.

cancel_all_tests(self)

source code 

Cancels all currently running tests. As a precaution, this function should be called at the beginning of any test "session" as there may be orphan link tests still being run from the udpmonsourcenode.py node, if that node has not been restarted.

get_link_capacity(self, **kwargs)

source code 

This is a convenience function that creates an adaptive bandwidth test in order to saturate
and determine a link's capacity. By default, the parameters of the test are

- one-way test (not roundtrip)
- uses ROS for return path instead of UDP
- update_interval: 0.2 seconds
- packet loss threshold: 0.5%
- latency threshold: 30ms
- initial bandwidth: 0.5Mbit/s
- maximum duration: 30 seconds

This function should return faster than the specified timeout if the conditions for link saturation
are fulfilled (i.e. it hits a bandwidth ceiling for a specified period of time). 

@type kwargs: dict
@param kwargs: a list of test parameters

@rtype: float
@return: the link capacity if it could be determined or 0.0, otherwise.