Documentation ¶
Index ¶
- Variables
- func RegisterMasterServer(s grpc.ServiceRegistrar, srv MasterServer)
- type Code
- type MasterClient
- type MasterReq
- type MasterResp
- func (*MasterResp) Descriptor() ([]byte, []int)deprecated
- func (x *MasterResp) GetCurrentUsers() int32
- func (x *MasterResp) GetState() int32
- func (x *MasterResp) GetTargetUsers() int64
- func (x *MasterResp) GetWorkers() int32
- func (*MasterResp) ProtoMessage()
- func (x *MasterResp) ProtoReflect() protoreflect.Message
- func (x *MasterResp) Reset()
- func (x *MasterResp) String() string
- type MasterServer
- type Profile
- func (*Profile) Descriptor() ([]byte, []int)deprecated
- func (x *Profile) GetCPUProfile() string
- func (x *Profile) GetCPUProfileDuration() int64
- func (x *Profile) GetDisableCompression() bool
- func (x *Profile) GetDisableConsoleOutput() bool
- func (x *Profile) GetDisableKeepalive() bool
- func (x *Profile) GetID() uint64
- func (x *Profile) GetLoopCount() int64
- func (x *Profile) GetMaxRPS() int64
- func (x *Profile) GetMemoryProfile() string
- func (x *Profile) GetMemoryProfileDuration() int64
- func (x *Profile) GetPrometheusPushgatewayURL() string
- func (x *Profile) GetRequestIncreaseRate() string
- func (x *Profile) GetRunTime() int64
- func (x *Profile) GetSpawnCount() int64
- func (x *Profile) GetSpawnRate() float64
- func (*Profile) ProtoMessage()
- func (x *Profile) ProtoReflect() protoreflect.Message
- func (x *Profile) Reset()
- func (x *Profile) String() string
- type QuitReq
- type QuitResp
- type RebalanceReq
- func (*RebalanceReq) Descriptor() ([]byte, []int)deprecated
- func (x *RebalanceReq) GetSpawnCount() int64
- func (x *RebalanceReq) GetSpawnRate() float64
- func (*RebalanceReq) ProtoMessage()
- func (x *RebalanceReq) ProtoReflect() protoreflect.Message
- func (x *RebalanceReq) Reset()
- func (x *RebalanceReq) String() string
- type RebalanceResp
- type Resp
- type StartReq
- type StartResp
- type StopReq
- type StopResp
- type UnimplementedMasterServer
- func (UnimplementedMasterServer) Master(context.Context, *MasterReq) (*MasterResp, error)
- func (UnimplementedMasterServer) Quit(context.Context, *QuitReq) (*QuitResp, error)
- func (UnimplementedMasterServer) Rebalance(context.Context, *RebalanceReq) (*RebalanceResp, error)
- func (UnimplementedMasterServer) Start(context.Context, *StartReq) (*StartResp, error)
- func (UnimplementedMasterServer) Stop(context.Context, *StopReq) (*StopResp, error)
- func (UnimplementedMasterServer) Work(context.Context, *WorkReq) (*WorkResp, error)
- type UnsafeMasterServer
- type Work
- func (*Work) Descriptor() ([]byte, []int)deprecated
- func (x *Work) GetArch() string
- func (x *Work) GetCpuUsage() float64
- func (x *Work) GetCpuWarningEmitted() bool
- func (x *Work) GetHeartbeat() int32
- func (x *Work) GetId() string
- func (x *Work) GetIp() string
- func (x *Work) GetMemoryUsage() float64
- func (x *Work) GetOs() string
- func (x *Work) GetState() int32
- func (x *Work) GetUserCount() int64
- func (x *Work) GetWorkerCpuUsage() float64
- func (x *Work) GetWorkerMemoryUsage() float64
- func (*Work) ProtoMessage()
- func (x *Work) ProtoReflect() protoreflect.Message
- func (x *Work) Reset()
- func (x *Work) String() string
- type WorkReq
- type WorkResp
Constants ¶
This section is empty.
Variables ¶
var ( Code_name = map[int32]string{ 0: "OK", 1: "ERROR", } Code_value = map[string]int32{ "OK": 0, "ERROR": 1, } )
Enum value maps for Code.
var File_master_proto protoreflect.FileDescriptor
var Master_ServiceDesc = grpc.ServiceDesc{ ServiceName: "master.Master", HandlerType: (*MasterServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "start", Handler: _Master_Start_Handler, }, { MethodName: "rebalance", Handler: _Master_Rebalance_Handler, }, { MethodName: "work", Handler: _Master_Work_Handler, }, { MethodName: "master", Handler: _Master_Master_Handler, }, { MethodName: "stop", Handler: _Master_Stop_Handler, }, { MethodName: "Quit", Handler: _Master_Quit_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "master.proto", }
Master_ServiceDesc is the grpc.ServiceDesc for Master service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMasterServer ¶
func RegisterMasterServer(s grpc.ServiceRegistrar, srv MasterServer)
Types ¶
type Code ¶
type Code int32
func (Code) Descriptor ¶
func (Code) Descriptor() protoreflect.EnumDescriptor
func (Code) EnumDescriptor
deprecated
func (Code) Number ¶
func (x Code) Number() protoreflect.EnumNumber
func (Code) Type ¶
func (Code) Type() protoreflect.EnumType
type MasterClient ¶
type MasterClient interface { Start(ctx context.Context, in *StartReq, opts ...grpc.CallOption) (*StartResp, error) Rebalance(ctx context.Context, in *RebalanceReq, opts ...grpc.CallOption) (*RebalanceResp, error) Work(ctx context.Context, in *WorkReq, opts ...grpc.CallOption) (*WorkResp, error) Master(ctx context.Context, in *MasterReq, opts ...grpc.CallOption) (*MasterResp, error) Stop(ctx context.Context, in *StopReq, opts ...grpc.CallOption) (*StopResp, error) Quit(ctx context.Context, in *QuitReq, opts ...grpc.CallOption) (*QuitResp, error) }
MasterClient is the client API for Master 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 NewMasterClient ¶
func NewMasterClient(cc grpc.ClientConnInterface) MasterClient
type MasterReq ¶
type MasterReq struct {
// contains filtered or unexported fields
}
func (*MasterReq) Descriptor
deprecated
func (*MasterReq) ProtoMessage ¶
func (*MasterReq) ProtoMessage()
func (*MasterReq) ProtoReflect ¶
func (x *MasterReq) ProtoReflect() protoreflect.Message
type MasterResp ¶
type MasterResp struct { State int32 `protobuf:"varint,1,opt,name=State,proto3" json:"State,omitempty"` Workers int32 `protobuf:"varint,2,opt,name=workers,proto3" json:"workers,omitempty"` TargetUsers int64 `protobuf:"varint,3,opt,name=target_users,json=targetUsers,proto3" json:"target_users,omitempty"` CurrentUsers int32 `protobuf:"varint,4,opt,name=current_users,json=currentUsers,proto3" json:"current_users,omitempty"` // contains filtered or unexported fields }
func (*MasterResp) Descriptor
deprecated
func (*MasterResp) Descriptor() ([]byte, []int)
Deprecated: Use MasterResp.ProtoReflect.Descriptor instead.
func (*MasterResp) GetCurrentUsers ¶
func (x *MasterResp) GetCurrentUsers() int32
func (*MasterResp) GetState ¶
func (x *MasterResp) GetState() int32
func (*MasterResp) GetTargetUsers ¶
func (x *MasterResp) GetTargetUsers() int64
func (*MasterResp) GetWorkers ¶
func (x *MasterResp) GetWorkers() int32
func (*MasterResp) ProtoMessage ¶
func (*MasterResp) ProtoMessage()
func (*MasterResp) ProtoReflect ¶
func (x *MasterResp) ProtoReflect() protoreflect.Message
func (*MasterResp) Reset ¶
func (x *MasterResp) Reset()
func (*MasterResp) String ¶
func (x *MasterResp) String() string
type MasterServer ¶
type MasterServer interface { Start(context.Context, *StartReq) (*StartResp, error) Rebalance(context.Context, *RebalanceReq) (*RebalanceResp, error) Work(context.Context, *WorkReq) (*WorkResp, error) Master(context.Context, *MasterReq) (*MasterResp, error) Stop(context.Context, *StopReq) (*StopResp, error) Quit(context.Context, *QuitReq) (*QuitResp, error) // contains filtered or unexported methods }
MasterServer is the server API for Master service. All implementations must embed UnimplementedMasterServer for forward compatibility
type Profile ¶
type Profile struct { SpawnCount int64 `protobuf:"varint,1,opt,name=SpawnCount,proto3" json:"SpawnCount,omitempty"` SpawnRate float64 `protobuf:"fixed64,2,opt,name=SpawnRate,proto3" json:"SpawnRate,omitempty"` RunTime int64 `protobuf:"varint,3,opt,name=RunTime,proto3" json:"RunTime,omitempty"` MaxRPS int64 `protobuf:"varint,4,opt,name=MaxRPS,proto3" json:"MaxRPS,omitempty"` LoopCount int64 `protobuf:"varint,5,opt,name=LoopCount,proto3" json:"LoopCount,omitempty"` RequestIncreaseRate string `protobuf:"bytes,6,opt,name=RequestIncreaseRate,proto3" json:"RequestIncreaseRate,omitempty"` MemoryProfile string `protobuf:"bytes,7,opt,name=MemoryProfile,proto3" json:"MemoryProfile,omitempty"` MemoryProfileDuration int64 `protobuf:"varint,8,opt,name=MemoryProfileDuration,proto3" json:"MemoryProfileDuration,omitempty"` CPUProfile string `protobuf:"bytes,9,opt,name=CPUProfile,proto3" json:"CPUProfile,omitempty"` CPUProfileDuration int64 `protobuf:"varint,10,opt,name=CPUProfileDuration,proto3" json:"CPUProfileDuration,omitempty"` PrometheusPushgatewayURL string `protobuf:"bytes,11,opt,name=PrometheusPushgatewayURL,proto3" json:"PrometheusPushgatewayURL,omitempty"` DisableConsoleOutput bool `protobuf:"varint,12,opt,name=DisableConsoleOutput,proto3" json:"DisableConsoleOutput,omitempty"` DisableCompression bool `protobuf:"varint,13,opt,name=DisableCompression,proto3" json:"DisableCompression,omitempty"` DisableKeepalive bool `protobuf:"varint,14,opt,name=DisableKeepalive,proto3" json:"DisableKeepalive,omitempty"` ID uint64 `protobuf:"varint,15,opt,name=ID,proto3" json:"ID,omitempty"` // contains filtered or unexported fields }
func (*Profile) Descriptor
deprecated
func (*Profile) GetCPUProfile ¶
func (*Profile) GetCPUProfileDuration ¶
func (*Profile) GetDisableCompression ¶
func (*Profile) GetDisableConsoleOutput ¶
func (*Profile) GetDisableKeepalive ¶
func (*Profile) GetLoopCount ¶
func (*Profile) GetMemoryProfile ¶
func (*Profile) GetMemoryProfileDuration ¶
func (*Profile) GetPrometheusPushgatewayURL ¶
func (*Profile) GetRequestIncreaseRate ¶
func (*Profile) GetRunTime ¶
func (*Profile) GetSpawnCount ¶
func (*Profile) GetSpawnRate ¶
func (*Profile) ProtoMessage ¶
func (*Profile) ProtoMessage()
func (*Profile) ProtoReflect ¶
func (x *Profile) ProtoReflect() protoreflect.Message
type QuitReq ¶
type QuitReq struct {
// contains filtered or unexported fields
}
func (*QuitReq) Descriptor
deprecated
func (*QuitReq) ProtoMessage ¶
func (*QuitReq) ProtoMessage()
func (*QuitReq) ProtoReflect ¶
func (x *QuitReq) ProtoReflect() protoreflect.Message
type QuitResp ¶
type QuitResp struct { Resp *Resp `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` // contains filtered or unexported fields }
func (*QuitResp) Descriptor
deprecated
func (*QuitResp) ProtoMessage ¶
func (*QuitResp) ProtoMessage()
func (*QuitResp) ProtoReflect ¶
func (x *QuitResp) ProtoReflect() protoreflect.Message
type RebalanceReq ¶
type RebalanceReq struct { SpawnCount int64 `protobuf:"varint,1,opt,name=SpawnCount,proto3" json:"SpawnCount,omitempty"` SpawnRate float64 `protobuf:"fixed64,2,opt,name=SpawnRate,proto3" json:"SpawnRate,omitempty"` // contains filtered or unexported fields }
func (*RebalanceReq) Descriptor
deprecated
func (*RebalanceReq) Descriptor() ([]byte, []int)
Deprecated: Use RebalanceReq.ProtoReflect.Descriptor instead.
func (*RebalanceReq) GetSpawnCount ¶
func (x *RebalanceReq) GetSpawnCount() int64
func (*RebalanceReq) GetSpawnRate ¶
func (x *RebalanceReq) GetSpawnRate() float64
func (*RebalanceReq) ProtoMessage ¶
func (*RebalanceReq) ProtoMessage()
func (*RebalanceReq) ProtoReflect ¶
func (x *RebalanceReq) ProtoReflect() protoreflect.Message
func (*RebalanceReq) Reset ¶
func (x *RebalanceReq) Reset()
func (*RebalanceReq) String ¶
func (x *RebalanceReq) String() string
type RebalanceResp ¶
type RebalanceResp struct { Resp *Resp `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` // contains filtered or unexported fields }
func (*RebalanceResp) Descriptor
deprecated
func (*RebalanceResp) Descriptor() ([]byte, []int)
Deprecated: Use RebalanceResp.ProtoReflect.Descriptor instead.
func (*RebalanceResp) GetResp ¶
func (x *RebalanceResp) GetResp() *Resp
func (*RebalanceResp) ProtoMessage ¶
func (*RebalanceResp) ProtoMessage()
func (*RebalanceResp) ProtoReflect ¶
func (x *RebalanceResp) ProtoReflect() protoreflect.Message
func (*RebalanceResp) Reset ¶
func (x *RebalanceResp) Reset()
func (*RebalanceResp) String ¶
func (x *RebalanceResp) String() string
type Resp ¶
type Resp struct { Code Code `protobuf:"varint,1,opt,name=Code,proto3,enum=master.Code" json:"Code,omitempty"` Message string `protobuf:"bytes,2,opt,name=Message,proto3" json:"Message,omitempty"` // contains filtered or unexported fields }
func (*Resp) Descriptor
deprecated
func (*Resp) GetMessage ¶
func (*Resp) ProtoMessage ¶
func (*Resp) ProtoMessage()
func (*Resp) ProtoReflect ¶
func (x *Resp) ProtoReflect() protoreflect.Message
type StartReq ¶
type StartReq struct { Profile *Profile `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` // contains filtered or unexported fields }
func (*StartReq) Descriptor
deprecated
func (*StartReq) GetProfile ¶
func (*StartReq) ProtoMessage ¶
func (*StartReq) ProtoMessage()
func (*StartReq) ProtoReflect ¶
func (x *StartReq) ProtoReflect() protoreflect.Message
type StartResp ¶
type StartResp struct { Resp *Resp `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` ReportID uint64 `protobuf:"varint,2,opt,name=ReportID,proto3" json:"ReportID,omitempty"` // contains filtered or unexported fields }
func (*StartResp) Descriptor
deprecated
func (*StartResp) GetReportID ¶
func (*StartResp) ProtoMessage ¶
func (*StartResp) ProtoMessage()
func (*StartResp) ProtoReflect ¶
func (x *StartResp) ProtoReflect() protoreflect.Message
type StopReq ¶
type StopReq struct {
// contains filtered or unexported fields
}
func (*StopReq) Descriptor
deprecated
func (*StopReq) ProtoMessage ¶
func (*StopReq) ProtoMessage()
func (*StopReq) ProtoReflect ¶
func (x *StopReq) ProtoReflect() protoreflect.Message
type StopResp ¶
type StopResp struct { Resp *Resp `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"` // contains filtered or unexported fields }
func (*StopResp) Descriptor
deprecated
func (*StopResp) ProtoMessage ¶
func (*StopResp) ProtoMessage()
func (*StopResp) ProtoReflect ¶
func (x *StopResp) ProtoReflect() protoreflect.Message
type UnimplementedMasterServer ¶
type UnimplementedMasterServer struct { }
UnimplementedMasterServer must be embedded to have forward compatible implementations.
func (UnimplementedMasterServer) Master ¶
func (UnimplementedMasterServer) Master(context.Context, *MasterReq) (*MasterResp, error)
func (UnimplementedMasterServer) Rebalance ¶
func (UnimplementedMasterServer) Rebalance(context.Context, *RebalanceReq) (*RebalanceResp, error)
type UnsafeMasterServer ¶
type UnsafeMasterServer interface {
// contains filtered or unexported methods
}
UnsafeMasterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MasterServer will result in compilation errors.
type Work ¶
type Work struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` Os string `protobuf:"bytes,3,opt,name=os,proto3" json:"os,omitempty"` Arch string `protobuf:"bytes,4,opt,name=arch,proto3" json:"arch,omitempty"` State int32 `protobuf:"varint,5,opt,name=state,proto3" json:"state,omitempty"` Heartbeat int32 `protobuf:"varint,6,opt,name=heartbeat,proto3" json:"heartbeat,omitempty"` UserCount int64 `protobuf:"varint,7,opt,name=user_count,json=userCount,proto3" json:"user_count,omitempty"` WorkerCpuUsage float64 `protobuf:"fixed64,8,opt,name=worker_cpu_usage,json=workerCpuUsage,proto3" json:"worker_cpu_usage,omitempty"` CpuUsage float64 `protobuf:"fixed64,9,opt,name=cpu_usage,json=cpuUsage,proto3" json:"cpu_usage,omitempty"` CpuWarningEmitted bool `protobuf:"varint,10,opt,name=cpu_warning_emitted,json=cpuWarningEmitted,proto3" json:"cpu_warning_emitted,omitempty"` WorkerMemoryUsage float64 `protobuf:"fixed64,11,opt,name=worker_memory_usage,json=workerMemoryUsage,proto3" json:"worker_memory_usage,omitempty"` MemoryUsage float64 `protobuf:"fixed64,12,opt,name=memory_usage,json=memoryUsage,proto3" json:"memory_usage,omitempty"` // contains filtered or unexported fields }
func (*Work) Descriptor
deprecated
func (*Work) GetCpuUsage ¶
func (*Work) GetCpuWarningEmitted ¶
func (*Work) GetHeartbeat ¶
func (*Work) GetMemoryUsage ¶
func (*Work) GetUserCount ¶
func (*Work) GetWorkerCpuUsage ¶
func (*Work) GetWorkerMemoryUsage ¶
func (*Work) ProtoMessage ¶
func (*Work) ProtoMessage()
func (*Work) ProtoReflect ¶
func (x *Work) ProtoReflect() protoreflect.Message
type WorkReq ¶
type WorkReq struct {
// contains filtered or unexported fields
}
func (*WorkReq) Descriptor
deprecated
func (*WorkReq) ProtoMessage ¶
func (*WorkReq) ProtoMessage()
func (*WorkReq) ProtoReflect ¶
func (x *WorkReq) ProtoReflect() protoreflect.Message
type WorkResp ¶
type WorkResp struct { Work []*Work `protobuf:"bytes,1,rep,name=work,proto3" json:"work,omitempty"` // contains filtered or unexported fields }
func (*WorkResp) Descriptor
deprecated
func (*WorkResp) ProtoMessage ¶
func (*WorkResp) ProtoMessage()
func (*WorkResp) ProtoReflect ¶
func (x *WorkResp) ProtoReflect() protoreflect.Message