diff --git a/client/txgen/main.go b/client/txgen/main.go index cefe92a68..f48e4d322 100644 --- a/client/txgen/main.go +++ b/client/txgen/main.go @@ -371,7 +371,7 @@ func main() { lock.Unlock() subsetCounter++ - //time.Sleep(5000 * time.Millisecond) + time.Sleep(3000 * time.Millisecond) } // Send a stop message to stop the nodes at the end diff --git a/p2p/peer.go b/p2p/peer.go index 96c60d592..943adf278 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -3,12 +3,14 @@ package p2p import ( "bytes" "encoding/binary" - "log" "net" + "runtime" "strings" "sync" + "time" "github.com/simple-rules/harmony-benchmark/attack" + "github.com/simple-rules/harmony-benchmark/log" "github.com/dedis/kyber" ) @@ -38,6 +40,8 @@ func BroadcastMessage(peers []Peer, msg []byte) { var wg sync.WaitGroup wg.Add(len(peers)) + log.Info("Start Broadcasting", "gomaxprocs", runtime.GOMAXPROCS(0)) + start := time.Now() for _, peer := range peers { peerCopy := peer go func() { @@ -46,6 +50,7 @@ func BroadcastMessage(peers []Peer, msg []byte) { }() } wg.Wait() + log.Info("Broadcasting Down", "time spent", time.Now().Sub(start).Seconds()) } // ConstructP2pMessage constructs the p2p message as [messageType, contentSize, content]