Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions benchmarks/wrk_benchmark/flask_mysql_uwsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@
"a non empty route which makes a simulated request to a database",
percentage_limit=40
)


run_benchmark(
"http://localhost:8088/benchmark_io",
"http://localhost:8089/benchmark_io",
"a route that makes multiple I/O call",
percentage_limit=1
)
1 change: 1 addition & 0 deletions sample-apps/flask-mysql-uwsgi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
benchmark_temp.txt
4 changes: 2 additions & 2 deletions sample-apps/flask-mysql-uwsgi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ runBenchmark: install
AIKIDO_DEBUG=false AIKIDO_BLOCK=true AIKIDO_TOKEN="AIK_secret_token" \
AIKIDO_REALTIME_ENDPOINT="http://localhost:5000/" \
AIKIDO_ENDPOINT="http://localhost:5000/" AIKIDO_DISABLE=0 \
poetry run uwsgi --ini uwsgi.ini
poetry run uwsgi --single-interpreter --ini uwsgi.ini

.PHONY: runZenDisabled
runZenDisabled: install
@echo "Running sample app flask-mysql-uwsgi without Zen on port 8089"
AIKIDO_DISABLE=1 \
poetry run uwsgi --ini uwsgi2.ini
poetry run uwsgi --single-interpreter --ini uwsgi2.ini
9 changes: 9 additions & 0 deletions sample-apps/flask-mysql-uwsgi/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,14 @@ def benchmark():
return "OK"


@app.route("/benchmark_io", methods=['GET'])
def benchmark_io():
for i in range(50):
with open("benchmark_temp.txt", "w") as f:
f.write("This is a benchmark file.")
with open("benchmark_temp.txt", "r") as f:
content = f.read()
return "OK"

if __name__ == '__main__':
app.run()
Loading