Skip to content

Commit d23a0b3

Browse files
feat(tx_pool_throughput_analysis): add max_tps metric to track maximum transactions per second during analysis
1 parent 6decd7e commit d23a0b3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pkg/coordinator/tasks/tx_pool_throughput_analysis/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ The `tx_pool_throughput_analysis` task evaluates the throughput of transaction p
2929
- `coordinated_omission_event_count`: Count of coordinated omission events
3030
- `coordinated_omission_event_rate`: Rate of transactions with coordinated omission events
3131

32+
- **`max_tps`**:
33+
The maximum TPS achieved during the test.
34+
3235
- **`total_sent_tx`**:
3336
The total number of transactions sent across all TPS measurements.
3437

pkg/coordinator/tasks/tx_pool_throughput_analysis/task.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ func (t *Task) Execute(ctx context.Context) error {
140140
t.logger.Infof("Iterating over the TPS range, starting TPS: %d, ending TPS: %d, increment TPS: %d",
141141
t.config.StartingTPS, t.config.EndingTPS, t.config.IncrementTPS)
142142

143+
maxTps := 0
143144
totalSentTx := 0
144145
missedP2PEventCount := 0
145146
totalCoordinatedOmissionEventCount := 0
@@ -166,6 +167,10 @@ func (t *Task) Execute(ctx context.Context) error {
166167
CoordinatedOmissionEventRate: float64(coordinatedOmissionEventCount) / float64(partialSentTx),
167168
})
168169

170+
if processedTps > maxTps {
171+
maxTps = processedTps
172+
}
173+
169174
totalSentTx += partialSentTx
170175
missedP2PEventCount += notReceivedP2PEventCount
171176
totalCoordinatedOmissionEventCount += coordinatedOmissionEventCount
@@ -185,6 +190,7 @@ func (t *Task) Execute(ctx context.Context) error {
185190
t.ctx.Outputs.SetVar("total_sent_tx", totalSentTx)
186191
t.ctx.Outputs.SetVar("missed_p2p_event_rate", float64(missedP2PEventCount)/float64(totalSentTx))
187192
t.ctx.Outputs.SetVar("coordinated_omission_event_rate", float64(totalCoordinatedOmissionEventCount)/float64(totalSentTx))
193+
t.ctx.Outputs.SetVar("max_tps", maxTps)
188194

189195
outputs := map[string]interface{}{
190196
"throughput_measures": throughoutMeasures,
@@ -197,6 +203,7 @@ func (t *Task) Execute(ctx context.Context) error {
197203
"total_sent_tx": totalSentTx,
198204
"missed_p2p_event_rate": float64(missedP2PEventCount) / float64(totalSentTx),
199205
"coordinated_omission_event_rate": float64(totalCoordinatedOmissionEventCount) / float64(totalSentTx),
206+
"max_tps": maxTps,
200207
}
201208

202209
outputsJSON, _ := json.Marshal(outputs)

0 commit comments

Comments
 (0)