Skip to content

Commit b9a53b3

Browse files
Merge branch 'test/throughput-vegeta' of https://github.com/noku-team/assertoor into test/throughput-vegeta
2 parents ce69400 + 768bbcd commit b9a53b3

File tree

1 file changed

+21
-0
lines changed
  • pkg/coordinator/tasks/tx_pool_throughput_analysis

1 file changed

+21
-0
lines changed

pkg/coordinator/tasks/tx_pool_throughput_analysis/task.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,25 @@ func (t *Task) LoadConfig() error {
8686
return nil
8787
}
8888

89+
func (t *Task) ReadP2PMessages(conn *sentry.Conn) string {
90+
91+
txs, err := conn.ReadTransactionMessages()
92+
readChan <- struct {
93+
txs *eth.TransactionsPacket
94+
err error
95+
}{txs, err}
96+
97+
98+
select {
99+
case result := <-readChan:
100+
if result.err != nil {
101+
t.logger.Errorf("Failed to read transaction messages: %v", result.err)
102+
t.ctx.SetResult(types.TaskResultFailure)
103+
return nil
104+
}
105+
gotTx += len(*result.txs)
106+
}
107+
89108
func (t *Task) Execute(ctx context.Context) error {
90109
err := t.wallet.AwaitReady(ctx)
91110
if err != nil {
@@ -131,6 +150,8 @@ func (t *Task) Execute(ctx context.Context) error {
131150

132151
// Create pacer for desired QPS over 1 second
133152
rate := vegeta.Rate{Freq: t.config.QPS, Per: time.Second}
153+
duration := time.Duration(t.config.QPS) * time.Second
154+
134155
pacer := vegeta.ConstantPacer{Freq: rate.Freq, Per: rate.Per}
135156

136157
// Attack with vegeta

0 commit comments

Comments
 (0)