[skip ci] Add guarantee_timestamp to insert_search_performance templet on benchmark (#12852)

Signed-off-by: wangting0128 <ting.wang@zilliz.com>
pull/12877/head
wt 2021-12-07 14:28:48 +08:00 committed by GitHub
parent f28094801c
commit 25b2aa4597
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -140,6 +140,7 @@ class InsertSearchRunner(BaseRunner):
run_count = collection["run_count"]
top_ks = collection["top_ks"]
nqs = collection["nqs"]
guarantee_timestamp = collection["guarantee_timestamp"] if "guarantee_timestamp" in collection else None
other_fields = collection["other_fields"] if "other_fields" in collection else None
filters = collection["filters"] if "filters" in collection else []
filter_query = []
@ -197,7 +198,8 @@ class InsertSearchRunner(BaseRunner):
"nq": nq,
"topk": top_k,
"search_param": search_param,
"filter": filter_query
"filter": filter_query,
"guarantee_timestamp": guarantee_timestamp
}
vector_query = {"vector": {index_field_name: search_info}}
case = {
@ -216,6 +218,7 @@ class InsertSearchRunner(BaseRunner):
"run_count": run_count,
"filter_query": filter_query,
"vector_query": vector_query,
"guarantee_timestamp": guarantee_timestamp
}
cases.append(case)
case_metrics.append(case_metric)
@ -282,7 +285,8 @@ class InsertSearchRunner(BaseRunner):
logger.debug("Start run query, run %d of %s" % (i+1, run_count))
logger.info(case_metric.search)
start_time = time.time()
_query_res = self.milvus.query(case_param["vector_query"], filter_query=case_param["filter_query"])
_query_res = self.milvus.query(case_param["vector_query"], filter_query=case_param["filter_query"],
guarantee_timestamp=case_param["guarantee_timestamp"])
interval_time = time.time() - start_time
total_query_time += interval_time
if (i == 0) or (min_query_time > interval_time):