This Page

backend.agent — Base agent class and support classes

class backend.agent.AddressPool(nodename=None, fakelist=None)

Represents a list of IP address to be used by clients. Currently all selection is random through all of the address groups but other methods could be added

Random()

Pick a random tuple from the pool and return a random portion of one its address ranges

RandomNode()

Pick a random node from the pool and return the node name portion

Set(node, ranges)

Expecting ‘nodename’, [CIDR, CIDR, ...]

class backend.agent.Agent

Agent class that provides all of the variable receiving logic as well as some helper functions for common cases

TGStart()

Provides a method to handle start for traffic generation agents that make use of the clients and servers variables, functions serverExec and launchTrafficController() are called for you. serverExec() is a blank method, launchTrafficController() has an implementation already.

TGStop()

The answer to TGStart(), this method is used to handle stop events for traffic generation agents that use clients and servers, serverStop() and killing of processes in self.pids are called for you.

clientExec(src, dst, size)

Blank implementation

clientInit()

Blank implementation

clientOneLoop(spool, dpool, think, sizes)

This provides an internal point to override just the loop behaviour, it retrieves random source and address values from the address pools, calls clientExec() and then waits for think time.

configDone()
getNodeTable(key)

Get the values for all nodes listed under the key

getNodeVar(key, node)

Specific call for a node var, can be used to get var for another node besides our own

launchTrafficController()

The default launcher called from TGStart(), it will fork off a new session leader process that uses the servers, think and sizes variables to launch clients. It will call clientOneLoop() repeatedly to start client processes. A simple implementation of clientOneLoop() is already provided.

processArgs(args)

Insert all of the variables, verifying/converting each

serverExec()

Blank implementation

serverStop()

Blank implementation