From d742b08c21003e610c31ca7767817c5ddbeba8bf Mon Sep 17 00:00:00 2001 From: Peter Kurfer Date: Wed, 17 Nov 2021 15:40:56 +0100 Subject: [PATCH] Introduce profiling API - migrate to buf v1 format - remove obsolete options as they can be added from buf.gen.yaml --- buf.yaml | 20 ---------------- proto/audit/v1/dns_details.proto | 6 ----- proto/audit/v1/event_entity.proto | 6 ----- proto/audit/v1/http_details.proto | 6 ----- proto/buf.yaml | 10 ++++++++ proto/rpc/v1/audit.proto | 6 ----- proto/rpc/v1/pcap.proto | 6 ----- proto/rpc/v1/pprof.proto | 38 +++++++++++++++++++++++++++++++ 8 files changed, 48 insertions(+), 50 deletions(-) delete mode 100644 buf.yaml create mode 100644 proto/buf.yaml create mode 100644 proto/rpc/v1/pprof.proto diff --git a/buf.yaml b/buf.yaml deleted file mode 100644 index 1a3861e..0000000 --- a/buf.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Below is not the lint and breaking configuration we recommend! -# This just just what googleapis passes. -# For lint, we recommend having the single value "DEFAULT" in "use" -# with no values in "except". -# For breaking, we recommend having the single value "FILE" in use. -# See https://docs.buf.build/lint-usage -# See https://docs.buf.build/breaking-usage -version: v1beta1 -build: - roots: - - proto -lint: - use: - - DEFAULT - except: - - PACKAGE_DIRECTORY_MATCH - allow_comment_ignores: true -breaking: - use: - - FILE diff --git a/proto/audit/v1/dns_details.proto b/proto/audit/v1/dns_details.proto index e85b978..5b499ad 100644 --- a/proto/audit/v1/dns_details.proto +++ b/proto/audit/v1/dns_details.proto @@ -2,12 +2,6 @@ syntax = "proto3"; package inetmock.audit.v1; -option csharp_namespace = "INetMock.Client.Audit"; -option go_package = "gitlab.com/inetmock/inetmock/pkg/audit/v1"; -option java_multiple_files = true; -option java_outer_classname = "HandlerEventProto"; -option java_package = "com.github.baez90.inetmock.audit"; - enum DNSOpCode { //buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX DNS_OP_CODE_QUERY = 0; diff --git a/proto/audit/v1/event_entity.proto b/proto/audit/v1/event_entity.proto index d11c08e..c44e4ab 100644 --- a/proto/audit/v1/event_entity.proto +++ b/proto/audit/v1/event_entity.proto @@ -2,12 +2,6 @@ syntax = "proto3"; package inetmock.audit.v1; -option csharp_namespace = "INetMock.Client.Audit"; -option go_package = "gitlab.com/inetmock/inetmock/pkg/audit/v1"; -option java_multiple_files = true; -option java_outer_classname = "HandlerEventProto"; -option java_package = "com.github.baez90.inetmock.audit"; - import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/audit/v1/http_details.proto b/proto/audit/v1/http_details.proto index 6d55bfa..0f62c0c 100644 --- a/proto/audit/v1/http_details.proto +++ b/proto/audit/v1/http_details.proto @@ -2,12 +2,6 @@ syntax = "proto3"; package inetmock.audit.v1; -option csharp_namespace = "INetMock.Client.Audit"; -option go_package = "gitlab.com/inetmock/inetmock/pkg/audit/v1"; -option java_multiple_files = true; -option java_outer_classname = "HandlerEventProto"; -option java_package = "com.github.baez90.inetmock.audit"; - enum HTTPMethod { HTTP_METHOD_UNSPECIFIED = 0; HTTP_METHOD_GET = 1; diff --git a/proto/buf.yaml b/proto/buf.yaml new file mode 100644 index 0000000..e3198e7 --- /dev/null +++ b/proto/buf.yaml @@ -0,0 +1,10 @@ +version: v1 +breaking: + use: + - FILE +lint: + use: + - DEFAULT + except: + - PACKAGE_DIRECTORY_MATCH + allow_comment_ignores: true diff --git a/proto/rpc/v1/audit.proto b/proto/rpc/v1/audit.proto index 03a6459..6927383 100644 --- a/proto/rpc/v1/audit.proto +++ b/proto/rpc/v1/audit.proto @@ -2,12 +2,6 @@ syntax = "proto3"; package inetmock.rpc.v1; -option csharp_namespace = "INetMock.Client.Rpc"; -option go_package = "gitlab.com/inetmock/inetmock/pkg/rpc/v1"; -option java_multiple_files = true; -option java_outer_classname = "AuditProto"; -option java_package = "com.github.baez90.inetmock.rpc"; - import "audit/v1/event_entity.proto"; message WatchEventsRequest { diff --git a/proto/rpc/v1/pcap.proto b/proto/rpc/v1/pcap.proto index 3d8e169..7660938 100644 --- a/proto/rpc/v1/pcap.proto +++ b/proto/rpc/v1/pcap.proto @@ -2,12 +2,6 @@ syntax = "proto3"; package inetmock.rpc.v1; -option csharp_namespace = "INetMock.Client.Rpc"; -option go_package = "gitlab.com/inetmock/inetmock/pkg/rpc/v1"; -option java_multiple_files = true; -option java_outer_classname = "AuditProto"; -option java_package = "com.github.baez90.inetmock.rpc"; - import "google/protobuf/duration.proto"; message ListAvailableDevicesRequest {} diff --git a/proto/rpc/v1/pprof.proto b/proto/rpc/v1/pprof.proto new file mode 100644 index 0000000..520779d --- /dev/null +++ b/proto/rpc/v1/pprof.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package inetmock.rpc.v1; + +import "google/protobuf/duration.proto"; + +message ProfileDumpRequest { + string profile_name = 1; + int32 debug = 2; + // this applies only for 'heap' profile + bool gc_before_dump = 3; +} + +message ProfileDumpResponse { + bytes profile_data = 1; +} + +message CPUProfileRequest { + google.protobuf.Duration profile_duration = 1; +} + +message CPUProfileResponse { + bytes profile_data = 1; +} + +message TraceRequest { + google.protobuf.Duration trace_duration = 1; +} + +message TraceResponse { + bytes profile_data = 1; +} + +service ProfilingService { + rpc ProfileDump(ProfileDumpRequest) returns (ProfileDumpResponse); + rpc CPUProfile(CPUProfileRequest) returns (CPUProfileResponse); + rpc Trace(TraceRequest) returns (TraceResponse); +}