mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
enhance: Optimize ConsistencyLevel and GuaranteeTimestamp log (#34738)
/kind improvement Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
f1b2f7b640
commit
c8bf6c8a46
@ -2959,9 +2959,7 @@ func (node *Proxy) search(ctx context.Context, request *milvuspb.SearchRequest)
|
||||
mustUsePartitionKey: Params.ProxyCfg.MustUsePartitionKey.GetAsBool(),
|
||||
}
|
||||
|
||||
guaranteeTs := request.GuaranteeTimestamp
|
||||
|
||||
log := log.Ctx(ctx).With(
|
||||
log := log.Ctx(ctx).With( // TODO: it might cause some cpu consumption
|
||||
zap.String("role", typeutil.ProxyRole),
|
||||
zap.String("db", request.DbName),
|
||||
zap.String("collection", request.CollectionName),
|
||||
@ -2970,14 +2968,15 @@ func (node *Proxy) search(ctx context.Context, request *milvuspb.SearchRequest)
|
||||
zap.Any("len(PlaceholderGroup)", len(request.PlaceholderGroup)),
|
||||
zap.Any("OutputFields", request.OutputFields),
|
||||
zap.Any("search_params", request.SearchParams),
|
||||
zap.Uint64("guarantee_timestamp", guaranteeTs),
|
||||
zap.String("ConsistencyLevel", request.GetConsistencyLevel().String()),
|
||||
zap.Bool("useDefaultConsistency", request.GetUseDefaultConsistency()),
|
||||
)
|
||||
|
||||
defer func() {
|
||||
span := tr.ElapseSpan()
|
||||
if span >= paramtable.Get().ProxyCfg.SlowQuerySpanInSeconds.GetAsDuration(time.Second) {
|
||||
log.Info(rpcSlow(method), zap.Int64("nq", qt.SearchRequest.GetNq()), zap.Duration("duration", span))
|
||||
log.Info(rpcSlow(method), zap.Uint64("guarantee_timestamp", qt.GetGuaranteeTimestamp()),
|
||||
zap.Int64("nq", qt.SearchRequest.GetNq()), zap.Duration("duration", span))
|
||||
metrics.ProxySlowQueryCount.WithLabelValues(
|
||||
strconv.FormatInt(paramtable.GetNodeID(), 10),
|
||||
metrics.SearchLabel,
|
||||
@ -3162,22 +3161,20 @@ func (node *Proxy) hybridSearch(ctx context.Context, request *milvuspb.HybridSea
|
||||
mustUsePartitionKey: Params.ProxyCfg.MustUsePartitionKey.GetAsBool(),
|
||||
}
|
||||
|
||||
guaranteeTs := request.GuaranteeTimestamp
|
||||
|
||||
log := log.Ctx(ctx).With(
|
||||
zap.String("role", typeutil.ProxyRole),
|
||||
zap.String("db", request.DbName),
|
||||
zap.String("collection", request.CollectionName),
|
||||
zap.Any("partitions", request.PartitionNames),
|
||||
zap.Any("OutputFields", request.OutputFields),
|
||||
zap.Uint64("guarantee_timestamp", guaranteeTs),
|
||||
zap.String("ConsistencyLevel", request.GetConsistencyLevel().String()),
|
||||
zap.Bool("useDefaultConsistency", request.GetUseDefaultConsistency()),
|
||||
)
|
||||
|
||||
defer func() {
|
||||
span := tr.ElapseSpan()
|
||||
if span >= paramtable.Get().ProxyCfg.SlowQuerySpanInSeconds.GetAsDuration(time.Second) {
|
||||
log.Info(rpcSlow(method), zap.Duration("duration", span))
|
||||
log.Info(rpcSlow(method), zap.Uint64("guarantee_timestamp", qt.GetGuaranteeTimestamp()), zap.Duration("duration", span))
|
||||
metrics.ProxySlowQueryCount.WithLabelValues(
|
||||
strconv.FormatInt(paramtable.GetNodeID(), 10),
|
||||
metrics.HybridSearchLabel,
|
||||
@ -3433,6 +3430,7 @@ func (node *Proxy) query(ctx context.Context, qt *queryTask) (*milvuspb.QueryRes
|
||||
zap.String("db", request.DbName),
|
||||
zap.String("collection", request.CollectionName),
|
||||
zap.Strings("partitions", request.PartitionNames),
|
||||
zap.String("ConsistencyLevel", request.GetConsistencyLevel().String()),
|
||||
zap.Bool("useDefaultConsistency", request.GetUseDefaultConsistency()),
|
||||
)
|
||||
|
||||
@ -3441,7 +3439,6 @@ func (node *Proxy) query(ctx context.Context, qt *queryTask) (*milvuspb.QueryRes
|
||||
zap.String("expr", request.Expr),
|
||||
zap.Strings("OutputFields", request.OutputFields),
|
||||
zap.Uint64("travel_timestamp", request.TravelTimestamp),
|
||||
zap.Uint64("guarantee_timestamp", request.GuaranteeTimestamp),
|
||||
)
|
||||
|
||||
tr := timerecord.NewTimeRecorder(method)
|
||||
@ -3454,7 +3451,7 @@ func (node *Proxy) query(ctx context.Context, qt *queryTask) (*milvuspb.QueryRes
|
||||
zap.String("expr", request.Expr),
|
||||
zap.Strings("OutputFields", request.OutputFields),
|
||||
zap.Uint64("travel_timestamp", request.TravelTimestamp),
|
||||
zap.Uint64("guarantee_timestamp", request.GuaranteeTimestamp),
|
||||
zap.Uint64("guarantee_timestamp", qt.GetGuaranteeTimestamp()),
|
||||
zap.Duration("duration", span))
|
||||
metrics.ProxySlowQueryCount.WithLabelValues(
|
||||
strconv.FormatInt(paramtable.GetNodeID(), 10),
|
||||
|
Loading…
Reference in New Issue
Block a user