Documentation
¶
Index ¶
- Variables
- func RegisterBenchmarkServer(srv *gorums.Server, impl Benchmark)
- func StartLocalServers(ctx context.Context, n int, opts ...gorums.ServerOption) []string
- type AsyncEcho
- type Bench
- type Benchmark
- type Configuration
- func (c *Configuration) AsyncQuorumCall(ctx context.Context, in *Echo) *AsyncEcho
- func (c *Configuration) Multicast(ctx context.Context, in *TimedMsg, opts ...gorums.CallOption)
- func (c *Configuration) Nodes() []*Node
- func (c *Configuration) QuorumCall(ctx context.Context, in *Echo) (resp *Echo, err error)
- func (c *Configuration) SlowServer(ctx context.Context, in *Echo) (resp *Echo, err error)
- func (c *Configuration) StartBenchmark(ctx context.Context, in *StartRequest) (resp *StartResponse, err error)
- func (c *Configuration) StartServerBenchmark(ctx context.Context, in *StartRequest) (resp *StartResponse, err error)
- func (c *Configuration) StopBenchmark(ctx context.Context, in *StopRequest) (resp *MemoryStatList, err error)
- func (c *Configuration) StopServerBenchmark(ctx context.Context, in *StopRequest) (resp *Result, err error)
- type Echo
- type Manager
- type MemoryStat
- type MemoryStatList
- type Node
- type Options
- type QSpec
- func (qspec *QSpec) AsyncQuorumCallQF(_ *Echo, replies map[uint32]*Echo) (*Echo, bool)
- func (qspec *QSpec) QuorumCallQF(_ *Echo, replies map[uint32]*Echo) (*Echo, bool)
- func (qspec *QSpec) SlowServerQF(_ *Echo, replies map[uint32]*Echo) (*Echo, bool)
- func (qspec *QSpec) StartBenchmarkQF(_ *StartRequest, replies map[uint32]*StartResponse) (*StartResponse, bool)
- func (qspec *QSpec) StartServerBenchmarkQF(_ *StartRequest, replies map[uint32]*StartResponse) (*StartResponse, bool)
- func (qspec *QSpec) StopBenchmarkQF(_ *StopRequest, replies map[uint32]*MemoryStat) (*MemoryStatList, bool)
- func (qspec *QSpec) StopServerBenchmarkQF(_ *StopRequest, replies map[uint32]*Result) (*Result, bool)
- type QuorumSpec
- type Result
- func (*Result) Descriptor() ([]byte, []int)deprecated
- func (r *Result) Format() string
- func (x *Result) GetAllocsPerOp() uint64
- func (x *Result) GetLatencyAvg() float64
- func (x *Result) GetLatencyVar() float64
- func (x *Result) GetMemPerOp() uint64
- func (x *Result) GetName() string
- func (x *Result) GetServerStats() []*MemoryStat
- func (x *Result) GetThroughput() float64
- func (x *Result) GetTotalOps() uint64
- func (x *Result) GetTotalTime() int64
- func (*Result) ProtoMessage()
- func (x *Result) ProtoReflect() protoreflect.Message
- func (x *Result) Reset()
- func (x *Result) String() string
- type Server
- type StartRequest
- type StartResponse
- type Stats
- type StopRequest
- type TimedMsg
Constants ¶
This section is empty.
Variables ¶
var File_benchmark_benchmark_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBenchmarkServer ¶
func StartLocalServers ¶
StartLocalServers starts benchmark servers locally
Types ¶
type Bench ¶
Bench is a Benchmark with a name and description
func GetBenchmarks ¶
func GetBenchmarks(cfg *Configuration) []Bench
GetBenchmarks returns a list of Benchmarks that can be performed on the configuration
type Benchmark ¶
type Benchmark interface {
StartServerBenchmark(context.Context, *StartRequest, func(*StartResponse, error))
StopServerBenchmark(context.Context, *StopRequest, func(*Result, error))
StartBenchmark(context.Context, *StartRequest, func(*StartResponse, error))
StopBenchmark(context.Context, *StopRequest, func(*MemoryStat, error))
QuorumCall(context.Context, *Echo, func(*Echo, error))
AsyncQuorumCall(context.Context, *Echo, func(*Echo, error))
SlowServer(context.Context, *Echo, func(*Echo, error))
Multicast(context.Context, *TimedMsg)
}
Benchmark is the server-side API for the Benchmark Service
type Configuration ¶
type Configuration struct {
gorums.Configuration
// contains filtered or unexported fields
}
A Configuration represents a static set of nodes on which quorum remote procedure calls may be invoked.
func (*Configuration) AsyncQuorumCall ¶ added in v0.3.0
func (c *Configuration) AsyncQuorumCall(ctx context.Context, in *Echo) *AsyncEcho
AsyncQuorumCall asynchronously invokes a quorum call on configuration c and returns a AsyncEcho, which can be used to inspect the quorum call reply and error when available.
func (*Configuration) Multicast ¶
func (c *Configuration) Multicast(ctx context.Context, in *TimedMsg, opts ...gorums.CallOption)
Multicast is a quorum call invoked on all nodes in configuration c, with the same argument in, and returns a combined result.
func (*Configuration) Nodes ¶
func (c *Configuration) Nodes() []*Node
Nodes returns a slice of each available node. IDs are returned in the same order as they were provided in the creation of the Manager.
func (*Configuration) QuorumCall ¶ added in v0.3.0
benchmarks
func (*Configuration) SlowServer ¶ added in v0.3.0
SlowServer is a quorum call invoked on all nodes in configuration c, with the same argument in, and returns a combined result.
func (*Configuration) StartBenchmark ¶
func (c *Configuration) StartBenchmark(ctx context.Context, in *StartRequest) (resp *StartResponse, err error)
StartBenchmark is a quorum call invoked on all nodes in configuration c, with the same argument in, and returns a combined result.
func (*Configuration) StartServerBenchmark ¶
func (c *Configuration) StartServerBenchmark(ctx context.Context, in *StartRequest) (resp *StartResponse, err error)
StartServerBenchmark is a quorum call invoked on all nodes in configuration c, with the same argument in, and returns a combined result.
func (*Configuration) StopBenchmark ¶
func (c *Configuration) StopBenchmark(ctx context.Context, in *StopRequest) (resp *MemoryStatList, err error)
StopBenchmark is a quorum call invoked on all nodes in configuration c, with the same argument in, and returns a combined result.
func (*Configuration) StopServerBenchmark ¶
func (c *Configuration) StopServerBenchmark(ctx context.Context, in *StopRequest) (resp *Result, err error)
StopServerBenchmark is a quorum call invoked on all nodes in configuration c, with the same argument in, and returns a combined result.
type Echo ¶
type Echo struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
// contains filtered or unexported fields
}
func (*Echo) Descriptor
deprecated
func (*Echo) GetPayload ¶
func (*Echo) ProtoMessage ¶
func (*Echo) ProtoMessage()
func (*Echo) ProtoReflect ¶
func (x *Echo) ProtoReflect() protoreflect.Message
type Manager ¶
Manager maintains a connection pool of nodes on which quorum calls can be performed.
func NewManager ¶
func NewManager(opts ...gorums.ManagerOption) (mgr *Manager)
NewManager returns a new Manager for managing connection to nodes added to the manager. This function accepts manager options used to configure various aspects of the manager.
func (*Manager) NewConfiguration ¶
func (m *Manager) NewConfiguration(qspec QuorumSpec, opts ...gorums.ConfigOption) (c *Configuration, err error)
NewConfiguration returns a configuration based on the provided list of nodes. Nodes can be supplied using WithNodeMap or WithNodeList or WithNodeIDs.
type MemoryStat ¶
type MemoryStat struct {
Allocs uint64 `protobuf:"varint,1,opt,name=Allocs,proto3" json:"Allocs,omitempty"`
Memory uint64 `protobuf:"varint,2,opt,name=Memory,proto3" json:"Memory,omitempty"`
// contains filtered or unexported fields
}
func (*MemoryStat) Descriptor
deprecated
func (*MemoryStat) Descriptor() ([]byte, []int)
Deprecated: Use MemoryStat.ProtoReflect.Descriptor instead.
func (*MemoryStat) GetAllocs ¶
func (x *MemoryStat) GetAllocs() uint64
func (*MemoryStat) GetMemory ¶
func (x *MemoryStat) GetMemory() uint64
func (*MemoryStat) ProtoMessage ¶
func (*MemoryStat) ProtoMessage()
func (*MemoryStat) ProtoReflect ¶
func (x *MemoryStat) ProtoReflect() protoreflect.Message
func (*MemoryStat) Reset ¶
func (x *MemoryStat) Reset()
func (*MemoryStat) String ¶
func (x *MemoryStat) String() string
type MemoryStatList ¶
type MemoryStatList struct {
MemoryStats []*MemoryStat `protobuf:"bytes,1,rep,name=MemoryStats,proto3" json:"MemoryStats,omitempty"`
// contains filtered or unexported fields
}
func (*MemoryStatList) Descriptor
deprecated
func (*MemoryStatList) Descriptor() ([]byte, []int)
Deprecated: Use MemoryStatList.ProtoReflect.Descriptor instead.
func (*MemoryStatList) GetMemoryStats ¶
func (x *MemoryStatList) GetMemoryStats() []*MemoryStat
func (*MemoryStatList) ProtoMessage ¶
func (*MemoryStatList) ProtoMessage()
func (*MemoryStatList) ProtoReflect ¶
func (x *MemoryStatList) ProtoReflect() protoreflect.Message
func (*MemoryStatList) Reset ¶
func (x *MemoryStatList) Reset()
func (*MemoryStatList) String ¶
func (x *MemoryStatList) String() string
type Options ¶
type Options struct {
Concurrent int // Number of concurrent calls
Duration time.Duration // Duration of benchmark
MaxAsync int // Max async calls at once
NumNodes int // Number of nodes to include in configuration
Payload int // Size of message payload
QuorumSize int // Number of messages to wait for
Warmup time.Duration // Warmup time
Remote bool // Whether the servers are remote (true) or local (false)
}
Options controls different options for the benchmarks
type QSpec ¶
QSpec is the quorum specification object for the benchmark
func (*QSpec) AsyncQuorumCallQF ¶ added in v0.3.0
OrderedAsyncQF is the quorum function for the OrderedAsync quorumcall
func (*QSpec) QuorumCallQF ¶ added in v0.3.0
OrderedQCQF is the quorum function for the OrderedQC quorumcall
func (*QSpec) SlowServerQF ¶ added in v0.3.0
OrderedSlowServerQF is the quorum function for the OrderedSlowServer quorumcall
func (*QSpec) StartBenchmarkQF ¶
func (qspec *QSpec) StartBenchmarkQF(_ *StartRequest, replies map[uint32]*StartResponse) (*StartResponse, bool)
StartBenchmarkQF is the quorum function for the StartBenchmark quorumcall. It requires a response from all nodes.
func (*QSpec) StartServerBenchmarkQF ¶
func (qspec *QSpec) StartServerBenchmarkQF(_ *StartRequest, replies map[uint32]*StartResponse) (*StartResponse, bool)
StartServerBenchmarkQF is the quorum function for the StartServerBenchmark quorumcall. It requires a response from all nodes.
func (*QSpec) StopBenchmarkQF ¶
func (qspec *QSpec) StopBenchmarkQF(_ *StopRequest, replies map[uint32]*MemoryStat) (*MemoryStatList, bool)
StopBenchmarkQF is the quorum function for the StopBenchmark quorumcall. It requires a response from all nodes.
func (*QSpec) StopServerBenchmarkQF ¶
func (qspec *QSpec) StopServerBenchmarkQF(_ *StopRequest, replies map[uint32]*Result) (*Result, bool)
StopServerBenchmarkQF is the quorum function for the StopServerBenchmark quorumcall. It requires a response from all nodes.
type QuorumSpec ¶
type QuorumSpec interface {
// StartServerBenchmarkQF is the quorum function for the StartServerBenchmark
// quorum call method. The in parameter is the request object
// supplied to the StartServerBenchmark method at call time, and may or may not
// be used by the quorum function. If the in parameter is not needed
// you should implement your quorum function with '_ *StartRequest'.
StartServerBenchmarkQF(in *StartRequest, replies map[uint32]*StartResponse) (*StartResponse, bool)
// StopServerBenchmarkQF is the quorum function for the StopServerBenchmark
// quorum call method. The in parameter is the request object
// supplied to the StopServerBenchmark method at call time, and may or may not
// be used by the quorum function. If the in parameter is not needed
// you should implement your quorum function with '_ *StopRequest'.
StopServerBenchmarkQF(in *StopRequest, replies map[uint32]*Result) (*Result, bool)
// StartBenchmarkQF is the quorum function for the StartBenchmark
// quorum call method. The in parameter is the request object
// supplied to the StartBenchmark method at call time, and may or may not
// be used by the quorum function. If the in parameter is not needed
// you should implement your quorum function with '_ *StartRequest'.
StartBenchmarkQF(in *StartRequest, replies map[uint32]*StartResponse) (*StartResponse, bool)
// StopBenchmarkQF is the quorum function for the StopBenchmark
// quorum call method. The in parameter is the request object
// supplied to the StopBenchmark method at call time, and may or may not
// be used by the quorum function. If the in parameter is not needed
// you should implement your quorum function with '_ *StopRequest'.
StopBenchmarkQF(in *StopRequest, replies map[uint32]*MemoryStat) (*MemoryStatList, bool)
// QuorumCallQF is the quorum function for the QuorumCall
// quorum call method. The in parameter is the request object
// supplied to the QuorumCall method at call time, and may or may not
// be used by the quorum function. If the in parameter is not needed
// you should implement your quorum function with '_ *Echo'.
QuorumCallQF(in *Echo, replies map[uint32]*Echo) (*Echo, bool)
// AsyncQuorumCallQF is the quorum function for the AsyncQuorumCall
// asynchronous quorum call method. The in parameter is the request object
// supplied to the AsyncQuorumCall method at call time, and may or may not
// be used by the quorum function. If the in parameter is not needed
// you should implement your quorum function with '_ *Echo'.
AsyncQuorumCallQF(in *Echo, replies map[uint32]*Echo) (*Echo, bool)
// SlowServerQF is the quorum function for the SlowServer
// quorum call method. The in parameter is the request object
// supplied to the SlowServer method at call time, and may or may not
// be used by the quorum function. If the in parameter is not needed
// you should implement your quorum function with '_ *Echo'.
SlowServerQF(in *Echo, replies map[uint32]*Echo) (*Echo, bool)
}
QuorumSpec is the interface of quorum functions for Benchmark.
type Result ¶
type Result struct {
Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
TotalOps uint64 `protobuf:"varint,2,opt,name=TotalOps,proto3" json:"TotalOps,omitempty"`
TotalTime int64 `protobuf:"varint,3,opt,name=TotalTime,proto3" json:"TotalTime,omitempty"`
Throughput float64 `protobuf:"fixed64,4,opt,name=Throughput,proto3" json:"Throughput,omitempty"`
LatencyAvg float64 `protobuf:"fixed64,5,opt,name=LatencyAvg,proto3" json:"LatencyAvg,omitempty"`
LatencyVar float64 `protobuf:"fixed64,6,opt,name=LatencyVar,proto3" json:"LatencyVar,omitempty"`
AllocsPerOp uint64 `protobuf:"varint,7,opt,name=AllocsPerOp,proto3" json:"AllocsPerOp,omitempty"`
MemPerOp uint64 `protobuf:"varint,8,opt,name=MemPerOp,proto3" json:"MemPerOp,omitempty"`
ServerStats []*MemoryStat `protobuf:"bytes,9,rep,name=ServerStats,proto3" json:"ServerStats,omitempty"`
// contains filtered or unexported fields
}
func RunBenchmarks ¶
func RunBenchmarks(benchRegex *regexp.Regexp, options Options, cfg *Configuration) ([]*Result, error)
RunBenchmarks runs all the benchmarks that match the given regex with the given options
func (*Result) Descriptor
deprecated
func (*Result) GetAllocsPerOp ¶
func (*Result) GetLatencyAvg ¶
func (*Result) GetLatencyVar ¶
func (*Result) GetMemPerOp ¶
func (*Result) GetServerStats ¶
func (x *Result) GetServerStats() []*MemoryStat
func (*Result) GetThroughput ¶
func (*Result) GetTotalOps ¶
func (*Result) GetTotalTime ¶
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
func (*Result) ProtoReflect ¶
func (x *Result) ProtoReflect() protoreflect.Message
type Server ¶
Server is a unified server for both ordered and unordered methods
func NewBenchServer ¶ added in v0.3.0
func NewBenchServer(opts ...gorums.ServerOption) *Server
NewServer returns a new Server
type StartRequest ¶
type StartRequest struct {
// contains filtered or unexported fields
}
func (*StartRequest) Descriptor
deprecated
func (*StartRequest) Descriptor() ([]byte, []int)
Deprecated: Use StartRequest.ProtoReflect.Descriptor instead.
func (*StartRequest) ProtoMessage ¶
func (*StartRequest) ProtoMessage()
func (*StartRequest) ProtoReflect ¶
func (x *StartRequest) ProtoReflect() protoreflect.Message
func (*StartRequest) Reset ¶
func (x *StartRequest) Reset()
func (*StartRequest) String ¶
func (x *StartRequest) String() string
type StartResponse ¶
type StartResponse struct {
// contains filtered or unexported fields
}
func (*StartResponse) Descriptor
deprecated
func (*StartResponse) Descriptor() ([]byte, []int)
Deprecated: Use StartResponse.ProtoReflect.Descriptor instead.
func (*StartResponse) ProtoMessage ¶
func (*StartResponse) ProtoMessage()
func (*StartResponse) ProtoReflect ¶
func (x *StartResponse) ProtoReflect() protoreflect.Message
func (*StartResponse) Reset ¶
func (x *StartResponse) Reset()
func (*StartResponse) String ¶
func (x *StartResponse) String() string
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats records and processes the raw data of a benchmark
func (*Stats) AddLatency ¶
AddLatency adds a latency measurement
type StopRequest ¶
type StopRequest struct {
// contains filtered or unexported fields
}
func (*StopRequest) Descriptor
deprecated
func (*StopRequest) Descriptor() ([]byte, []int)
Deprecated: Use StopRequest.ProtoReflect.Descriptor instead.
func (*StopRequest) ProtoMessage ¶
func (*StopRequest) ProtoMessage()
func (*StopRequest) ProtoReflect ¶
func (x *StopRequest) ProtoReflect() protoreflect.Message
func (*StopRequest) Reset ¶
func (x *StopRequest) Reset()
func (*StopRequest) String ¶
func (x *StopRequest) String() string
type TimedMsg ¶
type TimedMsg struct {
SendTime int64 `protobuf:"varint,1,opt,name=SendTime,proto3" json:"SendTime,omitempty"`
Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
// contains filtered or unexported fields
}
func (*TimedMsg) Descriptor
deprecated
func (*TimedMsg) GetPayload ¶
func (*TimedMsg) GetSendTime ¶
func (*TimedMsg) ProtoMessage ¶
func (*TimedMsg) ProtoMessage()
func (*TimedMsg) ProtoReflect ¶
func (x *TimedMsg) ProtoReflect() protoreflect.Message