Commit 42b5f8e6 authored by duanjinfei's avatar duanjinfei

fix func

parent 5e0c5a6b
......@@ -21,7 +21,7 @@ func init() {
initCmd.PersistentFlags().BoolVar(&initCmp, "initCmp", false, "Start after initializing the account cmp balance")
startCmd.PersistentFlags().StringVar(&cpuProfile, "cpuProfile", "cpuProfile.prof", "Statistics cpu profile")
startCmd.PersistentFlags().BoolVar(&batchSign, "batchSign", false, "test grpc interface -> batchSign")
startCmd.PersistentFlags().BoolVar(&batchRecover, "batchRecover", false, "test grpc interface -> batchRecover")
startCmd.PersistentFlags().BoolVar(&batchRecover, "batchRecover", true, "test grpc interface -> batchRecover")
startCmd.PersistentFlags().BoolVar(&batchRecoverTx, "batchRecoverTx", false, "test grpc interface -> batchRecoverTx")
startCmd.PersistentFlags().BoolVar(&batchVerify, "batchVerify", false, "test grpc interface -> batchVerify")
startCmd.PersistentFlags().IntVar(&txCount, "txCount", 1000, "send tran count")
......
......@@ -123,13 +123,14 @@ func BatchRecoverHandler(tranArr []*types.Transaction, cfg *tool.Config) error {
log.Error("dial nebula failed", "err", err)
}
serviceClient := crypterv1.NewCrypterServiceClient(grpcClient)
go batchRecover(serviceClient, cfg.SleepTime)
for i := 0; i < cfg.GoRoutineCount; i++ {
go batchRecover(serviceClient, cfg.SleepTime)
}
allSignedTxCount = int64(len(tranArr))
startTime := time.Now()
for i := 0; i < int(allSignedTxCount); i++ {
req := crypterv1.BatchSignRequest{}
batchSignRequest <- &req
req := crypterv1.BatchRecoverRequest{}
batchRecoverRequest <- &req
}
for {
if bathHandleSendCount == allSignedTxCount {
......@@ -178,12 +179,14 @@ func BatchVerifyHandler(tranArr []*types.Transaction, cfg *tool.Config) error {
if err != nil {
log.Error("dial nebula failed", "err", err)
}
go batchVerify(crypterv1.NewCrypterServiceClient(client), cfg.SleepTime)
for i := 0; i < cfg.GoRoutineCount; i++ {
go batchVerify(crypterv1.NewCrypterServiceClient(client), cfg.SleepTime)
}
allSignedTxCount = int64(len(tranArr))
startTime := time.Now()
for i := 0; i < int(allSignedTxCount); i++ {
req := crypterv1.BatchSignRequest{}
batchSignRequest <- &req
req := crypterv1.BatchVerifyRequest{}
batchVerifyRequest <- &req
}
for {
......@@ -233,13 +236,14 @@ func BatchRecoverTxHandler(tranArr []*types.Transaction, cfg *tool.Config) error
if err != nil {
log.Error("dial nebula failed", "err", err)
}
go batchRecoverTx(crypterv1.NewCrypterServiceClient(client), cfg.SleepTime)
for i := 0; i < cfg.GoRoutineCount; i++ {
go batchRecoverTx(crypterv1.NewCrypterServiceClient(client), cfg.SleepTime)
}
allSignedTxCount = int64(len(tranArr))
startTime := time.Now()
for i := 0; i < int(allSignedTxCount); i++ {
req := crypterv1.BatchSignRequest{}
batchSignRequest <- &req
req := crypterv1.BatchRecoverTxRequest{}
batchRecoverTxRequest <- &req
}
for {
if bathHandleSendCount == allSignedTxCount {
......
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