Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
5ba77d8f
M
milvus
项目概览
milvus
/
milvus
11 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
5ba77d8f
编写于
12月 14, 2021
作者:
Z
zhuwenxing
提交者:
GitHub
12月 14, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[skip ci]Add time trace for deploy test (#13338)
Signed-off-by:
N
zhuwenxing
<
wenxing.zhu@zilliz.com
>
上级
e510d777
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
7 deletion
+9
-7
tests/python_client/deploy/scripts/utils.py
tests/python_client/deploy/scripts/utils.py
+9
-7
未找到文件。
tests/python_client/deploy/scripts/utils.py
浏览文件 @
5ba77d8f
# import docker
import
copy
import
time
from
pymilvus
import
(
connections
,
FieldSchema
,
CollectionSchema
,
DataType
,
Collection
,
list_collections
,
...
...
@@ -64,7 +65,6 @@ def get_collections():
def
create_collections_and_insert_data
():
import
random
import
time
dim
=
128
default_fields
=
[
FieldSchema
(
name
=
"count"
,
dtype
=
DataType
.
INT64
,
is_primary
=
True
),
...
...
@@ -94,10 +94,10 @@ def create_collections_and_insert_data():
]
)
end_time
=
time
.
time
()
print
(
f
"[
{
j
+
1
}
/
{
times
}
] insert
{
nb
}
data, time:
{
end_time
-
start_time
}
"
)
print
(
f
"[
{
j
+
1
}
/
{
times
}
] insert
{
nb
}
data, time:
{
end_time
-
start_time
:.
4
f
}
"
)
total_time
+=
end_time
-
start_time
print
(
"end insert, time:"
,
total_time
)
print
(
f
"end insert, time:
{
total_time
:.
4
f
}
"
)
print
(
"Get collection entities"
)
start_time
=
time
.
time
()
print
(
f
"collection entities:
{
collection
.
num_entities
}
"
)
...
...
@@ -122,7 +122,9 @@ def create_index():
index
[
"params"
]
=
index_params_map
[
name
]
if
name
in
[
"BIN_FLAT"
,
"BIN_IVF_FLAT"
]:
index
[
"metric_type"
]
=
"HAMMING"
t0
=
time
.
time
()
c
.
create_index
(
field_name
=
"float_vector"
,
index_params
=
index
)
print
(
f
"create index time:
{
time
.
time
()
-
t0
:.
4
f
}
"
)
def
load_and_search
():
...
...
@@ -131,15 +133,15 @@ def load_and_search():
for
name
in
col_list
:
c
=
Collection
(
name
=
name
)
print
(
f
"collection name:
{
name
}
"
)
t0
=
time
.
time
()
c
.
load
()
print
(
f
"load time:
{
time
.
time
()
-
t0
:.
4
f
}
"
)
topK
=
5
vectors
=
[[
0.0
for
_
in
range
(
128
)]
for
_
in
range
(
3000
)]
index_type
=
name
search_params
=
gen_search_param
(
index_type
)[
0
]
print
(
search_params
)
# search_params = {"metric_type": "L2", "params": {"nprobe": 10}}
import
time
start_time
=
time
.
time
()
print
(
f
"
\n
Search..."
)
# define output_fields of search result
...
...
@@ -155,7 +157,7 @@ def load_and_search():
print
(
hit
,
hit
.
entity
.
get
(
"random_value"
))
ids
=
hits
.
ids
print
(
ids
)
print
(
"search latency
=
%.4fs"
%
(
end_time
-
start_time
))
print
(
"search latency
:
%.4fs"
%
(
end_time
-
start_time
))
t0
=
time
.
time
()
expr
=
"count in [2,4,6,8]"
output_fields
=
[
"count"
,
"random_value"
]
...
...
@@ -164,7 +166,7 @@ def load_and_search():
for
r
in
sorted_res
:
print
(
r
)
t1
=
time
.
time
()
print
(
"query latency
=
%.4fs"
%
(
t1
-
t0
))
print
(
"query latency
:
%.4fs"
%
(
t1
-
t0
))
# c.release()
print
(
"###########"
)
print
(
"search data ends"
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录