Skip to content

Commit 8540b4a

Browse files
committed
add main loop
1 parent a4db677 commit 8540b4a

File tree

1 file changed

+8
-4
lines changed
  • pkg/coordinator/tasks/tx_pool_throughput_analysis

1 file changed

+8
-4
lines changed

pkg/coordinator/tasks/tx_pool_throughput_analysis/task.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,15 @@ func (t *Task) Execute(ctx context.Context) error {
133133
rate := vegeta.Rate{Freq: t.config.QPS, Per: time.Second}
134134
pacer := vegeta.ConstantPacer{Freq: rate.Freq, Per: rate.Per}
135135

136-
// Attack for 1 second duration
137-
duration := time.Second
138-
results := attacker.Attack(targeter, pacer, duration, "tx_attack")
136+
// Attack with vegeta
137+
var metrics vegeta.Metrics
138+
for res := range attacker.Attack(targeter, pacer, duration, "tx_attack") {
139+
metrics.Add(res)
140+
}
141+
metrics.Close()
142+
fmt.Printf("99th percentile: %s\n", metrics.Latencies.P99)
139143

140-
// Process results
144+
// Process results -- todo
141145
done := make(chan bool)
142146
go func() {
143147
defer close(done)

0 commit comments

Comments
 (0)