Introduce profiling API

- migrate to buf v1 format
- remove obsolete options as they can be added from buf.gen.yaml
This commit is contained in:
Peter 2021-11-17 15:40:56 +01:00
parent e7e9e82667
commit d742b08c21
8 changed files with 48 additions and 50 deletions

View file

@ -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

View file

@ -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;

View file

@ -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";

View file

@ -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;

10
proto/buf.yaml Normal file
View file

@ -0,0 +1,10 @@
version: v1
breaking:
use:
- FILE
lint:
use:
- DEFAULT
except:
- PACKAGE_DIRECTORY_MATCH
allow_comment_ignores: true

View file

@ -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 {

View file

@ -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 {}

38
proto/rpc/v1/pprof.proto Normal file
View file

@ -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);
}