-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload
More file actions
executable file
·44 lines (32 loc) · 899 Bytes
/
load
File metadata and controls
executable file
·44 lines (32 loc) · 899 Bytes
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os.path import realpath, dirname, join
from logging import basicConfig, info, INFO
from argparse import ArgumentParser
from subprocess import check_call
from requests import get, post
WORKDIR = realpath(dirname(__file__))
basicConfig(level=INFO, format='[%(levelname)s] %(message)s')
def parse():
parser = ArgumentParser()
parser.add_argument("--host", default="http://mystuff")
parser.add_argument("--users", default="50")
parser.add_argument("--spawn-rate", default="10")
return parser.parse_args()
def main():
args = parse()
cmd = [
"locust",
"-f",
f"{WORKDIR}/loadtest/locustfile.py",
"--host",
args.host,
"--headless",
"-u",
args.users,
"-r",
args.spawn_rate
]
check_call(cmd)
if __name__ == "__main__":
main()