mirror of
https://github.com/tendermint/tendermint.git
synced 2026-06-02 04:16:20 +00:00
only call Sleep if it took us less than 1 sec. to generate txs
This commit is contained in:
@@ -168,7 +168,7 @@ func (t *transacter) sendLoop(connIndex int) {
|
||||
Params: rawParamsJSON,
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Printf("%v. Try reducing the connections count and increasing the rate.\n", errors.Wrap(err, "txs send failed"))
|
||||
fmt.Fprintf(os.Stderr, "%v. Try reducing the connections count and increasing the rate.\n", errors.Wrap(err, "txs send failed"))
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@@ -176,7 +176,9 @@ func (t *transacter) sendLoop(connIndex int) {
|
||||
}
|
||||
|
||||
timeToSend := time.Now().Sub(startTime)
|
||||
time.Sleep(time.Second - timeToSend)
|
||||
if timeToSend < 1*time.Second {
|
||||
time.Sleep(time.Second - timeToSend)
|
||||
}
|
||||
logger.Info(fmt.Sprintf("sent %d transactions", t.Rate), "took", timeToSend)
|
||||
case <-pingsTicker.C:
|
||||
// go-rpc server closes the connection in the absence of pings
|
||||
|
||||
Reference in New Issue
Block a user