Skip to content

Commit

Permalink
refactor(GODT-1570): Add selectCountFlag to select benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
LBeernaertProton authored and jameshoulahan committed Sep 19, 2022
1 parent 5e12e14 commit 5bf5ac4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions benchmarks/gluon_bench/imap_benchmarks/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
)

var selectReadOnlyFlag = flag.Bool("imap-select-readonly", false, "If set to true, perform a read only select (examine).")
var selectCallCountFlag = flag.Uint("imap-select-count", 1000, "Number of times to call select.")

type Select struct {
*stateTracker
Expand Down Expand Up @@ -39,9 +40,15 @@ func (s *Select) TearDown(ctx context.Context, addr net.Addr) error {

func (s *Select) Run(ctx context.Context, addr net.Addr) error {
RunParallelClientsWithMailbox(addr, s.MBoxes[0], *fetchReadOnly, func(cl *client.Client, index uint) {
_, err := cl.Select(s.MBoxes[0], *selectReadOnlyFlag)
if err != nil {
panic(err)
for i := uint(0); i < *selectCallCountFlag; i++ {
_, err := cl.Select(s.MBoxes[0], *selectReadOnlyFlag)
if err != nil {
panic(err)
}

if err := cl.Unselect(); err != nil {
panic(err)
}
}
})

Expand Down

0 comments on commit 5bf5ac4

Please sign in to comment.