Add log of query to record time spent in mq (#13526)

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
pull/13927/head
Jiquan Long 2021-12-22 10:11:02 +08:00 committed by GitHub
parent 3e798a06c2
commit bdb001b20d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 6 deletions

View File

@ -2247,6 +2247,9 @@ func (qt *queryTask) PreExecute(ctx context.Context) error {
}
func (qt *queryTask) Execute(ctx context.Context) error {
tr := timerecord.NewTimeRecorder(fmt.Sprintf("proxy execute query %d", qt.ID()))
defer tr.Elapse("done")
var tsMsg msgstream.TsMsg = &msgstream.RetrieveMsg{
RetrieveRequest: *qt.RetrieveRequest,
BaseMsg: msgstream.BaseMsg{
@ -2278,17 +2281,19 @@ func (qt *queryTask) Execute(ctx context.Context) error {
return err
}
}
tr.Record("get used message stream")
err = stream.Produce(&msgPack)
log.Debug("proxy sent one retrieveMsg",
zap.Any("collectionID", qt.CollectionID),
zap.Any("msgID", tsMsg.ID()),
zap.Int("length of search msg", len(msgPack.Msgs)),
zap.Any("timeoutTs", qt.RetrieveRequest.TimeoutTimestamp),
)
if err != nil {
log.Debug("Failed to send retrieve request.",
zap.Any("requestID", qt.Base.MsgID), zap.Any("requestType", "query"))
}
log.Debug("proxy sent one retrieveMsg",
zap.Int64("collectionID", qt.CollectionID),
zap.Int64("msgID", tsMsg.ID()),
zap.Int("length of search msg", len(msgPack.Msgs)),
zap.Uint64("timeoutTs", qt.RetrieveRequest.TimeoutTimestamp))
tr.Record("send retrieve request to message stream")
log.Info("Query Execute done.",
zap.Any("requestID", qt.Base.MsgID), zap.Any("requestType", "query"))