master

package
v0.0.0-...-b652da8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Code_name = map[int32]string{
		0: "OK",
		1: "ERROR",
	}
	Code_value = map[string]int32{
		"OK":    0,
		"ERROR": 1,
	}
)

Enum value maps for Code.

View Source
var File_master_proto protoreflect.FileDescriptor
View Source
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
const (
	Code_OK    Code = 0
	Code_ERROR Code = 1
)

func (Code) Descriptor

func (Code) Descriptor() protoreflect.EnumDescriptor

func (Code) Enum

func (x Code) Enum() *Code

func (Code) EnumDescriptor deprecated

func (Code) EnumDescriptor() ([]byte, []int)

Deprecated: Use Code.Descriptor instead.

func (Code) Number

func (x Code) Number() protoreflect.EnumNumber

func (Code) String

func (x Code) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use MasterReq.ProtoReflect.Descriptor instead.

func (*MasterReq) ProtoMessage

func (*MasterReq) ProtoMessage()

func (*MasterReq) ProtoReflect

func (x *MasterReq) ProtoReflect() protoreflect.Message

func (*MasterReq) Reset

func (x *MasterReq) Reset()

func (*MasterReq) String

func (x *MasterReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Profile.ProtoReflect.Descriptor instead.

func (*Profile) GetCPUProfile

func (x *Profile) GetCPUProfile() string

func (*Profile) GetCPUProfileDuration

func (x *Profile) GetCPUProfileDuration() int64

func (*Profile) GetDisableCompression

func (x *Profile) GetDisableCompression() bool

func (*Profile) GetDisableConsoleOutput

func (x *Profile) GetDisableConsoleOutput() bool

func (*Profile) GetDisableKeepalive

func (x *Profile) GetDisableKeepalive() bool

func (*Profile) GetID

func (x *Profile) GetID() uint64

func (*Profile) GetLoopCount

func (x *Profile) GetLoopCount() int64

func (*Profile) GetMaxRPS

func (x *Profile) GetMaxRPS() int64

func (*Profile) GetMemoryProfile

func (x *Profile) GetMemoryProfile() string

func (*Profile) GetMemoryProfileDuration

func (x *Profile) GetMemoryProfileDuration() int64

func (*Profile) GetPrometheusPushgatewayURL

func (x *Profile) GetPrometheusPushgatewayURL() string

func (*Profile) GetRequestIncreaseRate

func (x *Profile) GetRequestIncreaseRate() string

func (*Profile) GetRunTime

func (x *Profile) GetRunTime() int64

func (*Profile) GetSpawnCount

func (x *Profile) GetSpawnCount() int64

func (*Profile) GetSpawnRate

func (x *Profile) GetSpawnRate() float64

func (*Profile) ProtoMessage

func (*Profile) ProtoMessage()

func (*Profile) ProtoReflect

func (x *Profile) ProtoReflect() protoreflect.Message

func (*Profile) Reset

func (x *Profile) Reset()

func (*Profile) String

func (x *Profile) String() string

type QuitReq

type QuitReq struct {
	// contains filtered or unexported fields
}

func (*QuitReq) Descriptor deprecated

func (*QuitReq) Descriptor() ([]byte, []int)

Deprecated: Use QuitReq.ProtoReflect.Descriptor instead.

func (*QuitReq) ProtoMessage

func (*QuitReq) ProtoMessage()

func (*QuitReq) ProtoReflect

func (x *QuitReq) ProtoReflect() protoreflect.Message

func (*QuitReq) Reset

func (x *QuitReq) Reset()

func (*QuitReq) String

func (x *QuitReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use QuitResp.ProtoReflect.Descriptor instead.

func (*QuitResp) GetResp

func (x *QuitResp) GetResp() *Resp

func (*QuitResp) ProtoMessage

func (*QuitResp) ProtoMessage()

func (*QuitResp) ProtoReflect

func (x *QuitResp) ProtoReflect() protoreflect.Message

func (*QuitResp) Reset

func (x *QuitResp) Reset()

func (*QuitResp) String

func (x *QuitResp) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Resp.ProtoReflect.Descriptor instead.

func (*Resp) GetCode

func (x *Resp) GetCode() Code

func (*Resp) GetMessage

func (x *Resp) GetMessage() string

func (*Resp) ProtoMessage

func (*Resp) ProtoMessage()

func (*Resp) ProtoReflect

func (x *Resp) ProtoReflect() protoreflect.Message

func (*Resp) Reset

func (x *Resp) Reset()

func (*Resp) String

func (x *Resp) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use StartReq.ProtoReflect.Descriptor instead.

func (*StartReq) GetProfile

func (x *StartReq) GetProfile() *Profile

func (*StartReq) ProtoMessage

func (*StartReq) ProtoMessage()

func (*StartReq) ProtoReflect

func (x *StartReq) ProtoReflect() protoreflect.Message

func (*StartReq) Reset

func (x *StartReq) Reset()

func (*StartReq) String

func (x *StartReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use StartResp.ProtoReflect.Descriptor instead.

func (*StartResp) GetReportID

func (x *StartResp) GetReportID() uint64

func (*StartResp) GetResp

func (x *StartResp) GetResp() *Resp

func (*StartResp) ProtoMessage

func (*StartResp) ProtoMessage()

func (*StartResp) ProtoReflect

func (x *StartResp) ProtoReflect() protoreflect.Message

func (*StartResp) Reset

func (x *StartResp) Reset()

func (*StartResp) String

func (x *StartResp) String() string

type StopReq

type StopReq struct {
	// contains filtered or unexported fields
}

func (*StopReq) Descriptor deprecated

func (*StopReq) Descriptor() ([]byte, []int)

Deprecated: Use StopReq.ProtoReflect.Descriptor instead.

func (*StopReq) ProtoMessage

func (*StopReq) ProtoMessage()

func (*StopReq) ProtoReflect

func (x *StopReq) ProtoReflect() protoreflect.Message

func (*StopReq) Reset

func (x *StopReq) Reset()

func (*StopReq) String

func (x *StopReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use StopResp.ProtoReflect.Descriptor instead.

func (*StopResp) GetResp

func (x *StopResp) GetResp() *Resp

func (*StopResp) ProtoMessage

func (*StopResp) ProtoMessage()

func (*StopResp) ProtoReflect

func (x *StopResp) ProtoReflect() protoreflect.Message

func (*StopResp) Reset

func (x *StopResp) Reset()

func (*StopResp) String

func (x *StopResp) String() string

type UnimplementedMasterServer

type UnimplementedMasterServer struct {
}

UnimplementedMasterServer must be embedded to have forward compatible implementations.

func (UnimplementedMasterServer) Master

func (UnimplementedMasterServer) Quit

func (UnimplementedMasterServer) Rebalance

func (UnimplementedMasterServer) Start

func (UnimplementedMasterServer) Stop

func (UnimplementedMasterServer) Work

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) Descriptor() ([]byte, []int)

Deprecated: Use Work.ProtoReflect.Descriptor instead.

func (*Work) GetArch

func (x *Work) GetArch() string

func (*Work) GetCpuUsage

func (x *Work) GetCpuUsage() float64

func (*Work) GetCpuWarningEmitted

func (x *Work) GetCpuWarningEmitted() bool

func (*Work) GetHeartbeat

func (x *Work) GetHeartbeat() int32

func (*Work) GetId

func (x *Work) GetId() string

func (*Work) GetIp

func (x *Work) GetIp() string

func (*Work) GetMemoryUsage

func (x *Work) GetMemoryUsage() float64

func (*Work) GetOs

func (x *Work) GetOs() string

func (*Work) GetState

func (x *Work) GetState() int32

func (*Work) GetUserCount

func (x *Work) GetUserCount() int64

func (*Work) GetWorkerCpuUsage

func (x *Work) GetWorkerCpuUsage() float64

func (*Work) GetWorkerMemoryUsage

func (x *Work) GetWorkerMemoryUsage() float64

func (*Work) ProtoMessage

func (*Work) ProtoMessage()

func (*Work) ProtoReflect

func (x *Work) ProtoReflect() protoreflect.Message

func (*Work) Reset

func (x *Work) Reset()

func (*Work) String

func (x *Work) String() string

type WorkReq

type WorkReq struct {
	// contains filtered or unexported fields
}

func (*WorkReq) Descriptor deprecated

func (*WorkReq) Descriptor() ([]byte, []int)

Deprecated: Use WorkReq.ProtoReflect.Descriptor instead.

func (*WorkReq) ProtoMessage

func (*WorkReq) ProtoMessage()

func (*WorkReq) ProtoReflect

func (x *WorkReq) ProtoReflect() protoreflect.Message

func (*WorkReq) Reset

func (x *WorkReq) Reset()

func (*WorkReq) String

func (x *WorkReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use WorkResp.ProtoReflect.Descriptor instead.

func (*WorkResp) GetWork

func (x *WorkResp) GetWork() []*Work

func (*WorkResp) ProtoMessage

func (*WorkResp) ProtoMessage()

func (*WorkResp) ProtoReflect

func (x *WorkResp) ProtoReflect() protoreflect.Message

func (*WorkResp) Reset

func (x *WorkResp) Reset()

func (*WorkResp) String

func (x *WorkResp) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL