-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
271473c
commit 58440d7
Showing
4 changed files
with
56 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import subprocess | ||
import logging | ||
import time | ||
|
||
logging.info("💣 Launching benchmark") | ||
|
||
|
||
def run(url: str, bombardierduration: str): | ||
logging.info("🎯 Initalize environnment") | ||
try: | ||
lagging_server = subprocess.Popen( | ||
["lagging_server", "-w", "4", "-p", "4444"], shell=True, text=True | ||
) | ||
sozu = subprocess.Popen( | ||
["sozu", "start", "-c", "bench.toml"], shell=True, text=True | ||
) | ||
|
||
time.sleep(3) | ||
except subprocess.CalledProcessError as e: | ||
logging.error(f"🚨 Command failed with return code {e.returncode}") | ||
|
||
try: | ||
subprocess.run(["bombardier","-c","400","-d",bombardierduration,url]) | ||
except subprocess.CalledProcessError as e: | ||
logging.error(f"🚨 Failed to run benchmark {e.returncode}") | ||
|
||
logging.info("🪓 Destroy environment") | ||
try: | ||
subprocess.run(["kill", lagging_server.pid.str()], shell=True, text=True) | ||
subprocess.run(["kill", sozu.pid.str()], shell=True, text=True) | ||
except subprocess.CalledProcessError as e: | ||
logging.error(f"🚨 Failed to destroy environnement {e.returncode}") | ||
|
||
|
||
run("https://rsa-2048.sozu.io:8443/api", "2m") | ||
run("https://rsa-4096.sozu.io:8443/api", "2m") | ||
run("https://edcsa.sozu.io:8443/api", "2m") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.