Skip to content

Commit 6e2872c

Browse files
wg1026688210wgcn
andauthored
fix: wrong reduce lantency metric (#46233)
#46248 Signed-off-by: wgcn <[email protected]> Co-authored-by: wgcn <[email protected]>
1 parent 85a7a7b commit 6e2872c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

internal/querynodev2/handlers.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,12 @@ func (node *QueryNode) searchChannel(ctx context.Context, req *querypb.SearchReq
435435
reduce.NewReduceSearchResultInfo(req.GetReq().GetNq(),
436436
req.GetReq().GetTopk()).WithMetricType(req.GetReq().GetMetricType()).WithGroupByField(req.GetReq().GetGroupByFieldId()).
437437
WithGroupSize(req.GetReq().GetGroupSize()).WithAdvance(req.GetReq().GetIsAdvanced()))
438+
439+
reduceLatency := tr.RecordSpan()
440+
metrics.QueryNodeReduceLatency.
441+
WithLabelValues(fmt.Sprint(node.GetNodeID()), metrics.SearchLabel, metrics.ReduceShards, metrics.BatchReduce).
442+
Observe(float64(reduceLatency.Milliseconds()))
443+
438444
if err != nil {
439445
return nil, err
440446
}

internal/querynodev2/services.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -878,13 +878,8 @@ func (node *QueryNode) Search(ctx context.Context, req *querypb.SearchRequest) (
878878
return resp, nil
879879
}
880880

881-
tr.RecordSpan()
882881
ret.Status = merr.Success()
883882

884-
reduceLatency := tr.RecordSpan()
885-
metrics.QueryNodeReduceLatency.
886-
WithLabelValues(fmt.Sprint(node.GetNodeID()), metrics.SearchLabel, metrics.ReduceShards, metrics.BatchReduce).
887-
Observe(float64(reduceLatency.Milliseconds()))
888883
metrics.QueryNodeExecuteCounter.WithLabelValues(strconv.FormatInt(node.GetNodeID(), 10), metrics.SearchLabel).
889884
Add(float64(proto.Size(req)))
890885

0 commit comments

Comments
 (0)