|
Cade Royal CSCE 412 Project 3
|
Main file for testing the LoadBalancer class. More...
#include "LoadBalancer.h"#include <iostream>#include <chrono>#include <thread>#include <string>#include <mutex>
Functions | |
| std::string | makeRandomIP () |
| Generates a random IP address in the form of a string. | |
| int | main (int argc, char *argv[]) |
| Main function that starts the LoadBalancer and simulates sending requests. | |
Variables | |
| std::mutex | coutMutex_ |
Main file for testing the LoadBalancer class.
This file initializes a LoadBalancer instance with a specified number of web servers and simulates sending requests over a number of cycles.
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Main function that starts the LoadBalancer and simulates sending requests.
The program accepts two command-line arguments:
-s: Specifies the number of web servers to initialize.-c: Specifies the number of cycles to run the simulation for.The LoadBalancer processes requests over a number of cycles, periodically evaluating the number of active web servers based on the queue size and request load.
| argc | Number of command-line arguments. |
| argv | Array of command-line argument strings. |
| std::string makeRandomIP | ( | ) |
Generates a random IP address in the form of a string.
The IP address consists of four random integers between 0 and 255.
| std::mutex coutMutex_ |