Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterBenchmarkServiceServer(s grpc.ServiceRegistrar, srv BenchmarkServiceServer)
- type BenchmarkServiceClient
- type BenchmarkServiceServer
- type BenchmarkService_ExecuteClient
- type BenchmarkService_ExecuteServer
- type CheckConnectionRequest
- func (*CheckConnectionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CheckConnectionRequest) GetUrl() string
- func (*CheckConnectionRequest) ProtoMessage()
- func (x *CheckConnectionRequest) ProtoReflect() protoreflect.Message
- func (x *CheckConnectionRequest) Reset()
- func (x *CheckConnectionRequest) String() string
- type CheckConnectionResponse
- func (*CheckConnectionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CheckConnectionResponse) GetErrorMessage() string
- func (x *CheckConnectionResponse) GetOk() bool
- func (*CheckConnectionResponse) ProtoMessage()
- func (x *CheckConnectionResponse) ProtoReflect() protoreflect.Message
- func (x *CheckConnectionResponse) Reset()
- func (x *CheckConnectionResponse) String() string
- type ExecuteRequest
- func (*ExecuteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ExecuteRequest) GetContestSlug() string
- func (x *ExecuteRequest) GetGroupId() string
- func (x *ExecuteRequest) GetTasks() []*Task
- func (x *ExecuteRequest) GetTimeLimitPerTask() int64
- func (x *ExecuteRequest) GetValidator() backend.Validator
- func (*ExecuteRequest) ProtoMessage()
- func (x *ExecuteRequest) ProtoReflect() protoreflect.Message
- func (x *ExecuteRequest) Reset()
- func (x *ExecuteRequest) String() string
- type ExecuteResponse
- func (*ExecuteResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ExecuteResponse) GetErrorMessage() string
- func (x *ExecuteResponse) GetOk() bool
- func (x *ExecuteResponse) GetRequestsPerSecond() int32
- func (x *ExecuteResponse) GetStatus() backend.Status
- func (x *ExecuteResponse) GetTask() *Task
- func (x *ExecuteResponse) GetTimeElapsed() int64
- func (x *ExecuteResponse) GetTotalRequests() int32
- func (*ExecuteResponse) ProtoMessage()
- func (x *ExecuteResponse) ProtoReflect() protoreflect.Message
- func (x *ExecuteResponse) Reset()
- func (x *ExecuteResponse) String() string
- type HttpMethod
- type HttpRequest
- func (*HttpRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HttpRequest) GetBody() string
- func (x *HttpRequest) GetContentType() string
- func (x *HttpRequest) GetMethod() HttpMethod
- func (x *HttpRequest) GetUrl() string
- func (*HttpRequest) ProtoMessage()
- func (x *HttpRequest) ProtoReflect() protoreflect.Message
- func (x *HttpRequest) Reset()
- func (x *HttpRequest) String() string
- type Task
- func (*Task) Descriptor() ([]byte, []int)deprecated
- func (x *Task) GetAttemptCount() int32
- func (x *Task) GetRequest() *HttpRequest
- func (x *Task) GetThreadNum() int32
- func (*Task) ProtoMessage()
- func (x *Task) ProtoReflect() protoreflect.Message
- func (x *Task) Reset()
- func (x *Task) String() string
- type UnimplementedBenchmarkServiceServer
- type UnsafeBenchmarkServiceServer
Constants ¶
const ( BenchmarkService_Execute_FullMethodName = "/benchmark.BenchmarkService/Execute" BenchmarkService_CheckConnection_FullMethodName = "/benchmark.BenchmarkService/CheckConnection" )
Variables ¶
var ( HttpMethod_name = map[int32]string{ 0: "GET", 1: "POST", 2: "PUT", 3: "DELETE", } HttpMethod_value = map[string]int32{ "GET": 0, "POST": 1, "PUT": 2, "DELETE": 3, } )
Enum value maps for HttpMethod.
var BenchmarkService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "benchmark.BenchmarkService", HandlerType: (*BenchmarkServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CheckConnection", Handler: _BenchmarkService_CheckConnection_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Execute", Handler: _BenchmarkService_Execute_Handler, ServerStreams: true, }, }, Metadata: "services/benchmark-service/services.proto", }
BenchmarkService_ServiceDesc is the grpc.ServiceDesc for BenchmarkService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_services_benchmark_service_messages_proto protoreflect.FileDescriptor
var File_services_benchmark_service_services_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBenchmarkServiceServer ¶
func RegisterBenchmarkServiceServer(s grpc.ServiceRegistrar, srv BenchmarkServiceServer)
Types ¶
type BenchmarkServiceClient ¶
type BenchmarkServiceClient interface { Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (BenchmarkService_ExecuteClient, error) CheckConnection(ctx context.Context, in *CheckConnectionRequest, opts ...grpc.CallOption) (*CheckConnectionResponse, error) }
BenchmarkServiceClient is the client API for BenchmarkService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewBenchmarkServiceClient ¶
func NewBenchmarkServiceClient(cc grpc.ClientConnInterface) BenchmarkServiceClient
type BenchmarkServiceServer ¶
type BenchmarkServiceServer interface { Execute(*ExecuteRequest, BenchmarkService_ExecuteServer) error CheckConnection(context.Context, *CheckConnectionRequest) (*CheckConnectionResponse, error) }
BenchmarkServiceServer is the server API for BenchmarkService service. All implementations should embed UnimplementedBenchmarkServiceServer for forward compatibility
type BenchmarkService_ExecuteClient ¶
type BenchmarkService_ExecuteClient interface { Recv() (*ExecuteResponse, error) grpc.ClientStream }
type BenchmarkService_ExecuteServer ¶
type BenchmarkService_ExecuteServer interface { Send(*ExecuteResponse) error grpc.ServerStream }
type CheckConnectionRequest ¶
type CheckConnectionRequest struct { Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // contains filtered or unexported fields }
func (*CheckConnectionRequest) Descriptor
deprecated
func (*CheckConnectionRequest) Descriptor() ([]byte, []int)
Deprecated: Use CheckConnectionRequest.ProtoReflect.Descriptor instead.
func (*CheckConnectionRequest) GetUrl ¶
func (x *CheckConnectionRequest) GetUrl() string
func (*CheckConnectionRequest) ProtoMessage ¶
func (*CheckConnectionRequest) ProtoMessage()
func (*CheckConnectionRequest) ProtoReflect ¶
func (x *CheckConnectionRequest) ProtoReflect() protoreflect.Message
func (*CheckConnectionRequest) Reset ¶
func (x *CheckConnectionRequest) Reset()
func (*CheckConnectionRequest) String ¶
func (x *CheckConnectionRequest) String() string
type CheckConnectionResponse ¶
type CheckConnectionResponse struct { Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"` ErrorMessage *string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3,oneof" json:"error_message,omitempty"` // if ok is false, this field is set // contains filtered or unexported fields }
func (*CheckConnectionResponse) Descriptor
deprecated
func (*CheckConnectionResponse) Descriptor() ([]byte, []int)
Deprecated: Use CheckConnectionResponse.ProtoReflect.Descriptor instead.
func (*CheckConnectionResponse) GetErrorMessage ¶
func (x *CheckConnectionResponse) GetErrorMessage() string
func (*CheckConnectionResponse) GetOk ¶
func (x *CheckConnectionResponse) GetOk() bool
func (*CheckConnectionResponse) ProtoMessage ¶
func (*CheckConnectionResponse) ProtoMessage()
func (*CheckConnectionResponse) ProtoReflect ¶
func (x *CheckConnectionResponse) ProtoReflect() protoreflect.Message
func (*CheckConnectionResponse) Reset ¶
func (x *CheckConnectionResponse) Reset()
func (*CheckConnectionResponse) String ¶
func (x *CheckConnectionResponse) String() string
type ExecuteRequest ¶
type ExecuteRequest struct { Tasks []*Task `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"` GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` // for logging ContestSlug string `protobuf:"bytes,3,opt,name=contest_slug,json=contestSlug,proto3" json:"contest_slug,omitempty"` Validator backend.Validator `protobuf:"varint,4,opt,name=validator,proto3,enum=backend.Validator" json:"validator,omitempty"` TimeLimitPerTask int64 `protobuf:"varint,5,opt,name=time_limit_per_task,json=timeLimitPerTask,proto3" json:"time_limit_per_task,omitempty"` // must use as duration // contains filtered or unexported fields }
func (*ExecuteRequest) Descriptor
deprecated
func (*ExecuteRequest) Descriptor() ([]byte, []int)
Deprecated: Use ExecuteRequest.ProtoReflect.Descriptor instead.
func (*ExecuteRequest) GetContestSlug ¶
func (x *ExecuteRequest) GetContestSlug() string
func (*ExecuteRequest) GetGroupId ¶
func (x *ExecuteRequest) GetGroupId() string
func (*ExecuteRequest) GetTasks ¶
func (x *ExecuteRequest) GetTasks() []*Task
func (*ExecuteRequest) GetTimeLimitPerTask ¶
func (x *ExecuteRequest) GetTimeLimitPerTask() int64
func (*ExecuteRequest) GetValidator ¶
func (x *ExecuteRequest) GetValidator() backend.Validator
func (*ExecuteRequest) ProtoMessage ¶
func (*ExecuteRequest) ProtoMessage()
func (*ExecuteRequest) ProtoReflect ¶
func (x *ExecuteRequest) ProtoReflect() protoreflect.Message
func (*ExecuteRequest) Reset ¶
func (x *ExecuteRequest) Reset()
func (*ExecuteRequest) String ¶
func (x *ExecuteRequest) String() string
type ExecuteResponse ¶
type ExecuteResponse struct { Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"` ErrorMessage *string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3,oneof" json:"error_message,omitempty"` // if ok is false, this field is set TimeElapsed int64 `protobuf:"varint,3,opt,name=time_elapsed,json=timeElapsed,proto3" json:"time_elapsed,omitempty"` // in milliseconds TotalRequests int32 `protobuf:"varint,4,opt,name=total_requests,json=totalRequests,proto3" json:"total_requests,omitempty"` RequestsPerSecond int32 `protobuf:"varint,5,opt,name=requests_per_second,json=requestsPerSecond,proto3" json:"requests_per_second,omitempty"` Task *Task `protobuf:"bytes,6,opt,name=task,proto3" json:"task,omitempty"` Status backend.Status `protobuf:"varint,7,opt,name=status,proto3,enum=backend.Status" json:"status,omitempty"` // contains filtered or unexported fields }
func (*ExecuteResponse) Descriptor
deprecated
func (*ExecuteResponse) Descriptor() ([]byte, []int)
Deprecated: Use ExecuteResponse.ProtoReflect.Descriptor instead.
func (*ExecuteResponse) GetErrorMessage ¶
func (x *ExecuteResponse) GetErrorMessage() string
func (*ExecuteResponse) GetOk ¶
func (x *ExecuteResponse) GetOk() bool
func (*ExecuteResponse) GetRequestsPerSecond ¶
func (x *ExecuteResponse) GetRequestsPerSecond() int32
func (*ExecuteResponse) GetStatus ¶
func (x *ExecuteResponse) GetStatus() backend.Status
func (*ExecuteResponse) GetTask ¶
func (x *ExecuteResponse) GetTask() *Task
func (*ExecuteResponse) GetTimeElapsed ¶
func (x *ExecuteResponse) GetTimeElapsed() int64
func (*ExecuteResponse) GetTotalRequests ¶
func (x *ExecuteResponse) GetTotalRequests() int32
func (*ExecuteResponse) ProtoMessage ¶
func (*ExecuteResponse) ProtoMessage()
func (*ExecuteResponse) ProtoReflect ¶
func (x *ExecuteResponse) ProtoReflect() protoreflect.Message
func (*ExecuteResponse) Reset ¶
func (x *ExecuteResponse) Reset()
func (*ExecuteResponse) String ¶
func (x *ExecuteResponse) String() string
type HttpMethod ¶
type HttpMethod int32
const ( HttpMethod_GET HttpMethod = 0 HttpMethod_POST HttpMethod = 1 HttpMethod_PUT HttpMethod = 2 HttpMethod_DELETE HttpMethod = 3 )
func (HttpMethod) Descriptor ¶
func (HttpMethod) Descriptor() protoreflect.EnumDescriptor
func (HttpMethod) Enum ¶
func (x HttpMethod) Enum() *HttpMethod
func (HttpMethod) EnumDescriptor
deprecated
func (HttpMethod) EnumDescriptor() ([]byte, []int)
Deprecated: Use HttpMethod.Descriptor instead.
func (HttpMethod) Number ¶
func (x HttpMethod) Number() protoreflect.EnumNumber
func (HttpMethod) String ¶
func (x HttpMethod) String() string
func (HttpMethod) Type ¶
func (HttpMethod) Type() protoreflect.EnumType
type HttpRequest ¶
type HttpRequest struct { Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // e.g.) http://10.255.255.255/endpoint Method HttpMethod `protobuf:"varint,2,opt,name=method,proto3,enum=benchmark.HttpMethod" json:"method,omitempty"` ContentType string `protobuf:"bytes,4,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` Body string `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
func (*HttpRequest) Descriptor
deprecated
func (*HttpRequest) Descriptor() ([]byte, []int)
Deprecated: Use HttpRequest.ProtoReflect.Descriptor instead.
func (*HttpRequest) GetBody ¶
func (x *HttpRequest) GetBody() string
func (*HttpRequest) GetContentType ¶
func (x *HttpRequest) GetContentType() string
func (*HttpRequest) GetMethod ¶
func (x *HttpRequest) GetMethod() HttpMethod
func (*HttpRequest) GetUrl ¶
func (x *HttpRequest) GetUrl() string
func (*HttpRequest) ProtoMessage ¶
func (*HttpRequest) ProtoMessage()
func (*HttpRequest) ProtoReflect ¶
func (x *HttpRequest) ProtoReflect() protoreflect.Message
func (*HttpRequest) Reset ¶
func (x *HttpRequest) Reset()
func (*HttpRequest) String ¶
func (x *HttpRequest) String() string
type Task ¶
type Task struct { Request *HttpRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` ThreadNum int32 `protobuf:"varint,6,opt,name=thread_num,json=threadNum,proto3" json:"thread_num,omitempty"` // the number of threads for a task AttemptCount int32 `protobuf:"varint,7,opt,name=attempt_count,json=attemptCount,proto3" json:"attempt_count,omitempty"` // the count of attempting for a task // contains filtered or unexported fields }
func (*Task) Descriptor
deprecated
func (*Task) GetAttemptCount ¶
func (*Task) GetRequest ¶
func (x *Task) GetRequest() *HttpRequest
func (*Task) GetThreadNum ¶
func (*Task) ProtoMessage ¶
func (*Task) ProtoMessage()
func (*Task) ProtoReflect ¶
func (x *Task) ProtoReflect() protoreflect.Message
type UnimplementedBenchmarkServiceServer ¶
type UnimplementedBenchmarkServiceServer struct { }
UnimplementedBenchmarkServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedBenchmarkServiceServer) CheckConnection ¶
func (UnimplementedBenchmarkServiceServer) CheckConnection(context.Context, *CheckConnectionRequest) (*CheckConnectionResponse, error)
func (UnimplementedBenchmarkServiceServer) Execute ¶
func (UnimplementedBenchmarkServiceServer) Execute(*ExecuteRequest, BenchmarkService_ExecuteServer) error
type UnsafeBenchmarkServiceServer ¶
type UnsafeBenchmarkServiceServer interface {
// contains filtered or unexported methods
}
UnsafeBenchmarkServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BenchmarkServiceServer will result in compilation errors.