You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2021/10/14 09:41:54 UTC

[skywalking-banyandb] branch api-measure updated: Remove TopN query group by

This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch api-measure
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git


The following commit(s) were added to refs/heads/api-measure by this push:
     new 661b774  Remove TopN query group by
661b774 is described below

commit 661b774050bccbadee2973c27e7e6607aa3ba808
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Thu Oct 14 17:40:47 2021 +0800

    Remove TopN query group by
    
    Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
 api/proto/banyandb/measure/v1/topn.pb.go | 181 +++++++++----------------------
 api/proto/banyandb/measure/v1/topn.proto |   8 +-
 2 files changed, 52 insertions(+), 137 deletions(-)

diff --git a/api/proto/banyandb/measure/v1/topn.pb.go b/api/proto/banyandb/measure/v1/topn.pb.go
index 91857b9..9043126 100644
--- a/api/proto/banyandb/measure/v1/topn.pb.go
+++ b/api/proto/banyandb/measure/v1/topn.pb.go
@@ -209,7 +209,7 @@ type TopNRequest struct {
 	// top_n set the how many items should be returned in each list.
 	TopN int32 `protobuf:"varint,3,opt,name=top_n,json=topN,proto3" json:"top_n,omitempty"`
 	// agg aggregates lists in the time_range based on th
-	Agg *TopNRequest_Aggregation `protobuf:"bytes,4,opt,name=agg,proto3" json:"agg,omitempty"`
+	Agg AggregationFunction `protobuf:"varint,4,opt,name=agg,proto3,enum=banyandb.measure.v1.AggregationFunction" json:"agg,omitempty"`
 	// criteria select counters.
 	Conditions []*v11.Condition `protobuf:"bytes,5,rep,name=conditions,proto3" json:"conditions,omitempty"`
 }
@@ -267,11 +267,11 @@ func (x *TopNRequest) GetTopN() int32 {
 	return 0
 }
 
