[skip ci]Add time cost record for insert (#11936)

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
zhuwenxing 2021-11-16 21:45:42 +08:00 committed by GitHub
parent 3984ee5585
commit 39d00fb827
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,6 +44,7 @@ def hello_milvus(host="127.0.0.1"):
# insert data
nb = 3000
vectors = [[random.random() for _ in range(dim)] for _ in range(nb)]
t0 = time.time()
collection.insert(
[
[i for i in range(nb)],
@ -51,6 +52,8 @@ def hello_milvus(host="127.0.0.1"):
vectors
]
)
t1 = time.time()
print(f"\nInsert {nb} vectors cost {t1 - t0} seconds")
print(f"\nGet collection entities...")
print(collection.num_entities)