diff --git a/go/svc/query/v1/service.pb.go b/go/svc/query/v1/service.pb.go index 298668c..81a11c9 100644 --- a/go/svc/query/v1/service.pb.go +++ b/go/svc/query/v1/service.pb.go @@ -379,13 +379,14 @@ func (x *FormatResponse) GetFormatted() string { } type QueryRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - EnvironmentId int64 `protobuf:"varint,101,opt,name=environment_id,json=environmentId,proto3" json:"environment_id,omitempty"` - Cursor *v1.Cursor `protobuf:"bytes,102,opt,name=cursor,proto3" json:"cursor,omitempty"` - Limit int32 `protobuf:"varint,103,opt,name=limit,proto3" json:"limit,omitempty"` - Query *v1.Query `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + EnvironmentId int64 `protobuf:"varint,101,opt,name=environment_id,json=environmentId,proto3" json:"environment_id,omitempty"` + Cursor *v1.Cursor `protobuf:"bytes,102,opt,name=cursor,proto3" json:"cursor,omitempty"` + Limit int32 `protobuf:"varint,103,opt,name=limit,proto3" json:"limit,omitempty"` + Query *v1.Query `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` + IncludeDetailedProfiling *bool `protobuf:"varint,304,opt,name=include_detailed_profiling,json=includeDetailedProfiling,proto3,oneof" json:"include_detailed_profiling,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *QueryRequest) Reset() { @@ -446,10 +447,18 @@ func (x *QueryRequest) GetQuery() *v1.Query { return nil } +func (x *QueryRequest) GetIncludeDetailedProfiling() bool { + if x != nil && x.IncludeDetailedProfiling != nil { + return *x.IncludeDetailedProfiling + } + return false +} + type QueryResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Next *v1.Cursor `protobuf:"bytes,100,opt,name=next,proto3" json:"next,omitempty"` Data *v1.Data `protobuf:"bytes,200,opt,name=data,proto3" json:"data,omitempty"` + Metrics *v1.QueryMetrics `protobuf:"bytes,300,opt,name=metrics,proto3" json:"metrics,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -498,6 +507,13 @@ func (x *QueryResponse) GetData() *v1.Data { return nil } +func (x *QueryResponse) GetMetrics() *v1.QueryMetrics { + if x != nil { + return x.Metrics + } + return nil +} + type StreamRequest struct { state protoimpl.MessageState `protogen:"open.v1"` EnvironmentId int64 `protobuf:"varint,101,opt,name=environment_id,json=environmentId,proto3" json:"environment_id,omitempty"` @@ -829,7 +845,7 @@ var File_svc_query_v1_service_proto protoreflect.FileDescriptor const file_svc_query_v1_service_proto_rawDesc = "" + "\n" + - "\x1asvc/query/v1/service.proto\x12\fsvc.query.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x15types/v1/cursor.proto\x1a\x13types/v1/data.proto\x1a\x14types/v1/query.proto\x1a\x16types/v1/session.proto\x1a\x15types/v1/symbol.proto\x1a\x14types/v1/types.proto\"\xd8\x01\n" + + "\x1asvc/query/v1/service.proto\x12\fsvc.query.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x15types/v1/cursor.proto\x1a\x13types/v1/data.proto\x1a\x14types/v1/query.proto\x1a\x1ctypes/v1/query_metrics.proto\x1a\x16types/v1/session.proto\x1a\x15types/v1/symbol.proto\x1a\x14types/v1/types.proto\"\xd8\x01\n" + "\x16SummarizeEventsRequest\x12%\n" + "\x0eenvironment_id\x18\x01 \x01(\x03R\renvironmentId\x123\n" + "\x04from\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampH\x00R\x04from\x88\x01\x01\x12/\n" + @@ -858,15 +874,18 @@ const file_svc_query_v1_service_proto_rawDesc = "" + "\x06parsed\x18\x02 \x01(\v2\x0f.types.v1.QueryH\x00R\x06parsedB\a\n" + "\x05query\".\n" + "\x0eFormatResponse\x12\x1c\n" + - "\tformatted\x18\x01 \x01(\tR\tformatted\"\x9c\x01\n" + + "\tformatted\x18\x01 \x01(\tR\tformatted\"\xff\x01\n" + "\fQueryRequest\x12%\n" + "\x0eenvironment_id\x18e \x01(\x03R\renvironmentId\x12(\n" + "\x06cursor\x18f \x01(\v2\x10.types.v1.CursorR\x06cursor\x12\x14\n" + "\x05limit\x18g \x01(\x05R\x05limit\x12%\n" + - "\x05query\x18\x02 \x01(\v2\x0f.types.v1.QueryR\x05query\"Z\n" + + "\x05query\x18\x02 \x01(\v2\x0f.types.v1.QueryR\x05query\x12B\n" + + "\x1ainclude_detailed_profiling\x18\xb0\x02 \x01(\bH\x00R\x18includeDetailedProfiling\x88\x01\x01B\x1d\n" + + "\x1b_include_detailed_profiling\"\x8d\x01\n" + "\rQueryResponse\x12$\n" + "\x04next\x18d \x01(\v2\x10.types.v1.CursorR\x04next\x12#\n" + - "\x04data\x18\xc8\x01 \x01(\v2\x0e.types.v1.DataR\x04data\"\xca\x01\n" + + "\x04data\x18\xc8\x01 \x01(\v2\x0e.types.v1.DataR\x04data\x121\n" + + "\ametrics\x18\xac\x02 \x01(\v2\x16.types.v1.QueryMetricsR\ametrics\"\xca\x01\n" + "\rStreamRequest\x12%\n" + "\x0eenvironment_id\x18e \x01(\x03R\renvironmentId\x12%\n" + "\x05query\x18\x02 \x01(\v2\x0f.types.v1.QueryR\x05query\x12%\n" + @@ -926,7 +945,8 @@ var file_svc_query_v1_service_proto_goTypes = []any{ (*v1.DataStreamType)(nil), // 17: types.v1.DataStreamType (*v1.Cursor)(nil), // 18: types.v1.Cursor (*v1.Data)(nil), // 19: types.v1.Data - (*v1.Symbol)(nil), // 20: types.v1.Symbol + (*v1.QueryMetrics)(nil), // 20: types.v1.QueryMetrics + (*v1.Symbol)(nil), // 21: types.v1.Symbol } var file_svc_query_v1_service_proto_depIdxs = []int32{ 14, // 0: svc.query.v1.SummarizeEventsRequest.from:type_name -> google.protobuf.Timestamp @@ -940,31 +960,32 @@ var file_svc_query_v1_service_proto_depIdxs = []int32{ 16, // 8: svc.query.v1.QueryRequest.query:type_name -> types.v1.Query 18, // 9: svc.query.v1.QueryResponse.next:type_name -> types.v1.Cursor 19, // 10: svc.query.v1.QueryResponse.data:type_name -> types.v1.Data - 16, // 11: svc.query.v1.StreamRequest.query:type_name -> types.v1.Query - 15, // 12: svc.query.v1.StreamRequest.max_batching_for:type_name -> google.protobuf.Duration - 19, // 13: svc.query.v1.StreamResponse.data:type_name -> types.v1.Data - 18, // 14: svc.query.v1.ListSymbolsRequest.cursor:type_name -> types.v1.Cursor - 18, // 15: svc.query.v1.ListSymbolsResponse.next:type_name -> types.v1.Cursor - 13, // 16: svc.query.v1.ListSymbolsResponse.items:type_name -> svc.query.v1.ListSymbolsResponse.ListItem - 14, // 17: svc.query.v1.SummarizeEventsResponse.Bucket.ts:type_name -> google.protobuf.Timestamp - 20, // 18: svc.query.v1.ListSymbolsResponse.ListItem.symbol:type_name -> types.v1.Symbol - 0, // 19: svc.query.v1.QueryService.SummarizeEvents:input_type -> svc.query.v1.SummarizeEventsRequest - 2, // 20: svc.query.v1.QueryService.Parse:input_type -> svc.query.v1.ParseRequest - 4, // 21: svc.query.v1.QueryService.Format:input_type -> svc.query.v1.FormatRequest - 6, // 22: svc.query.v1.QueryService.Query:input_type -> svc.query.v1.QueryRequest - 8, // 23: svc.query.v1.QueryService.Stream:input_type -> svc.query.v1.StreamRequest - 10, // 24: svc.query.v1.QueryService.ListSymbols:input_type -> svc.query.v1.ListSymbolsRequest - 1, // 25: svc.query.v1.QueryService.SummarizeEvents:output_type -> svc.query.v1.SummarizeEventsResponse - 3, // 26: svc.query.v1.QueryService.Parse:output_type -> svc.query.v1.ParseResponse - 5, // 27: svc.query.v1.QueryService.Format:output_type -> svc.query.v1.FormatResponse - 7, // 28: svc.query.v1.QueryService.Query:output_type -> svc.query.v1.QueryResponse - 9, // 29: svc.query.v1.QueryService.Stream:output_type -> svc.query.v1.StreamResponse - 11, // 30: svc.query.v1.QueryService.ListSymbols:output_type -> svc.query.v1.ListSymbolsResponse - 25, // [25:31] is the sub-list for method output_type - 19, // [19:25] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 20, // 11: svc.query.v1.QueryResponse.metrics:type_name -> types.v1.QueryMetrics + 16, // 12: svc.query.v1.StreamRequest.query:type_name -> types.v1.Query + 15, // 13: svc.query.v1.StreamRequest.max_batching_for:type_name -> google.protobuf.Duration + 19, // 14: svc.query.v1.StreamResponse.data:type_name -> types.v1.Data + 18, // 15: svc.query.v1.ListSymbolsRequest.cursor:type_name -> types.v1.Cursor + 18, // 16: svc.query.v1.ListSymbolsResponse.next:type_name -> types.v1.Cursor + 13, // 17: svc.query.v1.ListSymbolsResponse.items:type_name -> svc.query.v1.ListSymbolsResponse.ListItem + 14, // 18: svc.query.v1.SummarizeEventsResponse.Bucket.ts:type_name -> google.protobuf.Timestamp + 21, // 19: svc.query.v1.ListSymbolsResponse.ListItem.symbol:type_name -> types.v1.Symbol + 0, // 20: svc.query.v1.QueryService.SummarizeEvents:input_type -> svc.query.v1.SummarizeEventsRequest + 2, // 21: svc.query.v1.QueryService.Parse:input_type -> svc.query.v1.ParseRequest + 4, // 22: svc.query.v1.QueryService.Format:input_type -> svc.query.v1.FormatRequest + 6, // 23: svc.query.v1.QueryService.Query:input_type -> svc.query.v1.QueryRequest + 8, // 24: svc.query.v1.QueryService.Stream:input_type -> svc.query.v1.StreamRequest + 10, // 25: svc.query.v1.QueryService.ListSymbols:input_type -> svc.query.v1.ListSymbolsRequest + 1, // 26: svc.query.v1.QueryService.SummarizeEvents:output_type -> svc.query.v1.SummarizeEventsResponse + 3, // 27: svc.query.v1.QueryService.Parse:output_type -> svc.query.v1.ParseResponse + 5, // 28: svc.query.v1.QueryService.Format:output_type -> svc.query.v1.FormatResponse + 7, // 29: svc.query.v1.QueryService.Query:output_type -> svc.query.v1.QueryResponse + 9, // 30: svc.query.v1.QueryService.Stream:output_type -> svc.query.v1.StreamResponse + 11, // 31: svc.query.v1.QueryService.ListSymbols:output_type -> svc.query.v1.ListSymbolsResponse + 26, // [26:32] is the sub-list for method output_type + 20, // [20:26] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_svc_query_v1_service_proto_init() } @@ -979,6 +1000,7 @@ func file_svc_query_v1_service_proto_init() { (*FormatRequest_Raw)(nil), (*FormatRequest_Parsed)(nil), } + file_svc_query_v1_service_proto_msgTypes[6].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/go/types/v1/query_metrics.pb.go b/go/types/v1/query_metrics.pb.go new file mode 100644 index 0000000..de55554 --- /dev/null +++ b/go/types/v1/query_metrics.pb.go @@ -0,0 +1,259 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.9 +// protoc (unknown) +// source: types/v1/query_metrics.proto + +package typesv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type QueryMetrics struct { + state protoimpl.MessageState `protogen:"open.v1"` + QueryText string `protobuf:"bytes,1,opt,name=query_text,json=queryText,proto3" json:"query_text,omitempty"` + GeneratedSql string `protobuf:"bytes,2,opt,name=generated_sql,json=generatedSql,proto3" json:"generated_sql,omitempty"` + TotalLatency *durationpb.Duration `protobuf:"bytes,3,opt,name=total_latency,json=totalLatency,proto3" json:"total_latency,omitempty"` + RowsReturned int64 `protobuf:"varint,4,opt,name=rows_returned,json=rowsReturned,proto3" json:"rows_returned,omitempty"` + RowsScanned int64 `protobuf:"varint,5,opt,name=rows_scanned,json=rowsScanned,proto3" json:"rows_scanned,omitempty"` + BytesReturned int64 `protobuf:"varint,6,opt,name=bytes_returned,json=bytesReturned,proto3" json:"bytes_returned,omitempty"` + BytesScanned int64 `protobuf:"varint,7,opt,name=bytes_scanned,json=bytesScanned,proto3" json:"bytes_scanned,omitempty"` + // Detailed metrics (only included if profiling enabled) + Detailed *QueryMetrics_Detailed `protobuf:"bytes,8,opt,name=detailed,proto3" json:"detailed,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QueryMetrics) Reset() { + *x = QueryMetrics{} + mi := &file_types_v1_query_metrics_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QueryMetrics) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryMetrics) ProtoMessage() {} + +func (x *QueryMetrics) ProtoReflect() protoreflect.Message { + mi := &file_types_v1_query_metrics_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryMetrics.ProtoReflect.Descriptor instead. +func (*QueryMetrics) Descriptor() ([]byte, []int) { + return file_types_v1_query_metrics_proto_rawDescGZIP(), []int{0} +} + +func (x *QueryMetrics) GetQueryText() string { + if x != nil { + return x.QueryText + } + return "" +} + +func (x *QueryMetrics) GetGeneratedSql() string { + if x != nil { + return x.GeneratedSql + } + return "" +} + +func (x *QueryMetrics) GetTotalLatency() *durationpb.Duration { + if x != nil { + return x.TotalLatency + } + return nil +} + +func (x *QueryMetrics) GetRowsReturned() int64 { + if x != nil { + return x.RowsReturned + } + return 0 +} + +func (x *QueryMetrics) GetRowsScanned() int64 { + if x != nil { + return x.RowsScanned + } + return 0 +} + +func (x *QueryMetrics) GetBytesReturned() int64 { + if x != nil { + return x.BytesReturned + } + return 0 +} + +func (x *QueryMetrics) GetBytesScanned() int64 { + if x != nil { + return x.BytesScanned + } + return 0 +} + +func (x *QueryMetrics) GetDetailed() *QueryMetrics_Detailed { + if x != nil { + return x.Detailed + } + return nil +} + +type QueryMetrics_Detailed struct { + state protoimpl.MessageState `protogen:"open.v1"` + ExecutionPlan []byte `protobuf:"bytes,1,opt,name=execution_plan,json=executionPlan,proto3" json:"execution_plan,omitempty"` + CpuTime *durationpb.Duration `protobuf:"bytes,2,opt,name=cpu_time,json=cpuTime,proto3" json:"cpu_time,omitempty"` + MemoryPeakBytes int64 `protobuf:"varint,3,opt,name=memory_peak_bytes,json=memoryPeakBytes,proto3" json:"memory_peak_bytes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QueryMetrics_Detailed) Reset() { + *x = QueryMetrics_Detailed{} + mi := &file_types_v1_query_metrics_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QueryMetrics_Detailed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryMetrics_Detailed) ProtoMessage() {} + +func (x *QueryMetrics_Detailed) ProtoReflect() protoreflect.Message { + mi := &file_types_v1_query_metrics_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryMetrics_Detailed.ProtoReflect.Descriptor instead. +func (*QueryMetrics_Detailed) Descriptor() ([]byte, []int) { + return file_types_v1_query_metrics_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *QueryMetrics_Detailed) GetExecutionPlan() []byte { + if x != nil { + return x.ExecutionPlan + } + return nil +} + +func (x *QueryMetrics_Detailed) GetCpuTime() *durationpb.Duration { + if x != nil { + return x.CpuTime + } + return nil +} + +func (x *QueryMetrics_Detailed) GetMemoryPeakBytes() int64 { + if x != nil { + return x.MemoryPeakBytes + } + return 0 +} + +var File_types_v1_query_metrics_proto protoreflect.FileDescriptor + +const file_types_v1_query_metrics_proto_rawDesc = "" + + "\n" + + "\x1ctypes/v1/query_metrics.proto\x12\btypes.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x14types/v1/types.proto\"\xf9\x03\n" + + "\fQueryMetrics\x12\x1d\n" + + "\n" + + "query_text\x18\x01 \x01(\tR\tqueryText\x12#\n" + + "\rgenerated_sql\x18\x02 \x01(\tR\fgeneratedSql\x12>\n" + + "\rtotal_latency\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\ftotalLatency\x12#\n" + + "\rrows_returned\x18\x04 \x01(\x03R\frowsReturned\x12!\n" + + "\frows_scanned\x18\x05 \x01(\x03R\vrowsScanned\x12%\n" + + "\x0ebytes_returned\x18\x06 \x01(\x03R\rbytesReturned\x12#\n" + + "\rbytes_scanned\x18\a \x01(\x03R\fbytesScanned\x12;\n" + + "\bdetailed\x18\b \x01(\v2\x1f.types.v1.QueryMetrics.DetailedR\bdetailed\x1a\x93\x01\n" + + "\bDetailed\x12%\n" + + "\x0eexecution_plan\x18\x01 \x01(\fR\rexecutionPlan\x124\n" + + "\bcpu_time\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\acpuTime\x12*\n" + + "\x11memory_peak_bytes\x18\x03 \x01(\x03R\x0fmemoryPeakBytesB\x91\x01\n" + + "\fcom.types.v1B\x11QueryMetricsProtoP\x01Z-github.com/humanlogio/api/go/types/v1;typesv1\xa2\x02\x03TXX\xaa\x02\bTypes.V1\xca\x02\bTypes\\V1\xe2\x02\x14Types\\V1\\GPBMetadata\xea\x02\tTypes::V1b\x06proto3" + +var ( + file_types_v1_query_metrics_proto_rawDescOnce sync.Once + file_types_v1_query_metrics_proto_rawDescData []byte +) + +func file_types_v1_query_metrics_proto_rawDescGZIP() []byte { + file_types_v1_query_metrics_proto_rawDescOnce.Do(func() { + file_types_v1_query_metrics_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_types_v1_query_metrics_proto_rawDesc), len(file_types_v1_query_metrics_proto_rawDesc))) + }) + return file_types_v1_query_metrics_proto_rawDescData +} + +var file_types_v1_query_metrics_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_types_v1_query_metrics_proto_goTypes = []any{ + (*QueryMetrics)(nil), // 0: types.v1.QueryMetrics + (*QueryMetrics_Detailed)(nil), // 1: types.v1.QueryMetrics.Detailed + (*durationpb.Duration)(nil), // 2: google.protobuf.Duration +} +var file_types_v1_query_metrics_proto_depIdxs = []int32{ + 2, // 0: types.v1.QueryMetrics.total_latency:type_name -> google.protobuf.Duration + 1, // 1: types.v1.QueryMetrics.detailed:type_name -> types.v1.QueryMetrics.Detailed + 2, // 2: types.v1.QueryMetrics.Detailed.cpu_time:type_name -> google.protobuf.Duration + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_types_v1_query_metrics_proto_init() } +func file_types_v1_query_metrics_proto_init() { + if File_types_v1_query_metrics_proto != nil { + return + } + file_types_v1_types_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_types_v1_query_metrics_proto_rawDesc), len(file_types_v1_query_metrics_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_types_v1_query_metrics_proto_goTypes, + DependencyIndexes: file_types_v1_query_metrics_proto_depIdxs, + MessageInfos: file_types_v1_query_metrics_proto_msgTypes, + }.Build() + File_types_v1_query_metrics_proto = out.File + file_types_v1_query_metrics_proto_goTypes = nil + file_types_v1_query_metrics_proto_depIdxs = nil +} diff --git a/js/svc/query/v1/service_pb.ts b/js/svc/query/v1/service_pb.ts index 266ab01..08fb7c1 100644 --- a/js/svc/query/v1/service_pb.ts +++ b/js/svc/query/v1/service_pb.ts @@ -12,6 +12,8 @@ import type { Data } from "../../../types/v1/data_pb"; import { file_types_v1_data } from "../../../types/v1/data_pb"; import type { Query } from "../../../types/v1/query_pb"; import { file_types_v1_query } from "../../../types/v1/query_pb"; +import type { QueryMetrics } from "../../../types/v1/query_metrics_pb"; +import { file_types_v1_query_metrics } from "../../../types/v1/query_metrics_pb"; import { file_types_v1_session } from "../../../types/v1/session_pb"; import type { Symbol } from "../../../types/v1/symbol_pb"; import { file_types_v1_symbol } from "../../../types/v1/symbol_pb"; @@ -23,7 +25,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file svc/query/v1/service.proto. */ export const file_svc_query_v1_service: GenFile = /*@__PURE__*/ - fileDesc("ChpzdmMvcXVlcnkvdjEvc2VydmljZS5wcm90bxIMc3ZjLnF1ZXJ5LnYxIrIBChZTdW1tYXJpemVFdmVudHNSZXF1ZXN0EhYKDmVudmlyb25tZW50X2lkGAEgASgDEi0KBGZyb20YAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wSACIAQESKwoCdG8YAyABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wSAGIAQESFAoMYnVja2V0X2NvdW50GAQgASgNQgcKBV9mcm9tQgUKA190byLQAQoXU3VtbWFyaXplRXZlbnRzUmVzcG9uc2USLwoMYnVja2V0X3dpZHRoGAEgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEj0KB2J1Y2tldHMYAiADKAsyLC5zdmMucXVlcnkudjEuU3VtbWFyaXplRXZlbnRzUmVzcG9uc2UuQnVja2V0GkUKBkJ1Y2tldBImCgJ0cxgBIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASEwoLZXZlbnRfY291bnQYAiABKAQiTQoMUGFyc2VSZXF1ZXN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TdmM6OlF1ZXJ5OjpWMWIGcHJvdG8z", [file_google_protobuf_duration, file_google_protobuf_timestamp, file_types_v1_cursor, file_types_v1_data, file_types_v1_query, file_types_v1_session, file_types_v1_symbol, file_types_v1_types]); + fileDesc("ChpzdmMvcXVlcnkvdjEvc2VydmljZS5wcm90bxIMc3ZjLnF1ZXJ5LnYxIrIBChZTdW1tYXJpemVFdmVudHNSZXF1ZXN0EhYKDmVudmlyb25tZW50X2lkGAEgASgDEi0KBGZyb20YAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wSACIAQESKwoCdG8YAyABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wSAGIAQESFAoMYnVja2V0X2NvdW50GAQgASgNQgcKBV9mcm9tQgUKA190byLQAQoXU3VtbWFyaXplRXZlbnRzUmVzcG9uc2USLwoMYnVja2V0X3dpZHRoGAEgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEj0KB2J1Y2tldHMYAiADKAsyLC5zdmMucXVlcnkudjEuU3VtbWFyaXplRXZlbnRzUmVzcG9uc2UuQnVja2V0GkUKBkJ1Y2tldBImCgJ0cxgBIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASEwoLZXZlbnRfY291bnQYAiABKAQiTQoMUGFyc2VSZXF1ZXN0Eg0KBXF1ZXJ5GAEgASgJEhsKDmVudmlyb25tZW50X2lkGAIgASgDSACIAQFCEQoPX2Vudmlyb25tZW50X2lkIm8KDVBhcnNlUmVzcG9uc2USHgoFcXVlcnkYASABKAsyDy50eXBlcy52MS5RdWVyeRIwCglkYXRhX3R5cGUYAiABKAsyGC50eXBlcy52MS5EYXRhU3RyZWFtVHlwZUgAiAEBQgwKCl9kYXRhX3R5cGUiSgoNRm9ybWF0UmVxdWVzdBINCgNyYXcYASABKAlIABIhCgZwYXJzZWQYAiABKAsyDy50eXBlcy52MS5RdWVyeUgAQgcKBXF1ZXJ5IiMKDkZvcm1hdFJlc3B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XJ5U2VydmljZRJeCg9TdW1tYXJpemVFdmVudHMSJC5zdmMucXVlcnkudjEuU3VtbWFyaXplRXZlbnRzUmVxdWVzdBolLnN2Yy5xdWVyeS52MS5TdW1tYXJpemVFdmVudHNSZXNwb25zZRJACgVQYXJzZRIaLnN2Yy5xdWVyeS52MS5QYXJzZVJlcXVlc3QaGy5zdmMucXVlcnkudjEuUGFyc2VSZXNwb25zZRJDCgZGb3JtYXQSGy5zdmMucXVlcnkudjEuRm9ybWF0UmVxdWVzdBocLnN2Yy5xdWVyeS52MS5Gb3JtYXRSZXNwb25zZRJACgVRdWVyeRIaLnN2Yy5xdWVyeS52MS5RdWVyeVJlcXVlc3QaGy5zdmMucXVlcnkudjEuUXVlcnlSZXNwb25zZRJFCgZTdHJlYW0SGy5zdmMucXVlcnkudjEuU3RyZWFtUmVxdWVzdBocLnN2Yy5xdWVyeS52MS5TdHJlYW1SZXNwb25zZTABElIKC0xpc3RTeW1ib2xzEiAuc3ZjLnF1ZXJ5LnYxLkxpc3RTeW1ib2xzUmVxdWVzdBohLnN2Yy5xdWVyeS52MS5MaXN0U3ltYm9sc1Jlc3BvbnNlQqUBChBjb20uc3ZjLnF1ZXJ5LnYxQgxTZXJ2aWNlUHJvdG9QAVoxZ2l0aHViLmNvbS9odW1hbmxvZ2lvL2FwaS9nby9zdmMvcXVlcnkvdjE7cXVlcnl2MaICA1NRWKoCDFN2Yy5RdWVyeS5WMcoCDFN2Y1xRdWVyeVxWMeICGFN2Y1xRdWVyeVxWMVxHUEJNZXRhZGF0YeoCDlN2Yzo6UXVlcnk6OlYxYgZwcm90bzM", [file_google_protobuf_duration, file_google_protobuf_timestamp, file_types_v1_cursor, file_types_v1_data, file_types_v1_query, file_types_v1_query_metrics, file_types_v1_session, file_types_v1_symbol, file_types_v1_types]); /** * @generated from message svc.query.v1.SummarizeEventsRequest @@ -220,6 +222,11 @@ export type QueryRequest = Message<"svc.query.v1.QueryRequest"> & { * @generated from field: types.v1.Query query = 2; */ query?: Query; + + /** + * @generated from field: optional bool include_detailed_profiling = 304; + */ + includeDetailedProfiling?: boolean; }; /** @@ -242,6 +249,11 @@ export type QueryResponse = Message<"svc.query.v1.QueryResponse"> & { * @generated from field: types.v1.Data data = 200; */ data?: Data; + + /** + * @generated from field: types.v1.QueryMetrics metrics = 300; + */ + metrics?: QueryMetrics; }; /** diff --git a/js/types/v1/query_metrics_pb.ts b/js/types/v1/query_metrics_pb.ts new file mode 100644 index 0000000..98a8421 --- /dev/null +++ b/js/types/v1/query_metrics_pb.ts @@ -0,0 +1,98 @@ +// @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=none" +// @generated from file types/v1/query_metrics.proto (package types.v1, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Duration } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_duration } from "@bufbuild/protobuf/wkt"; +import { file_types_v1_types } from "./types_pb"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file types/v1/query_metrics.proto. + */ +export const file_types_v1_query_metrics: GenFile = /*@__PURE__*/ + fileDesc("Chx0eXBlcy92MS9xdWVyeV9tZXRyaWNzLnByb3RvEgh0eXBlcy52MSLmAgoMUXVlcnlNZXRyaWNzEhIKCnF1ZXJ5X3RleHQYASABKAkSFQoNZ2VuZXJhdGVkX3NxbBgCIAEoCRIwCg10b3RhbF9sYXRlbmN5GAMgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEhUKDXJvd3NfcmV0dXJuZWQYBCABKAMSFAoMcm93c19zY2FubmVkGAUgASgDEhYKDmJ5dGVzX3JldHVybmVkGAYgASgDEhUKDWJ5dGVzX3NjYW5uZWQYByABKAMSMQoIZGV0YWlsZWQYCCABKAsyHy50eXBlcy52MS5RdWVyeU1ldHJpY3MuRGV0YWlsZWQaagoIRGV0YWlsZWQSFgoOZXhlY3V0aW9uX3BsYW4YASABKAwSKwoIY3B1X3RpbWUYAiABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SGQoRbWVtb3J5X3BlYWtfYnl0ZXMYAyABKANCkQEKDGNvbS50eXBlcy52MUIRUXVlcnlNZXRyaWNzUHJvdG9QAVotZ2l0aHViLmNvbS9odW1hbmxvZ2lvL2FwaS9nby90eXBlcy92MTt0eXBlc3YxogIDVFhYqgIIVHlwZXMuVjHKAghUeXBlc1xWMeICFFR5cGVzXFYxXEdQQk1ldGFkYXRh6gIJVHlwZXM6OlYxYgZwcm90bzM", [file_google_protobuf_duration, file_types_v1_types]); + +/** + * @generated from message types.v1.QueryMetrics + */ +export type QueryMetrics = Message<"types.v1.QueryMetrics"> & { + /** + * @generated from field: string query_text = 1; + */ + queryText: string; + + /** + * @generated from field: string generated_sql = 2; + */ + generatedSql: string; + + /** + * @generated from field: google.protobuf.Duration total_latency = 3; + */ + totalLatency?: Duration; + + /** + * @generated from field: int64 rows_returned = 4; + */ + rowsReturned: bigint; + + /** + * @generated from field: int64 rows_scanned = 5; + */ + rowsScanned: bigint; + + /** + * @generated from field: int64 bytes_returned = 6; + */ + bytesReturned: bigint; + + /** + * @generated from field: int64 bytes_scanned = 7; + */ + bytesScanned: bigint; + + /** + * Detailed metrics (only included if profiling enabled) + * + * @generated from field: types.v1.QueryMetrics.Detailed detailed = 8; + */ + detailed?: QueryMetrics_Detailed; +}; + +/** + * Describes the message types.v1.QueryMetrics. + * Use `create(QueryMetricsSchema)` to create a new message. + */ +export const QueryMetricsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_types_v1_query_metrics, 0); + +/** + * @generated from message types.v1.QueryMetrics.Detailed + */ +export type QueryMetrics_Detailed = Message<"types.v1.QueryMetrics.Detailed"> & { + /** + * @generated from field: bytes execution_plan = 1; + */ + executionPlan: Uint8Array; + + /** + * @generated from field: google.protobuf.Duration cpu_time = 2; + */ + cpuTime?: Duration; + + /** + * @generated from field: int64 memory_peak_bytes = 3; + */ + memoryPeakBytes: bigint; +}; + +/** + * Describes the message types.v1.QueryMetrics.Detailed. + * Use `create(QueryMetrics_DetailedSchema)` to create a new message. + */ +export const QueryMetrics_DetailedSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_types_v1_query_metrics, 0, 0); + diff --git a/proto/svc/query/v1/service.proto b/proto/svc/query/v1/service.proto index 25f4ac2..2cbc4ab 100644 --- a/proto/svc/query/v1/service.proto +++ b/proto/svc/query/v1/service.proto @@ -7,6 +7,7 @@ import "google/protobuf/timestamp.proto"; import "types/v1/cursor.proto"; import "types/v1/data.proto"; import "types/v1/query.proto"; +import "types/v1/query_metrics.proto"; import "types/v1/session.proto"; import "types/v1/symbol.proto"; import "types/v1/types.proto"; @@ -76,11 +77,13 @@ message QueryRequest { types.v1.Cursor cursor = 102; int32 limit = 103; types.v1.Query query = 2; + optional bool include_detailed_profiling = 304; } message QueryResponse { types.v1.Cursor next = 100; types.v1.Data data = 200; + types.v1.QueryMetrics metrics = 300; } message StreamRequest { diff --git a/proto/types/v1/query_metrics.proto b/proto/types/v1/query_metrics.proto new file mode 100644 index 0000000..2e75242 --- /dev/null +++ b/proto/types/v1/query_metrics.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package types.v1; + +import "google/protobuf/duration.proto"; +import "types/v1/types.proto"; + +option go_package = "types/v1;typesv1"; + +message QueryMetrics { + string query_text = 1; + string generated_sql = 2; + + google.protobuf.Duration total_latency = 3; + int64 rows_returned = 4; + int64 rows_scanned = 5; + int64 bytes_returned = 6; + int64 bytes_scanned = 7; + + message Detailed { + bytes execution_plan = 1; + google.protobuf.Duration cpu_time = 2; + int64 memory_peak_bytes = 3; + } + + // Detailed metrics (only included if profiling enabled) + Detailed detailed = 8; +}