Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
2a760c10
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,发现更多精彩内容 >>
未验证
提交
2a760c10
编写于
4月 03, 2023
作者:
Y
yah01
提交者:
GitHub
4月 03, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add metrics for QueryNodeV2 (#23163)
Signed-off-by:
N
yah01
<
yang.cen@zilliz.com
>
上级
b6f69fe7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
0 deletion
+25
-0
internal/querynodev2/services.go
internal/querynodev2/services.go
+7
-0
internal/querynodev2/tasks/scheduler.go
internal/querynodev2/tasks/scheduler.go
+7
-0
internal/querynodev2/tasks/task.go
internal/querynodev2/tasks/task.go
+11
-0
未找到文件。
internal/querynodev2/services.go
浏览文件 @
2a760c10
...
...
@@ -46,6 +46,7 @@ import (
"github.com/milvus-io/milvus/internal/util/merr"
"github.com/milvus-io/milvus/internal/util/metricsinfo"
"github.com/milvus-io/milvus/internal/util/paramtable"
"github.com/milvus-io/milvus/internal/util/timerecord"
"github.com/milvus-io/milvus/internal/util/typeutil"
)
...
...
@@ -643,6 +644,8 @@ func (node *QueryNode) Search(ctx context.Context, req *querypb.SearchRequest) (
metrics
.
QueryNodeSQCount
.
WithLabelValues
(
fmt
.
Sprint
(
paramtable
.
GetNodeID
()),
metrics
.
SearchLabel
,
metrics
.
FailLabel
)
.
Inc
()
return
failRet
,
nil
}
tr
:=
timerecord
.
NewTimeRecorderWithTrace
(
ctx
,
"searchRequestReduce"
)
ret
,
err
:=
segments
.
ReduceSearchResults
(
ctx
,
toReduceResults
,
req
.
Req
.
GetNq
(),
req
.
Req
.
GetTopk
(),
req
.
Req
.
GetMetricType
())
if
err
!=
nil
{
log
.
Warn
(
"failed to reduce search results"
,
zap
.
Error
(
err
))
...
...
@@ -650,6 +653,10 @@ func (node *QueryNode) Search(ctx context.Context, req *querypb.SearchRequest) (
failRet
.
Status
.
Reason
=
err
.
Error
()
return
failRet
,
nil
}
metrics
.
QueryNodeReduceLatency
.
WithLabelValues
(
fmt
.
Sprint
(
paramtable
.
GetNodeID
()),
metrics
.
SearchLabel
)
.
Observe
(
float64
(
tr
.
ElapseSpan
()
.
Milliseconds
()))
if
!
req
.
FromShardLeader
{
collector
.
Rate
.
Add
(
metricsinfo
.
NQPerSecond
,
float64
(
req
.
GetReq
()
.
GetNq
()))
...
...
internal/querynodev2/tasks/scheduler.go
浏览文件 @
2a760c10
...
...
@@ -46,6 +46,7 @@ func (s *Scheduler) Add(task Task) bool {
case
*
SearchTask
:
select
{
case
s
.
searchWaitQueue
<-
t
:
t
.
tr
.
RecordSpan
()
metrics
.
QueryNodeReadTaskUnsolveLen
.
WithLabelValues
(
fmt
.
Sprint
(
paramtable
.
GetNodeID
()))
.
Inc
()
default
:
return
false
...
...
@@ -65,6 +66,12 @@ func (s *Scheduler) Schedule(ctx context.Context) {
if
!
s
.
tryPromote
(
task
)
{
break
}
inQueueDuration
:=
task
.
tr
.
RecordSpan
()
metrics
.
QueryNodeSQLatencyInQueue
.
WithLabelValues
(
fmt
.
Sprint
(
paramtable
.
GetNodeID
()),
metrics
.
SearchLabel
)
.
Observe
(
float64
(
inQueueDuration
.
Milliseconds
()))
s
.
process
(
task
)
s
.
mergedSearchTasks
.
Remove
(
task
)
}
...
...
internal/querynodev2/tasks/task.go
浏览文件 @
2a760c10
...
...
@@ -14,6 +14,7 @@ import (
"github.com/milvus-io/milvus/internal/util"
"github.com/milvus-io/milvus/internal/util/funcutil"
"github.com/milvus-io/milvus/internal/util/paramtable"
"github.com/milvus-io/milvus/internal/util/timerecord"
"go.uber.org/zap"
)
...
...
@@ -34,6 +35,8 @@ type SearchTask struct {
originNqs
[]
int64
others
[]
*
SearchTask
notifier
chan
error
tr
*
timerecord
.
TimeRecorder
}
func
NewSearchTask
(
ctx
context
.
Context
,
...
...
@@ -49,6 +52,8 @@ func NewSearchTask(ctx context.Context,
originTopks
:
[]
int64
{
req
.
GetReq
()
.
GetTopk
()},
originNqs
:
[]
int64
{
req
.
GetReq
()
.
GetNq
()},
notifier
:
make
(
chan
error
,
1
),
tr
:
timerecord
.
NewTimeRecorderWithTrace
(
ctx
,
"searchTask"
),
}
}
...
...
@@ -102,6 +107,7 @@ func (t *SearchTask) Execute() error {
return
nil
}
tr
:=
timerecord
.
NewTimeRecorderWithTrace
(
t
.
ctx
,
"searchTaskReduce"
)
blobs
,
err
:=
segments
.
ReduceSearchResultsAndFillData
(
searchReq
.
Plan
(),
results
,
...
...
@@ -124,6 +130,11 @@ func (t *SearchTask) Execute() error {
bs
:=
make
([]
byte
,
len
(
blob
))
copy
(
bs
,
blob
)
metrics
.
QueryNodeReduceLatency
.
WithLabelValues
(
fmt
.
Sprint
(
paramtable
.
GetNodeID
()),
metrics
.
SearchLabel
)
.
Observe
(
float64
(
tr
.
ElapseSpan
()
.
Milliseconds
()))
t
.
result
=
&
internalpb
.
SearchResults
{
Status
:
util
.
WrapStatus
(
commonpb
.
ErrorCode_Success
,
""
),
MetricType
:
req
.
GetReq
()
.
GetMetricType
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录