Fix reduce latency metric (#19479) (#19488)

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>

Co-authored-by: wgcn <1026688210@qq.com>

Co-authored-by: wgcn <1026688210@qq.com>
This commit is contained in:
bigsheeper 2022-10-11 10:17:23 +08:00 committed by GitHub
parent 706b8e985f
commit cf9d99f79f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,7 +223,11 @@ func (s *searchTask) reduceResults(searchReq *searchRequest, results []*SearchRe
log.Debug("marshal for historical results error", zap.Int64("msgID", s.ID()), zap.Error(err))
return err
}
defer deleteSearchResultDataBlobs(blobs)
defer func() {
deleteSearchResultDataBlobs(blobs)
s.reduceDur = s.tr.RecordSpan()
}()
for i := 0; i < cnt; i++ {
blob, err := getSearchResultDataBlob(blobs, i)
@ -266,8 +270,9 @@ func (s *searchTask) reduceResults(searchReq *searchRequest, results []*SearchRe
SlicedNumCount: 1,
}
}
s.reduceDur = s.tr.RecordSpan()
}
s.reduceDur = s.tr.RecordSpan()
return nil
}