Add log of search to record time spent in mq (#13525)

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
pull/13552/head
Jiquan Long 2021-12-16 22:22:06 +08:00 committed by GitHub
parent 74055b8c9d
commit cb51df5985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 4 deletions

View File

@ -1623,6 +1623,10 @@ func (st *searchTask) PreExecute(ctx context.Context) error {
func (st *searchTask) Execute(ctx context.Context) error {
sp, ctx := trace.StartSpanFromContextWithOperationName(st.TraceCtx(), "Proxy-Search-Execute")
defer sp.Finish()
tr := timerecord.NewTimeRecorder(fmt.Sprintf("proxy execute search %d", st.ID()))
defer tr.Elapse("done")
var tsMsg msgstream.TsMsg = &msgstream.SearchMsg{
SearchRequest: *st.SearchRequest,
BaseMsg: msgstream.BaseMsg{
@ -1668,16 +1672,19 @@ func (st *searchTask) Execute(ctx context.Context) error {
return err
}
}
tr.Record("get used message stream")
err = stream.Produce(&msgPack)
if err != nil {
log.Debug("proxy", zap.String("send search request failed", err.Error()))
}
log.Debug("proxy sent one searchMsg",
zap.Any("collectionID", st.CollectionID),
zap.Any("msgID", tsMsg.ID()),
zap.Int64("collectionID", st.CollectionID),
zap.Int64("msgID", tsMsg.ID()),
zap.Int("length of search msg", len(msgPack.Msgs)),
zap.Any("timeoutTs", st.SearchRequest.TimeoutTimestamp),
)
zap.Uint64("timeoutTs", st.SearchRequest.TimeoutTimestamp))
tr.Record("send search msg to message stream")
return err
}