Updated benchmark

This commit is contained in:
nik012003
2022-06-26 02:12:57 +02:00
committed by DomySh
parent 67f04cc8dc
commit a3e9dd3269
6 changed files with 40 additions and 154 deletions

View File

@@ -29,23 +29,25 @@ The testing methodology will soon be updated with more edge-cases.
# Running a Benchmark
./benchmark.py
options:
-h, --help show this help message and exit
--address ADDRESS, -a ADDRESS
Address of firegex backend
--service_port SERVICE_PORT, -P SERVICE_PORT
Port of the Benchmark service
--service_name SERVICE_NAME, -n SERVICE_NAME
Name of the Benchmark service
--password PASSWORD, -p PASSWORD
Firegex password
--num_of_regexes NUM_OF_REGEXES, -r NUM_OF_REGEXES
Number of regexes to benchmark with
--duration DURATION, -d DURATION
Duration of the Benchmark in seconds
--output_file OUTPUT_FILE, -o OUTPUT_FILE
Output results csv file
--address ADDRESS, -a ADDRESS
Address of firegex backend
--service_port SERVICE_PORT, -P SERVICE_PORT
Port of the Benchmark service
--service_name SERVICE_NAME, -n SERVICE_NAME
Name of the Benchmark service
--password PASSWORD, -p PASSWORD
Firegex password
--num_of_regexes NUM_OF_REGEXES, -r NUM_OF_REGEXES
Number of regexes to benchmark with
--duration DURATION, -d DURATION
Duration of the Benchmark in seconds
--output_file OUTPUT_FILE, -o OUTPUT_FILE
Output results csv file
--num_of_streams NUM_OF_STREAMS, -s NUM_OF_STREAMS
Output results csv file
--new_istance, -i Create a new service
Benchmarks let you evaluate the performance of the proxy. You can run one by typing in a shell ```test.py -p FIREGEX_PASSWORD -r NUM_OF_REGEX -d BENCHMARK_DURATION```.
Benchmarks let you evaluate the performance of the proxy. You can run one by typing in a shell ```test.py -p FIREGEX_PASSWORD -r NUM_OF_REGEX -d BENCHMARK_DURATION -i```.
It uses iperf3 to benchmark the throughput in MB/s of the server, both with proxy, without proxy, and for each new added regex. It will automatically add a new random regex untill it has reached NUM_OF_REGEX specified in the arguments.

View File

@@ -22,7 +22,7 @@ def puts(text, *args, color=colors.white, is_bold=False, **kwargs):
def sep(): puts("-----------------------------------", is_bold=True)
parser = argparse.ArgumentParser()
parser.add_argument("--address", "-a", type=str , required=False, help='Address of firegex backend', default="http://127.0.0.1:5000/")
parser.add_argument("--address", "-a", type=str , required=False, help='Address of firegex backend', default="http://127.0.0.1:4444/")
parser.add_argument("--service_port", "-P", type=int , required=False, help='Port of the Benchmark service', default=1337)
parser.add_argument("--service_name", "-n", type=str , required=False, help='Name of the Benchmark service', default="Benchmark Service")
parser.add_argument("--password", "-p", type=str, required=True, help='Firegex password')
@@ -127,4 +127,4 @@ if args.new_istance:
assert req.json()["status"] == "ok", f"Benchmark Failed: Couldn't delete service {req.text}"
puts(f"Sucessfully delete service with id {service_id}", color=colors.green)
server.terminate()
server.terminate()