-func (x *TopNRequest) GetAgg() *TopNRequest_Aggregation {
+func (x *TopNRequest) GetAgg() AggregationFunction {
 	if x != nil {
 		return x.Agg
 	}
-	return nil
+	return AggregationFunction_AGGREGATION_FUNCTION_UNSPECIFIED
 }
 
 func (x *TopNRequest) GetConditions() []*v11.Condition {
@@ -336,63 +336,6 @@ func (x *TopNList_Item) GetValue() *v11.FieldValue {
 	return nil
 }
 
-type TopNRequest_Aggregation struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	// func set the aggregation function should be used
-	Func AggregationFunction `protobuf:"varint,1,opt,name=func,proto3,enum=banyandb.measure.v1.AggregationFunction" json:"func,omitempty"`
-	// group_by_tag_names group counters based on tags
-	GroupByTagNames []string `protobuf:"bytes,2,rep,name=group_by_tag_names,json=groupByTagNames,proto3" json:"group_by_tag_names,omitempty"`
-}
-
-func (x *TopNRequest_Aggregation) Reset() {
-	*x = TopNRequest_Aggregation{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_banyandb_measure_v1_topn_proto_msgTypes[4]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *TopNRequest_Aggregation) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*TopNRequest_Aggregation) ProtoMessage() {}
-
-func (x *TopNRequest_Aggregation) ProtoReflect() protoreflect.Message {
-	mi := &file_banyandb_measure_v1_topn_proto_msgTypes[4]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use TopNRequest_Aggregation.ProtoReflect.Descriptor instead.
-func (*TopNRequest_Aggregation) Descriptor() ([]byte, []int) {
-	return file_banyandb_measure_v1_topn_proto_rawDescGZIP(), []int{2, 0}
-}
-
-func (x *TopNRequest_Aggregation) GetFunc() AggregationFunction {
-	if x != nil {
-		return x.Func
-	}
-	return AggregationFunction_AGGREGATION_FUNCTION_UNSPECIFIED
-}
-
-func (x *TopNRequest_Aggregation) GetGroupByTagNames() []string {
-	if x != nil {
-		return x.GroupByTagNames
-	}
-	return nil
-}
-
 var File_banyandb_measure_v1_topn_proto protoreflect.FileDescriptor
 
 var file_banyandb_measure_v1_topn_proto_rawDesc = []byte{
@@ -424,7 +367,7 @@ var file_banyandb_measure_v1_topn_proto_rawDesc = []byte{
 	0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x6c, 0x69, 0x73, 0x74,
 	0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e,
 	0x64, 0x62, 0x2e, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f,
-	0x70, 0x4e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x6c, 0x69, 0x73, 0x74, 0x73, 0x22, 0x91, 0x03,
+	0x70, 0x4e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x6c, 0x69, 0x73, 0x74, 0x73, 0x22, 0x93, 0x02,
 	0x0a, 0x0b, 0x54, 0x6f, 0x70, 0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a,
 	0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
 	0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
@@ -434,36 +377,28 @@ var file_banyandb_measure_v1_topn_proto_rawDesc = []byte{
 	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e,
 	0x54, 0x69, 0x6d, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x52,
 	0x61, 0x6e, 0x67, 0x65, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x5f, 0x6e, 0x18, 0x03, 0x20,
-	0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4e, 0x12, 0x3e, 0x0a, 0x03, 0x61, 0x67, 0x67,
-	0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
-	0x62, 0x2e, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x70,
-	0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61,
-	0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x61, 0x67, 0x67, 0x12, 0x3c, 0x0a, 0x0a, 0x63, 0x6f, 0x6e,
-	0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e,
-	0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76,
-	0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e,
-	0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x78, 0x0a, 0x0b, 0x41, 0x67, 0x67, 0x72, 0x65,
-	0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e,
-	0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65,
-	0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04,
-	0x66, 0x75, 0x6e, 0x63, 0x12, 0x2b, 0x0a, 0x12, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x62, 0x79,
-	0x5f, 0x74, 0x61, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09,
-	0x52, 0x0f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65,
-	0x73, 0x2a, 0x5a, 0x0a, 0x13, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e,
-	0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x20, 0x41, 0x47, 0x47, 0x52,
-	0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e,
-	0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d,
-	0x0a, 0x19, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x55,
-	0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x45, 0x41, 0x4e, 0x10, 0x01, 0x42, 0x70, 0x0a,
-	0x29, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b, 0x79, 0x77,
-	0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2e,
-	0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68,
-	0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x73, 0x6b,
-	0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
-	0x62, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x61, 0x6e, 0x79,
-	0x61, 0x6e, 0x64, 0x62, 0x2f, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x62,
-	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4e, 0x12, 0x3a, 0x0a, 0x03, 0x61, 0x67, 0x67,
+	0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
+	0x62, 0x2e, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x67,
+	0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+	0x52, 0x03, 0x61, 0x67, 0x67, 0x12, 0x3c, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69,
+	0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x61, 0x6e, 0x79,
+	0x61, 0x6e, 0x64, 0x62, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f,
+	0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69,
+	0x6f, 0x6e, 0x73, 0x2a, 0x5a, 0x0a, 0x13, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69,
+	0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x20, 0x41, 0x47,
+	0x47, 0x52, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49,
+	0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
+	0x12, 0x1d, 0x0a, 0x19, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f,
+	0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x45, 0x41, 0x4e, 0x10, 0x01, 0x42,
+	0x70, 0x0a, 0x29, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x73, 0x6b,
+	0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x61, 0x6e, 0x79, 0x61, 0x6e, 0x64,
+	0x62, 0x2e, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x5a, 0x43, 0x67, 0x69,
+	0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f,
+	0x73, 0x6b, 0x79, 0x77, 0x61, 0x6c, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x61, 0x6e, 0x79, 0x61,
+	0x6e, 0x64, 0x62, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x62, 0x61,
+	0x6e, 0x79, 0x61, 0x6e, 0x64, 0x62, 0x2f, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x2f, 0x76,
+	0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -479,35 +414,33 @@ func file_banyandb_measure_v1_topn_proto_rawDescGZIP() []byte {
 }
 
 var file_banyandb_measure_v1_topn_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
-var file_banyandb_measure_v1_topn_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
+var file_banyandb_measure_v1_topn_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
 var file_banyandb_measure_v1_topn_proto_goTypes = []interface{}{
-	(AggregationFunction)(0),        // 0: banyandb.measure.v1.AggregationFunction
-	(*TopNList)(nil),                // 1: banyandb.measure.v1.TopNList
-	(*TopNResponse)(nil),            // 2: banyandb.measure.v1.TopNResponse
-	(*TopNRequest)(nil),             // 3: banyandb.measure.v1.TopNRequest
-	(*TopNList_Item)(nil),           // 4: banyandb.measure.v1.TopNList.Item
-	(*TopNRequest_Aggregation)(nil), // 5: banyandb.measure.v1.TopNRequest.Aggregation
-	(*timestamppb.Timestamp)(nil),   // 6: google.protobuf.Timestamp
-	(*v1.Metadata)(nil),             // 7: banyandb.common.v1.Metadata
-	(*v11.TimeRange)(nil),           // 8: banyandb.model.v1.TimeRange
-	(*v11.Condition)(nil),           // 9: banyandb.model.v1.Condition
-	(*v11.FieldValue)(nil),          // 10: banyandb.model.v1.FieldValue
+	(AggregationFunction)(0),      // 0: banyandb.measure.v1.AggregationFunction
+	(*TopNList)(nil),              // 1: banyandb.measure.v1.TopNList
+	(*TopNResponse)(nil),          // 2: banyandb.measure.v1.TopNResponse
+	(*TopNRequest)(nil),           // 3: banyandb.measure.v1.TopNRequest
+	(*TopNList_Item)(nil),         // 4: banyandb.measure.v1.TopNList.Item
+	(*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp
+	(*v1.Metadata)(nil),           // 6: banyandb.common.v1.Metadata
+	(*v11.TimeRange)(nil),         // 7: banyandb.model.v1.TimeRange
+	(*v11.Condition)(nil),         // 8: banyandb.model.v1.Condition
+	(*v11.FieldValue)(nil),        // 9: banyandb.model.v1.FieldValue
 }
 var file_banyandb_measure_v1_topn_proto_depIdxs = []int32{
-	6,  // 0: banyandb.measure.v1.TopNList.timestamp:type_name -> google.protobuf.Timestamp
-	4,  // 1: banyandb.measure.v1.TopNList.items:type_name -> banyandb.measure.v1.TopNList.Item
-	1,  // 2: banyandb.measure.v1.TopNResponse.lists:type_name -> banyandb.measure.v1.TopNList
-	7,  // 3: banyandb.measure.v1.TopNRequest.metadata:type_name -> banyandb.common.v1.Metadata
-	8,  // 4: banyandb.measure.v1.TopNRequest.time_range:type_name -> banyandb.model.v1.TimeRange
-	5,  // 5: banyandb.measure.v1.TopNRequest.agg:type_name -> banyandb.measure.v1.TopNRequest.Aggregation
-	9,  // 6: banyandb.measure.v1.TopNRequest.conditions:type_name -> banyandb.model.v1.Condition
-	10, // 7: banyandb.measure.v1.TopNList.Item.value:type_name -> banyandb.model.v1.FieldValue
-	0,  // 8: banyandb.measure.v1.TopNRequest.Aggregation.func:type_name -> banyandb.measure.v1.AggregationFunction
-	9,  // [9:9] is the sub-list for method output_type
-	9,  // [9:9] is the sub-list for method input_type
-	9,  // [9:9] is the sub-list for extension type_name
-	9,  // [9:9] is the sub-list for extension extendee
-	0,  // [0:9] is the sub-list for field type_name
+	5, // 0: banyandb.measure.v1.TopNList.timestamp:type_name -> google.protobuf.Timestamp
+	4, // 1: banyandb.measure.v1.TopNList.items:type_name -> banyandb.measure.v1.TopNList.Item
+	1, // 2: banyandb.measure.v1.TopNResponse.lists:type_name -> banyandb.measure.v1.TopNList
+	6, // 3: banyandb.measure.v1.TopNRequest.metadata:type_name -> banyandb.common.v1.Metadata
+	7, // 4: banyandb.measure.v1.TopNRequest.time_range:type_name -> banyandb.model.v1.TimeRange
+	0, // 5: banyandb.measure.v1.TopNRequest.agg:type_name -> banyandb.measure.v1.AggregationFunction
+	8, // 6: banyandb.measure.v1.TopNRequest.conditions:type_name -> banyandb.model.v1.Condition
+	9, // 7: banyandb.measure.v1.TopNList.Item.value:type_name -> banyandb.model.v1.FieldValue
+	8, // [8:8] is the sub-list for method output_type
+	8, // [8:8] is the sub-list for method input_type
+	8, // [8:8] is the sub-list for extension type_name
+	8, // [8:8] is the sub-list for extension extendee
+	0, // [0:8] is the sub-list for field type_name
 }
 
 func init() { file_banyandb_measure_v1_topn_proto_init() }
@@ -564,18 +497,6 @@ func file_banyandb_measure_v1_topn_proto_init() {
 				return nil
 			}
 		}
-		file_banyandb_measure_v1_topn_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*TopNRequest_Aggregation); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
@@ -583,7 +504,7 @@ func file_banyandb_measure_v1_topn_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_banyandb_measure_v1_topn_proto_rawDesc,
 			NumEnums:      1,
-			NumMessages:   5,
+			NumMessages:   4,
 			NumExtensions: 0,
 			NumServices:   0,
 		},
diff --git a/api/proto/banyandb/measure/v1/topn.proto b/api/proto/banyandb/measure/v1/topn.proto
index 25b1f26..e24d301 100644
--- a/api/proto/banyandb/measure/v1/topn.proto
+++ b/api/proto/banyandb/measure/v1/topn.proto
@@ -59,14 +59,8 @@ message TopNRequest {
     model.v1.TimeRange time_range = 2;
     // top_n set the how many items should be returned in each list.
     int32 top_n = 3;
-    message Aggregation {
-        // func set the aggregation function should be used
-        AggregationFunction func = 1;
-        // group_by_tag_names group counters based on tags
-        repeated string group_by_tag_names = 2;
-    }
     // agg aggregates lists in the time_range based on th
-    Aggregation agg = 4;
+    AggregationFunction agg = 4;
     // criteria select counters.
     repeated model.v1.Condition conditions = 5;
 }