From fa9738f9a7412d16a0bf3829bde4c0a5cd168c0e Mon Sep 17 00:00:00 2001 From: yibin87 Date: Thu, 25 Sep 2025 11:41:46 +0800 Subject: [PATCH] Add network fields for topsql agent Signed-off-by: yibin87 --- go-tipb/topsql_agent.pb.go | 183 ++++++++++++++++++++++++++----------- proto/topsql_agent.proto | 2 + 2 files changed, 130 insertions(+), 55 deletions(-) diff --git a/go-tipb/topsql_agent.pb.go b/go-tipb/topsql_agent.pb.go index 85c35749..7b135c5e 100644 --- a/go-tipb/topsql_agent.pb.go +++ b/go-tipb/topsql_agent.pb.go @@ -98,12 +98,14 @@ func (m *TopSQLRecord) GetKeyspaceName() []byte { } type TopSQLRecordItem struct { - TimestampSec uint64 `protobuf:"varint,1,opt,name=timestamp_sec,json=timestampSec,proto3" json:"timestamp_sec,omitempty"` - CpuTimeMs uint32 `protobuf:"varint,2,opt,name=cpu_time_ms,json=cpuTimeMs,proto3" json:"cpu_time_ms,omitempty"` - StmtExecCount uint64 `protobuf:"varint,3,opt,name=stmt_exec_count,json=stmtExecCount,proto3" json:"stmt_exec_count,omitempty"` - StmtKvExecCount map[string]uint64 `protobuf:"bytes,4,rep,name=stmt_kv_exec_count,json=stmtKvExecCount,proto3" json:"stmt_kv_exec_count,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - StmtDurationSumNs uint64 `protobuf:"varint,5,opt,name=stmt_duration_sum_ns,json=stmtDurationSumNs,proto3" json:"stmt_duration_sum_ns,omitempty"` - StmtDurationCount uint64 `protobuf:"varint,6,opt,name=stmt_duration_count,json=stmtDurationCount,proto3" json:"stmt_duration_count,omitempty"` + TimestampSec uint64 `protobuf:"varint,1,opt,name=timestamp_sec,json=timestampSec,proto3" json:"timestamp_sec,omitempty"` + CpuTimeMs uint32 `protobuf:"varint,2,opt,name=cpu_time_ms,json=cpuTimeMs,proto3" json:"cpu_time_ms,omitempty"` + StmtExecCount uint64 `protobuf:"varint,3,opt,name=stmt_exec_count,json=stmtExecCount,proto3" json:"stmt_exec_count,omitempty"` + StmtKvExecCount map[string]uint64 `protobuf:"bytes,4,rep,name=stmt_kv_exec_count,json=stmtKvExecCount,proto3" json:"stmt_kv_exec_count,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + StmtDurationSumNs uint64 `protobuf:"varint,5,opt,name=stmt_duration_sum_ns,json=stmtDurationSumNs,proto3" json:"stmt_duration_sum_ns,omitempty"` + StmtDurationCount uint64 `protobuf:"varint,6,opt,name=stmt_duration_count,json=stmtDurationCount,proto3" json:"stmt_duration_count,omitempty"` + StmtNetworkInBytes uint64 `protobuf:"varint,7,opt,name=stmt_network_in_bytes,json=stmtNetworkInBytes,proto3" json:"stmt_network_in_bytes,omitempty"` + StmtNetworkOutBytes uint64 `protobuf:"varint,8,opt,name=stmt_network_out_bytes,json=stmtNetworkOutBytes,proto3" json:"stmt_network_out_bytes,omitempty"` } func (m *TopSQLRecordItem) Reset() { *m = TopSQLRecordItem{} } @@ -181,6 +183,20 @@ func (m *TopSQLRecordItem) GetStmtDurationCount() uint64 { return 0 } +func (m *TopSQLRecordItem) GetStmtNetworkInBytes() uint64 { + if m != nil { + return m.StmtNetworkInBytes + } + return 0 +} + +func (m *TopSQLRecordItem) GetStmtNetworkOutBytes() uint64 { + if m != nil { + return m.StmtNetworkOutBytes + } + return 0 +} + type SQLMeta struct { SqlDigest []byte `protobuf:"bytes,1,opt,name=sql_digest,json=sqlDigest,proto3" json:"sql_digest,omitempty"` // SQL text with sensitive fields trimmed. @@ -514,55 +530,58 @@ func init() { func init() { proto.RegisterFile("topsql_agent.proto", fileDescriptor_1b19f3a2fcd6965e) } var fileDescriptor_1b19f3a2fcd6965e = []byte{ - // 754 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcf, 0x8f, 0xdb, 0x44, - 0x14, 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0x00, 0xff, 0xff, 0x17, 0xfd, 0xf3, 0xa6, 0xe8, 0x05, - 0x00, 0x00, + // 803 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4d, 0x6f, 0x1b, 0x55, + 0x14, 0xf5, 0xd4, 0x4e, 0x62, 0x5f, 0xdb, 0x49, 0xfb, 0x92, 0xb4, 0x96, 0x25, 0x4c, 0x65, 0x04, + 0x44, 0x50, 0x5c, 0x70, 0x25, 0xa0, 0xac, 0xc0, 0x34, 0x52, 0x22, 0xda, 0x90, 0xbe, 0xe9, 0x82, + 0xdd, 0x68, 0x66, 0x7c, 0xb1, 0x46, 0x99, 0xf7, 0xe1, 0x79, 0x6f, 0x42, 0xcd, 0xaf, 0x60, 0xc9, + 0x82, 0x0d, 0x3b, 0xc4, 0x8e, 0x1f, 0x81, 0xc4, 0xb2, 0xcb, 0x2e, 0x51, 0x22, 0xf1, 0x3b, 0xd0, + 0xbb, 0x33, 0x4e, 0xc7, 0x49, 0xaa, 0x76, 0xf7, 0x7c, 0xee, 0x39, 0x67, 0xce, 0x7d, 0xf7, 0xce, + 0x18, 0x98, 0x55, 0xda, 0xcc, 0xd3, 0x20, 0x9c, 0xa1, 0xb4, 0x23, 0x9d, 0x29, 0xab, 0x58, 0xc3, + 0x26, 0x3a, 0xea, 0xef, 0xcc, 0xd4, 0x4c, 0x11, 0x70, 0xdf, 0x9d, 0x8a, 0x5a, 0x7f, 0x2b, 0xcb, + 0x8d, 0xa5, 0x63, 0x01, 0x0c, 0x7f, 0xf7, 0xa0, 0xf3, 0x4c, 0x69, 0xff, 0xe9, 0x63, 0x8e, 0xb1, + 0xca, 0xa6, 0xec, 0x1d, 0x00, 0x67, 0x38, 0x4d, 0x66, 0x68, 0x6c, 0xcf, 0xbb, 0xeb, 0xed, 0x75, + 0x78, 0xcb, 0xcc, 0xd3, 0x47, 0x04, 0xb0, 0x77, 0x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 0x68, 0xf9, 0x79, 0x64, 0xe2, 0x2c, 0x89, 0x90, + 0xad, 0x7c, 0x36, 0x5f, 0x4d, 0xaa, 0x7f, 0xe7, 0x0a, 0xbe, 0x74, 0xfc, 0xd4, 0x9b, 0x3c, 0x7c, + 0xf9, 0x47, 0xd3, 0xfb, 0xe7, 0x6c, 0xe0, 0xbd, 0x38, 0x1b, 0x78, 0xff, 0x9e, 0x0d, 0xbc, 0x5f, + 0xce, 0x07, 0xb5, 0x5f, 0xcf, 0x07, 0xb5, 0x17, 0xe7, 0x83, 0xda, 0xcb, 0xf3, 0x41, 0x0d, 0x76, + 0x63, 0x25, 0x46, 0x3a, 0x91, 0xb3, 0x38, 0xd4, 0x23, 0x9b, 0x4c, 0x23, 0xb2, 0x3b, 0xf6, 0xa2, + 0x75, 0xfa, 0x37, 0x78, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x99, 0xbf, 0x76, 0x3d, 0x50, + 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1010,6 +1029,16 @@ func (m *TopSQLRecordItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.StmtNetworkOutBytes != 0 { + i = encodeVarintTopsqlAgent(dAtA, i, uint64(m.StmtNetworkOutBytes)) + i-- + dAtA[i] = 0x40 + } + if m.StmtNetworkInBytes != 0 { + i = encodeVarintTopsqlAgent(dAtA, i, uint64(m.StmtNetworkInBytes)) + i-- + dAtA[i] = 0x38 + } if m.StmtDurationCount != 0 { i = encodeVarintTopsqlAgent(dAtA, i, uint64(m.StmtDurationCount)) i-- @@ -1368,6 +1397,12 @@ func (m *TopSQLRecordItem) Size() (n int) { if m.StmtDurationCount != 0 { n += 1 + sovTopsqlAgent(uint64(m.StmtDurationCount)) } + if m.StmtNetworkInBytes != 0 { + n += 1 + sovTopsqlAgent(uint64(m.StmtNetworkInBytes)) + } + if m.StmtNetworkOutBytes != 0 { + n += 1 + sovTopsqlAgent(uint64(m.StmtNetworkOutBytes)) + } return n } @@ -1916,6 +1951,44 @@ func (m *TopSQLRecordItem) Unmarshal(dAtA []byte) error { break } } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StmtNetworkInBytes", wireType) + } + m.StmtNetworkInBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTopsqlAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StmtNetworkInBytes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StmtNetworkOutBytes", wireType) + } + m.StmtNetworkOutBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTopsqlAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StmtNetworkOutBytes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTopsqlAgent(dAtA[iNdEx:]) diff --git a/proto/topsql_agent.proto b/proto/topsql_agent.proto index 0c91a5cd..96dd3711 100644 --- a/proto/topsql_agent.proto +++ b/proto/topsql_agent.proto @@ -42,6 +42,8 @@ message TopSQLRecordItem { map stmt_kv_exec_count = 4; // target => count uint64 stmt_duration_sum_ns = 5; uint64 stmt_duration_count = 6; + uint64 stmt_network_in_bytes = 7; // traffic from client + uint64 stmt_network_out_bytes = 8; // traffic to client } message SQLMeta {