add duration support in txgen

Signed-off-by: Leo Chen <leo@harmony.one>
pull/69/head
Leo Chen 6 years ago
parent 0a9bba8721
commit 9578a37a81
  1. 3
      client/txgen/main.go

@ -243,6 +243,7 @@ func main() {
maxNumTxsPerBatch := flag.Int("max_num_txs_per_batch", 100000, "number of transactions to send per message") maxNumTxsPerBatch := flag.Int("max_num_txs_per_batch", 100000, "number of transactions to send per message")
logFolder := flag.String("log_folder", "latest", "the folder collecting the logs of this execution") logFolder := flag.String("log_folder", "latest", "the folder collecting the logs of this execution")
numSubset := flag.Int("numSubset", 3, "the number of subsets of utxos to process separately") numSubset := flag.Int("numSubset", 3, "the number of subsets of utxos to process separately")
duration := flag.Int("duration", 60, "duration of the tx generation in second")
flag.Parse() flag.Parse()
// Read the configs // Read the configs
@ -310,7 +311,7 @@ func main() {
// Transaction generation process // Transaction generation process
time.Sleep(10 * time.Second) // wait for nodes to be ready time.Sleep(10 * time.Second) // wait for nodes to be ready
start := time.Now() start := time.Now()
totalTime := 60.0 //run for 1 minutes totalTime := float64(*duration)
batchCounter := 0 batchCounter := 0
for true { for true {

Loading…
Cancel
Save