Skip to content

Commit

Permalink
Up percentage limits and actually check them by rm'ing constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Wout Feys committed Oct 8, 2024
1 parent 6f2205e commit 765e2bf
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions benchmarks/starlette_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import sys
import time

CURRENT_ACCEPTABLE_PERCENTAGE = 55


def generate_wrk_command_for_url(url):
# Define the command with awk included
return "wrk -t12 -c400 -d15s " + url
Expand Down Expand Up @@ -62,17 +59,17 @@ def run_benchmark(route1, route2, descriptor, percentage_limit, ms_limit):
print(
f"-> {delay_percentage}% decrease in throughput after running load test on {descriptor} \n"
)
if delay_percentage > CURRENT_ACCEPTABLE_PERCENTAGE:
if delay_percentage > percentage_limit:
sys.exit(1)

# Run benchmarks :
run_benchmark(
"http://localhost:8102/delayed_route",
"http://localhost:8103/delayed_route",
"a non empty route which makes a simulated request to a database",
percentage_limit=10, ms_limit=20
percentage_limit=15, ms_limit=20
)
run_benchmark(
"http://localhost:8102/just", "http://localhost:8103/just", "an empty route",
percentage_limit=15, ms_limit=25
percentage_limit=30, ms_limit=25
)

0 comments on commit 765e2bf

Please sign in to comment.