Skip to content

Commit

Permalink
[skip ci]Fix import and add time cost record (milvus-io#12029)
Browse files Browse the repository at this point in the history
Signed-off-by: zhuwenxing <[email protected]>
  • Loading branch information
zhuwenxing authored Nov 17, 2021
1 parent 7df9600 commit 9575510
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/python_client/chaos/scripts/hello_milvus.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


def hello_milvus(host="127.0.0.1"):
import time
# create connection
connections.connect(host=host, port="19530")

Expand Down Expand Up @@ -66,12 +67,14 @@ def hello_milvus(host="127.0.0.1"):
print(f"\nCreate index...")
collection.create_index(field_name="float_vector", index_params=default_index)
print(f"\nload collection...")
t0 = time.time()
collection.load()
t1 = time.time()
print(f"\nload collection cost {t1 - t0} seconds")

# load and search
topK = 5
search_params = {"metric_type": "L2", "params": {"nprobe": 10}}
import time
start_time = time.time()
print(f"\nSearch...")
# define output_fields of search result
Expand Down

0 comments on commit 9575510

Please sign in to comment.