Commit c8fc9288 authored by duanjinfei's avatar duanjinfei

add handler send tx count log print

parent 41f76f4a
......@@ -17,8 +17,8 @@ import (
)
var (
bathHandleSendCount, allSignedTxCount, totalSendTime int64
broadcastEthTxWithFromRequestsArr chan *ring.BroadcastEthTxWithFromRequests
bathHandleSendCount, allSignedTxCount, totalSendTime, beforeBathHandleSendCount int64
broadcastEthTxWithFromRequestsArr chan *ring.BroadcastEthTxWithFromRequests
)
func init() {
......@@ -62,6 +62,9 @@ func BroadcastTxArr(tranArr []*types.Transaction, cfg *tool.Config) error {
}
}
for {
time.Sleep(time.Second * 3)
log.Info("beforeBathHandleSendCount:", beforeBathHandleSendCount)
log.Infof("Send tran count: %d", bathHandleSendCount)
if bathHandleSendCount == allSignedTxCount {
log.Infof("Send tran count: %d", bathHandleSendCount)
log.Infof("Since time: %d ms", time.Since(startTime).Milliseconds())
......@@ -80,6 +83,7 @@ func broadcastTx(cfg *tool.Config, client ring.RingServiceClient) error {
sendTranStartTime := time.Now()
ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
defer cancel()
atomic.AddInt64(&beforeBathHandleSendCount, int64(len(broadcastEthTxWithFromRequests.List)))
_, err := client.BroadcastTxs(ctx, broadcastEthTxWithFromRequests)
if err != nil {
log.Error("BroadcastTxs Error:", err)
......
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