[skip ci]Add time record for creating index (#12311)

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
zhuwenxing 2021-11-26 19:41:16 +08:00 committed by GitHub
parent 48b45d82e5
commit e9be4a81ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,7 +65,10 @@ def hello_milvus(host="127.0.0.1"):
# create index and load table # create index and load table
default_index = {"index_type": "IVF_FLAT", "params": {"nlist": 128}, "metric_type": "L2"} default_index = {"index_type": "IVF_FLAT", "params": {"nlist": 128}, "metric_type": "L2"}
print(f"\nCreate index...") print(f"\nCreate index...")
t0 = time.time()
collection.create_index(field_name="float_vector", index_params=default_index) collection.create_index(field_name="float_vector", index_params=default_index)
t1 = time.time()
print(f"\nCreate index cost {t1 - t0} seconds")
print(f"\nload collection...") print(f"\nload collection...")
t0 = time.time() t0 = time.time()
collection.load() collection.load()