Commit 8fcd8558 authored by Ubuntu's avatar Ubuntu

test ok

parent 76c4f4de
......@@ -20,7 +20,7 @@ var originalTxsHashQueue chan *[]byte = make(chan *[]byte, 1000)
var batchTxsForRedis chan *OriginalBatchTxs = make(chan *OriginalBatchTxs, batchTxHashSize*batchTxHashQueueSize)
const batchTxSize = 10000
const batchTxHashSize = 100
const batchTxHashSize = 30
const batchTxHashQueueSize = 10
type OriginalBatchTxs struct {
......
......@@ -3,7 +3,7 @@ package multisend
import (
"context"
"encoding/json"
"fmt"
//"fmt"
"runtime"
"time"
......@@ -49,7 +49,7 @@ func Start() {
limiter.Wait(cxt)
select {
case batchTxs := <-batchTxsForRedis:
startTime := time.Now()
//startTime := time.Now()
// data, err := proto.Marshal(txs)
// if err != nil {
// panic(err)
......@@ -66,7 +66,7 @@ func Start() {
}
count += 1
fmt.Printf("count %d txs size: %d takes %v time: %s \n", count, len(batchTxsAsBytes), time.Since(startTime), time.Now())
//fmt.Printf("count %d txs size: %d takes %v time: %s \n", count, len(batchTxsAsBytes), time.Since(startTime), time.Now())
}
}
}
......@@ -17,7 +17,7 @@ import (
const (
connSendTimeout = 10 * time.Second
connPingPeriod = (30 * 9 / 10) * time.Second
connPingPeriod = 3 * time.Second
defaultProgressCallbackInterval = 5 * time.Second
)
......
......@@ -9,19 +9,19 @@ func TestTransactor(t *testing.T) {
go StartProduceTx()
for {
if len(originalTxsHashQueue) >= 10 {
break
}
t.Logf("waiting for produce original tx, len(originalTxsHashQueue):%d \n", len(originalTxsHashQueue))
time.Sleep(1 * time.Second)
}
//for {
// if len(originalTxsHashQueue) >= 10 {
// break
// }
// t.Logf("waiting for produce original tx, len(originalTxsHashQueue):%d \n", len(originalTxsHashQueue))
// time.Sleep(1 * time.Second)
//}
cfg := Config{
Rate: 5,
Count: 30,
Rate: 1,
Count: 3000,
Connections: 1,
Time: 100,
Time: 1000000,
SendPeriod: 3,
ClientFactory: "ethclient",
}
......@@ -36,6 +36,6 @@ func TestTransactor(t *testing.T) {
//transactor.sendLoop()
transactor.Start()
time.Sleep(time.Second * 120)
time.Sleep(time.Hour * 1)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment