mirror of https://github.com/milvus-io/milvus.git
Intercept import request in Proxy interceptor (#19856)
Signed-off-by: bigsheeper <yihao.dai@zilliz.com> Signed-off-by: bigsheeper <yihao.dai@zilliz.com>pull/19871/head
parent
2785f98de6
commit
15f7592739
|
@ -60,7 +60,8 @@ func getRequestInfo(req interface{}) (internalpb.RateType, int, error) {
|
|||
return internalpb.RateType_DMLInsert, proto.Size(r), nil
|
||||
case *milvuspb.DeleteRequest:
|
||||
return internalpb.RateType_DMLDelete, proto.Size(r), nil
|
||||
// TODO: add bulkLoad
|
||||
case *milvuspb.ImportRequest:
|
||||
return internalpb.RateType_DMLBulkLoad, proto.Size(r), nil
|
||||
case *milvuspb.SearchRequest:
|
||||
return internalpb.RateType_DQLSearch, int(r.GetNq()), nil
|
||||
case *milvuspb.QueryRequest:
|
||||
|
|
|
@ -50,6 +50,11 @@ func TestRateLimitInterceptor(t *testing.T) {
|
|||
assert.Equal(t, proto.Size(&milvuspb.DeleteRequest{}), size)
|
||||
assert.Equal(t, internalpb.RateType_DMLDelete, rt)
|
||||
|
||||
rt, size, err = getRequestInfo(&milvuspb.ImportRequest{})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, proto.Size(&milvuspb.ImportRequest{}), size)
|
||||
assert.Equal(t, internalpb.RateType_DMLBulkLoad, rt)
|
||||
|
||||
rt, size, err = getRequestInfo(&milvuspb.SearchRequest{})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, proto.Size(&milvuspb.SearchRequest{}), size)
|
||||
|
|
Loading…
Reference in New Issue