84void printUsage(std::ostream& out,
const std::string& program);
void promptForSettings(Config &config, std::istream &in, std::ostream &out)
Asks the user for the main settings, keeping the current value when the answer is blank.
bool validateConfig(const Config &config, std::string &error)
Checks that the settings are consistent.
void printUsage(std::ostream &out, const std::string &program)
Prints the list of command-line options.
bool parseArguments(int argc, char *argv[], Config &config, std::string &error)
Reads command-line options into a Config.
Every user-adjustable setting for one simulation run.
unsigned int queuePerServer
Initial queue size = servers x queuePerServer.
double arrivalRate
Average new requests per cycle.
std::string logPath
File for the run summary (and events in verbose mode).
double lowerFactor
Scale down when queue < lowerFactor x servers.
unsigned int servers
Initial number of web servers.
bool useSwitch
Bonus: route P and S jobs to two load balancers.
unsigned long cycles
Clock cycles to simulate.
unsigned int maxTask
Longest task time, in cycles.
bool verbose
Print every event instead of only status lines.
double waveAmplitude
Traffic wave size, 0 (steady) to 1.
double streamingShare
Fraction of requests that are streaming ('S') jobs.
std::uint32_t seed
Random seed (logged so a run can be repeated).
unsigned int cooldown
Cycles between scaling checks.
unsigned long statusEvery
Cycles between status lines; 0 chooses automatically.
std::size_t maxQueue
Queue capacity; 0 means unlimited.
unsigned int minServers
Lower bound on active servers.
bool color
Use ANSI colors on a terminal.
unsigned long wavePeriod
Cycles per traffic wave; 0 disables the wave.
unsigned int minTask
Shortest task time, in cycles.
bool showHelp
Print usage and exit.
double upperFactor
Scale up when queue > upperFactor x servers.
std::vector< std::string > blockedRanges
Firewall CIDR ranges.
bool interactive
Ask for the main settings on standard input.
bool autoWavePeriod
Use cycles / 4 (four busy/quiet waves) unless –wave-period is given.
unsigned int maxServers
Upper bound on live servers.