Documentation
¶
Index ¶
- Variables
- func Multicast(ctx *gorums.ConfigContext, in *TimedMsg, opts ...gorums.CallOption) error
- func QuorumCall(ctx *gorums.ConfigContext, in *Echo, opts ...gorums.CallOption) *gorums.Responses[*Echo]
- func RegisterBenchmarkServer(srv *gorums.Server, impl BenchmarkServer)
- func SlowServer(ctx *gorums.ConfigContext, in *Echo, opts ...gorums.CallOption) *gorums.Responses[*Echo]
- func StartBenchmark(ctx *gorums.ConfigContext, in *StartRequest, opts ...gorums.CallOption) *gorums.Responses[*StartResponse]
- func StartLocalServers(ctx context.Context, n int, opts ...gorums.ServerOption) []string
- func StartServerBenchmark(ctx *gorums.ConfigContext, in *StartRequest, opts ...gorums.CallOption) *gorums.Responses[*StartResponse]
- func StopBenchmark(ctx *gorums.ConfigContext, in *StopRequest, opts ...gorums.CallOption) *gorums.Responses[*MemoryStat]
- func StopServerBenchmark(ctx *gorums.ConfigContext, in *StopRequest, opts ...gorums.CallOption) *gorums.Responses[*Result]
- type AsyncEcho
- type AsyncMemoryStat
- type AsyncResult
- type AsyncStartResponse
- type Bench
- type BenchmarkServer
- type Configuration
- type CorrectableEcho
- type CorrectableMemoryStat
- type CorrectableResult
- type CorrectableStartResponse
- type Echo
- type Echo_builder
- type Manager
- type MemoryStat
- func (x *MemoryStat) GetAllocs() uint64
- func (x *MemoryStat) GetMemory() uint64
- func (*MemoryStat) ProtoMessage()
- func (x *MemoryStat) ProtoReflect() protoreflect.Message
- func (x *MemoryStat) Reset()
- func (x *MemoryStat) SetAllocs(v uint64)
- func (x *MemoryStat) SetMemory(v uint64)
- func (x *MemoryStat) String() string
- type MemoryStat_builder
- type Node
- type Options
- type Result
- 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) SetAllocsPerOp(v uint64)
- func (x *Result) SetLatencyAvg(v float64)
- func (x *Result) SetLatencyVar(v float64)
- func (x *Result) SetMemPerOp(v uint64)
- func (x *Result) SetName(v string)
- func (x *Result) SetServerStats(v []*MemoryStat)
- func (x *Result) SetThroughput(v float64)
- func (x *Result) SetTotalOps(v uint64)
- func (x *Result) SetTotalTime(v int64)
- func (x *Result) String() string
- type Result_builder
- type Server
- type StartRequest
- type StartRequest_builder
- type StartResponse
- type StartResponse_builder
- type Stats
- type StopRequest
- type StopRequest_builder
- type TimedMsg
- func (x *TimedMsg) GetPayload() []byte
- func (x *TimedMsg) GetSendTime() int64
- func (*TimedMsg) ProtoMessage()
- func (x *TimedMsg) ProtoReflect() protoreflect.Message
- func (x *TimedMsg) Reset()
- func (x *TimedMsg) SetPayload(v []byte)
- func (x *TimedMsg) SetSendTime(v int64)
- func (x *TimedMsg) String() string
- type TimedMsg_builder
Constants ¶
This section is empty.
Variables ¶
var File_benchmark_benchmark_proto protoreflect.FileDescriptor
Functions ¶
func Multicast ¶ added in v0.11.0
func Multicast(ctx *gorums.ConfigContext, in *TimedMsg, opts ...gorums.CallOption) error
Multicast performs a multicast call to all servers.
func QuorumCall ¶ added in v0.11.0
func QuorumCall(ctx *gorums.ConfigContext, in *Echo, opts ...gorums.CallOption) *gorums.Responses[*Echo]
QuorumCall performs an echo quorum call on all servers.
func RegisterBenchmarkServer ¶
func RegisterBenchmarkServer(srv *gorums.Server, impl BenchmarkServer)
func SlowServer ¶ added in v0.11.0
func SlowServer(ctx *gorums.ConfigContext, in *Echo, opts ...gorums.CallOption) *gorums.Responses[*Echo]
SlowServer performs an echo quorum call on slow servers.
func StartBenchmark ¶ added in v0.11.0
func StartBenchmark(ctx *gorums.ConfigContext, in *StartRequest, opts ...gorums.CallOption) *gorums.Responses[*StartResponse]
StartBenchmark starts a client-side benchmark campaign.
func StartLocalServers ¶
StartLocalServers starts benchmark servers locally
func StartServerBenchmark ¶ added in v0.11.0
func StartServerBenchmark(ctx *gorums.ConfigContext, in *StartRequest, opts ...gorums.CallOption) *gorums.Responses[*StartResponse]
StartServerBenchmark starts a server-side benchmark campaign.
func StopBenchmark ¶ added in v0.11.0
func StopBenchmark(ctx *gorums.ConfigContext, in *StopRequest, opts ...gorums.CallOption) *gorums.Responses[*MemoryStat]
StopBenchmark stops a client-side benchmark campaign.
func StopServerBenchmark ¶ added in v0.11.0
func StopServerBenchmark(ctx *gorums.ConfigContext, in *StopRequest, opts ...gorums.CallOption) *gorums.Responses[*Result]
StopServerBenchmark stops a server-side benchmark campaign.
Types ¶
type AsyncMemoryStat ¶ added in v0.11.0
type AsyncMemoryStat = *gorums.Async[*MemoryStat]
AsyncMemoryStat is a future for async quorum calls returning *MemoryStat.
type AsyncResult ¶ added in v0.11.0
AsyncResult is a future for async quorum calls returning *Result.
type AsyncStartResponse ¶ added in v0.11.0
type AsyncStartResponse = *gorums.Async[*StartResponse]
AsyncStartResponse is a future for async quorum calls returning *StartResponse.
type Bench ¶
Bench is a Benchmark with a name and description
func GetBenchmarks ¶
func GetBenchmarks(config Configuration) []Bench
GetBenchmarks returns a list of Benchmarks that can be performed on the configuration
type BenchmarkServer ¶
type BenchmarkServer interface {
StartServerBenchmark(ctx gorums.ServerCtx, request *StartRequest) (response *StartResponse, err error)
StopServerBenchmark(ctx gorums.ServerCtx, request *StopRequest) (response *Result, err error)
StartBenchmark(ctx gorums.ServerCtx, request *StartRequest) (response *StartResponse, err error)
StopBenchmark(ctx gorums.ServerCtx, request *StopRequest) (response *MemoryStat, err error)
QuorumCall(ctx gorums.ServerCtx, request *Echo) (response *Echo, err error)
SlowServer(ctx gorums.ServerCtx, request *Echo) (response *Echo, err error)
Multicast(ctx gorums.ServerCtx, request *TimedMsg)
}
Benchmark is the server-side API for the Benchmark Service
type Configuration ¶
type Configuration = gorums.Configuration
Type aliases for important Gorums types to make them more accessible from user code already interacting with the generated code.
func NewConfig ¶
func NewConfig(opts ...gorums.Option) (Configuration, error)
NewConfig returns a new Configuration based on the provided [gorums.Option]s. It accepts exactly one gorums.NodeListOption and multiple [gorums.ManagerOption]s. You may use this function to create the initial configuration for a new manager.
Example:
cfg, err := NewConfig(
gorums.WithNodeList([]string{"localhost:8080", "localhost:8081", "localhost:8082"}),
gorums.WithDialOptions(grpc.WithTransportCredentials(insecure.NewCredentials())),
)
This is a convenience function for creating a configuration without explicitly creating a manager first. However, the manager can be accessed using the [Configuration.Manager] method. This method should only be used once since it creates a new manager; if a manager already exists, use NewConfiguration instead, and provide the existing manager as the first argument.
func NewConfiguration ¶ added in v0.11.0
func NewConfiguration(mgr *Manager, opt gorums.NodeListOption) (Configuration, error)
NewConfiguration returns a configuration based on the provided list of nodes. Nodes can be supplied using WithNodeMap or WithNodeList, or WithNodeIDs. A new configuration can also be created from an existing configuration, using the And, WithNewNodes, Except, and WithoutNodes methods.
type CorrectableEcho ¶ added in v0.11.0
type CorrectableEcho = *gorums.Correctable[*Echo]
CorrectableEcho is a correctable object for quorum calls returning *Echo.
type CorrectableMemoryStat ¶ added in v0.11.0
type CorrectableMemoryStat = *gorums.Correctable[*MemoryStat]
CorrectableMemoryStat is a correctable object for quorum calls returning *MemoryStat.
type CorrectableResult ¶ added in v0.11.0
type CorrectableResult = *gorums.Correctable[*Result]
CorrectableResult is a correctable object for quorum calls returning *Result.
type CorrectableStartResponse ¶ added in v0.11.0
type CorrectableStartResponse = *gorums.Correctable[*StartResponse]
CorrectableStartResponse is a correctable object for quorum calls returning *StartResponse.
type Echo ¶
type Echo struct {
// contains filtered or unexported fields
}
Echo is a simple message used for echo benchmarks.
func (*Echo) GetPayload ¶
func (*Echo) ProtoMessage ¶
func (*Echo) ProtoMessage()
func (*Echo) ProtoReflect ¶
func (x *Echo) ProtoReflect() protoreflect.Message
func (*Echo) SetPayload ¶ added in v0.8.0
type Echo_builder ¶ added in v0.8.0
type Echo_builder struct {
Payload []byte
// contains filtered or unexported fields
}
func (Echo_builder) Build ¶ added in v0.8.0
func (b0 Echo_builder) Build() *Echo
type Manager ¶
Type aliases for important Gorums types to make them more accessible from user code already interacting with the generated code.
func NewManager ¶
func NewManager(opts ...gorums.ManagerOption) *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.
type MemoryStat ¶
type MemoryStat struct {
// contains filtered or unexported fields
}
MemoryStat contains memory statistics for a single server.
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) SetAllocs ¶ added in v0.8.0
func (x *MemoryStat) SetAllocs(v uint64)
func (*MemoryStat) SetMemory ¶ added in v0.8.0
func (x *MemoryStat) SetMemory(v uint64)
func (*MemoryStat) String ¶
func (x *MemoryStat) String() string
type MemoryStat_builder ¶ added in v0.8.0
type MemoryStat_builder struct {
Allocs uint64
Memory uint64
// contains filtered or unexported fields
}
func (MemoryStat_builder) Build ¶ added in v0.8.0
func (b0 MemoryStat_builder) Build() *MemoryStat
type Node ¶
Type aliases for important Gorums types to make them more accessible from user code already interacting with the generated code.
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 Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result contains the results of a server-side benchmarking campaign.
func RunBenchmarks ¶
func RunBenchmarks(benchRegex *regexp.Regexp, options Options, config Configuration) ([]*Result, error)
RunBenchmarks runs all the benchmarks that match the given regex with the given options
func StopServerBenchmarkQF ¶ added in v0.11.0
StopServerBenchmarkQF aggregates StopServerBenchmark responses from all nodes. It combines results, calculating averages and pooled variance.
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
func (*Result) SetAllocsPerOp ¶ added in v0.8.0
func (*Result) SetLatencyAvg ¶ added in v0.8.0
func (*Result) SetLatencyVar ¶ added in v0.8.0
func (*Result) SetMemPerOp ¶ added in v0.8.0
func (*Result) SetServerStats ¶ added in v0.8.0
func (x *Result) SetServerStats(v []*MemoryStat)
func (*Result) SetThroughput ¶ added in v0.8.0
func (*Result) SetTotalOps ¶ added in v0.8.0
func (*Result) SetTotalTime ¶ added in v0.8.0
type Result_builder ¶ added in v0.8.0
type Result_builder struct {
Name string
TotalOps uint64
TotalTime int64
Throughput float64
LatencyAvg float64
LatencyVar float64
AllocsPerOp uint64
MemPerOp uint64
ServerStats []*MemoryStat
// contains filtered or unexported fields
}
func (Result_builder) Build ¶ added in v0.8.0
func (b0 Result_builder) Build() *Result
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
NewBenchServer returns a new benchmark server
type StartRequest ¶
type StartRequest struct {
// contains filtered or unexported fields
}
StartRequest is an empty message for starting a benchmarking campaign.
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 StartRequest_builder ¶ added in v0.8.0
type StartRequest_builder struct {
// contains filtered or unexported fields
}
func (StartRequest_builder) Build ¶ added in v0.8.0
func (b0 StartRequest_builder) Build() *StartRequest
type StartResponse ¶
type StartResponse struct {
// contains filtered or unexported fields
}
StartResponse is an empty message to acknowledge the start of a benchmarking campaign.
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 StartResponse_builder ¶ added in v0.8.0
type StartResponse_builder struct {
// contains filtered or unexported fields
}
func (StartResponse_builder) Build ¶ added in v0.8.0
func (b0 StartResponse_builder) Build() *StartResponse
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
}
StopRequest is an empty message for stopping a benchmarking campaign.
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 StopRequest_builder ¶ added in v0.8.0
type StopRequest_builder struct {
// contains filtered or unexported fields
}
func (StopRequest_builder) Build ¶ added in v0.8.0
func (b0 StopRequest_builder) Build() *StopRequest
type TimedMsg ¶
type TimedMsg struct {
// contains filtered or unexported fields
}
TimedMsg is a message with a send time and a payload used for multicast benchmarks.
func (*TimedMsg) GetPayload ¶
func (*TimedMsg) GetSendTime ¶
func (*TimedMsg) ProtoMessage ¶
func (*TimedMsg) ProtoMessage()
func (*TimedMsg) ProtoReflect ¶
func (x *TimedMsg) ProtoReflect() protoreflect.Message
func (*TimedMsg) SetPayload ¶ added in v0.8.0
func (*TimedMsg) SetSendTime ¶ added in v0.8.0
type TimedMsg_builder ¶ added in v0.8.0
type TimedMsg_builder struct {
SendTime int64
Payload []byte
// contains filtered or unexported fields
}
func (TimedMsg_builder) Build ¶ added in v0.8.0
func (b0 TimedMsg_builder) Build() *TimedMsg