-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrun_locust_tests.py
63 lines (54 loc) · 1.72 KB
/
run_locust_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import subprocess
import traceback
def run_locust_test(script_name):
try:
command = [
"locust",
"-f", script_name,
"--headless",
"-u", "20",
"-r", "20",
"-H", "https://litellm-stable-release-service.onrender.com/",
"-t", "100",
"--csv", "load_test"
]
subprocess.run(command, check=True)
except subprocess.CalledProcessError as e:
print(e)
print(traceback.format_exc())
except Exception as e:
print(e)
print(traceback.format_exc())
def run_failed_responses_chat_completion():
run_locust_test("failed_responses.py")
def run_all_cache_hits_locust_test():
run_locust_test("all_cache_hits.py")
def run_no_cache_hits_locust_test():
run_locust_test("no_cache_hits.py")
def run_cache_off_locust_test():
run_locust_test("no_cache.py")
def run_large_user_locust_test(script_name):
try:
command = [
"locust",
"-f", script_name,
"--headless",
"-u", "100",
"-r", "100",
"-H", "https://litellm-stable-release-service.onrender.com/",
"-t", "100",
"--csv", "load_test"
]
subprocess.run(command, check=True)
except subprocess.CalledProcessError as e:
print(e)
print(traceback.format_exc())
except Exception as e:
print(e)
print(traceback.format_exc())
def run_large_all_cache_hits_locust_test():
run_large_user_locust_test("all_cache_hits.py")
def run_large_no_cache_hits_locust_test():
run_large_user_locust_test("no_cache_hits.py")
def run_large_cache_off_locust_test():
run_large_user_locust_test("no_cache.py")