[skip ci] Update tasks of locust on benchmark (#12961)

Signed-off-by: wangting0128 <ting.wang@zilliz.com>
This commit is contained in:
wt 2021-12-08 13:35:13 +08:00 committed by GitHub
parent 07548b9709
commit 9435e37bbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,13 +55,15 @@ class MyUser(User):
def locust_executor(host, port, collection_name, connection_type="single", run_params=None):
m = MilvusClient(host=host, port=port, collection_name=collection_name)
MyUser.tasks = {}
# MyUser.tasks = {}
MyUser.op_info = run_params["op_info"]
MyUser.params = {}
tasks = run_params["tasks"]
for op, value in tasks.items():
task = {eval("Tasks." + op): value["weight"]}
MyUser.tasks.update(task)
# task = {eval("Tasks." + op): value["weight"]}
# MyUser.tasks.update(task)
for i in range(int(value["weight"])):
MyUser.tasks.append(eval("Tasks." + op))
MyUser.params[op] = value["params"] if "params" in value else None
logger.info(MyUser.tasks)