diff --git a/command.go b/command.go index 27bd976..0b27457 100644 --- a/command.go +++ b/command.go @@ -16,7 +16,8 @@ type CmdDequeue struct { } type Command struct { - Group string `json:"group"` + Group string `json:"group"` + Version string `json:"version"` } // func (cmd *Command) Encode() ([]byte, error) { diff --git a/main.go b/main.go index cecfc10..6357830 100644 --- a/main.go +++ b/main.go @@ -22,10 +22,6 @@ func main() { } -func init() { - -} - var Consumption = triggered.RegisterExecute(func(params *triggered.Params[bool]) { var nh *dragonboat.NodeHost @@ -60,7 +56,7 @@ var Consumption = triggered.RegisterExecute(func(params *triggered.Params[bool]) sysMB := float64(m.Sys) / 1024 / 1024 fmt.Printf("dequeue count %d, Alloc = %.2f MB, TotalAlloc = %.2f MB, Sys = %.2f MB\n", i, allocMB, totalAllocMB, sysMB) - time.Sleep(time.Second * 10) + time.Sleep(time.Second * 5) break } else { var item QueueItem diff --git a/start_test.go b/start_test.go index 44c40e6..33b0602 100644 --- a/start_test.go +++ b/start_test.go @@ -32,7 +32,7 @@ func TestStartNodeA(t *testing.T) { // this goroutine makes a linearizable read every 10 second. it returns the // Count value maintained in IStateMachine. see datastore.go for details. cs := nh.GetNoOPSession(128) - ticker := time.NewTicker(10 * time.Millisecond) + ticker := time.NewTicker(1 * time.Millisecond) for { select { case <-ticker.C: @@ -87,7 +87,7 @@ func TestStartNodeB(t *testing.T) { // Count value maintained in IStateMachine. see datastore.go for details. cs := nh.GetNoOPSession(128) - ticker := time.NewTicker(10 * time.Millisecond) + ticker := time.NewTicker(1 * time.Millisecond) for { select { case <-ticker.C: