-
Notifications
You must be signed in to change notification settings - Fork 0
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
ce67342
commit 1854f7c
Showing
5 changed files
with
44 additions
and
12 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
|
||
import subprocess | ||
|
||
|
||
# ?run_ab | ||
def run_ab(url: str): | ||
# http://127.0.0.1:8000/pets/ | ||
# Run the ab command with the specified parameters and capture the output | ||
process = subprocess.Popen( | ||
["./ab.exe", "-c 10", "-n 20", f"{url}"], | ||
stdout=subprocess.PIPE, | ||
universal_newlines=True, | ||
) | ||
# Wait for the process to finish and get the output | ||
output, _ = process.communicate() | ||
|
||
# Print the output | ||
print("AB result is ", output) | ||
|
||
|
||
run_ab("http://127.0.0.1:8000/pets/") |
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