class Platoon

Platoon of robousers.

Inheritance:


Public Methods

[more]void init(Poller* poller, Sked* sked, const char* filename, int maxBytesPerSec, int minBytesPerSec, int bytesPerRead, const char* servername, int port, const char* username, const char* passwd, struct sockaddr_in* local_addrs, int n_local_addrs)
Set up parameters common to all instances of this class, and initialize the container for all instances.
[more]void reset()
Stops any activity.
[more]void set_nuserTarget(int utarget)
Set desired number of simulated users.
[more]void set_nconnectingTarget(int ctarget)
How many simulated users should try to connect at once?
[more]void set_lastConnectingState(robouser_t::state_t s)
What's the last state in which a robouser is considered to be connecting?
[more]long getStatus(int* nconnecting, int* nalive, int* ndead)
Call this periodically to check on status of the clients.
[more]void reap()
Reap any dead users.
[more]void countStateChange(int user, robouser_t::state_t oldstate, robouser_t::state_t newstate)
Update counts on state change.
[more]void skedCallback(clock_t now)
When the time specified by addClient() has elapsed, Sked calls this method.


Documentation

Platoon of robousers.
ovoid init(Poller* poller, Sked* sked, const char* filename, int maxBytesPerSec, int minBytesPerSec, int bytesPerRead, const char* servername, int port, const char* username, const char* passwd, struct sockaddr_in* local_addrs, int n_local_addrs)
Set up parameters common to all instances of this class, and initialize the container for all instances. sked is a pointer to the Sked object to use to schedule delayed actions, and whose runAll() method should be called periodically by main().

filename is what file to fetch from the remote server (will be a template later). maxBytesPerSec sets how much bandwidth each client tries to use. minBytesPerSec is the lowest bandwidth per client we accept (else abort). bytesPerRead sets how many bytes to read each time. servername and port specify the server and port the user will connect to. username and passwd are the user's username and password.

Parameters:
local_addrs - 0, or array of local addresses to assign to users
n_local_addrs - number of elements in local_addrs

ovoid reset()
Stops any activity. After this call, you may call init again.

ovoid set_nuserTarget(int utarget)
Set desired number of simulated users. Platoon will ramp up to this.

ovoid set_nconnectingTarget(int ctarget)
How many simulated users should try to connect at once? Default is 1. Higher values make Platoon ramp up more quickly.

ovoid set_lastConnectingState(robouser_t::state_t s)
What's the last state in which a robouser is considered to be connecting? Default value is robouser_t::CONNECTING (after tcp connection complete). Other possible value is robouser_t::CONNECT (when tcp connection starts). Lower numerical values make Platoon ramp up more quickly.

olong getStatus(int* nconnecting, int* nalive, int* ndead)
Call this periodically to check on status of the clients. nconnecting =  of robousers still trying to connectnalive =  of robousers who connected ok and are in good shapendead =  of robousers who have failed, and are out of action Returns total number of bytes transferred so far.

ovoid reap()
Reap any dead users. Call this after each call to Sked->runAll().

ovoid countStateChange(int user, robouser_t::state_t oldstate, robouser_t::state_t newstate)
Update counts on state change. For robouser use only.

ovoid skedCallback(clock_t now)
When the time specified by addClient() has elapsed, Sked calls this method.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.