Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions benchmark/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type (
serverFunc func(context.Context, *TimedMsg)
)

func runQCBenchmark(opts Options, cfg *Configuration, quorum int, f qcFunc) (*Result, error) {
func runQCBenchmark(opts Options, cfg *BenchmarkConfiguration, quorum int, f qcFunc) (*Result, error) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
msg := Echo_builder{Payload: make([]byte, opts.Payload)}.Build()
Expand Down Expand Up @@ -103,7 +103,7 @@ func runQCBenchmark(opts Options, cfg *Configuration, quorum int, f qcFunc) (*Re
return result, nil
}

func runAsyncQCBenchmark(opts Options, cfg *Configuration, quorum int) (*Result, error) {
func runAsyncQCBenchmark(opts Options, cfg *BenchmarkConfiguration, quorum int) (*Result, error) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
msg := Echo_builder{Payload: make([]byte, opts.Payload)}.Build()
Expand Down Expand Up @@ -187,7 +187,7 @@ func runAsyncQCBenchmark(opts Options, cfg *Configuration, quorum int) (*Result,
return result, nil
}

func runServerBenchmark(opts Options, cfg *Configuration, f serverFunc) (*Result, error) {
func runServerBenchmark(opts Options, cfg *BenchmarkConfiguration, f serverFunc) (*Result, error) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
payload := make([]byte, opts.Payload)
Expand Down Expand Up @@ -241,7 +241,7 @@ func runServerBenchmark(opts Options, cfg *Configuration, f serverFunc) (*Result
}

// GetBenchmarks returns a list of Benchmarks that can be performed on the configuration
func GetBenchmarks(cfg *Configuration, quorum int) []Bench {
func GetBenchmarks(cfg *BenchmarkConfiguration, quorum int) []Bench {
m := []Bench{
{
Name: "QuorumCall",
Expand Down Expand Up @@ -270,7 +270,7 @@ func GetBenchmarks(cfg *Configuration, quorum int) []Bench {
}

// RunBenchmarks runs all the benchmarks that match the given regex with the given options
func RunBenchmarks(benchRegex *regexp.Regexp, options Options, cfg *Configuration, quorum int) ([]*Result, error) {
func RunBenchmarks(benchRegex *regexp.Regexp, options Options, cfg *BenchmarkConfiguration, quorum int) ([]*Result, error) {
benchmarks := GetBenchmarks(cfg, quorum)
var results []*Result
for _, b := range benchmarks {
Expand Down
149 changes: 79 additions & 70 deletions benchmark/benchmark_gorums.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (c *channel) newNodeStream(conn *grpc.ClientConn) error {
c.gorumsStream, err = c.gorumsClient.NodeStream(c.streamCtx)
c.streamMut.Unlock()
if err != nil {
fmt.Println("oops " + err.Error())
return err
}
c.streamBroken.clear()
Expand Down
2 changes: 1 addition & 1 deletion cmd/benchmark/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func main() {
gorums.WithSendBufferSize(*sendBuffer),
}

cfg, err := benchmark.NewConfiguration(gorums.WithNodeList(remotes[:options.NumNodes]), mgrOpts...)
cfg, err := benchmark.NewBenchmarkConfiguration(gorums.WithNodeList(remotes[:options.NumNodes]), mgrOpts...)
checkf("Failed to create configuration: %v", err)
defer cfg.Close()

Expand Down
Loading
Loading