enhance: Use auto detection proto interface to fetch grpc size (#35024)

Related to #34763

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/35031/head
congqixia 2024-07-26 14:23:47 +08:00 committed by GitHub
parent ea13b97b6a
commit 94d8f48b85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -28,7 +28,6 @@ import (
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/peer"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/runtime/protoiface"
"github.com/golang/protobuf/proto"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
@ -167,7 +166,7 @@ func (i *GrpcAccessInfo) ResponseSize() string {
switch r := i.resp.(type) {
case SizeResponse:
size = r.XXX_Size()
case protoiface.MessageV1:
case proto.Message:
size = proto.Size(r)
default:
return Unknown