Skip to content

Commit cf6e5ec

Browse files
Feat/percentage measurement (#16)
* feat(throughput): calculate and include total sent transactions and event count percentages in output metrics * refactor(throughput): remove TODO comment for missed event percentages in transaction output metrics * feat(tx_pool_latency_analysis): add duplicated and missed P2P event counts and their percentages to output metrics * feat(tx_pool_throughput_analysis): enhance output metrics with detailed throughput measures and additional event counts * fix(tx_pool_latency_analysis, tx_pool_throughput_analysis): ensure accurate percentage calculations for event counts by converting to float64 * chore(tx_pool_analysis): increase timeout values for throughput and latency analysis tasks to ensure adequate testing duration
1 parent aac8c9a commit cf6e5ec

File tree

5 files changed

+81
-21
lines changed

5 files changed

+81
-21
lines changed

pkg/coordinator/tasks/tx_pool_latency_analysis/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@ The `tx_pool_latency_analysis` task evaluates latency of transaction processing
3232
- **`tx_pool_latency_hdr_plot`**:
3333
The HDR plot of the transaction pool latency.
3434

35+
- **`duplicated_p2p_event_count`**:
36+
The number of duplicated P2P events.
37+
38+
- **`missed_p2p_event_count`**:
39+
The number of missed P2P events.
40+
41+
- **`coordinated_omission_event_count`**:
42+
The number of coordinated omission events.
43+
44+
- **`duplicated_p2p_event_count_percentage`**:
45+
The percentage of duplicated P2P events.
46+
47+
- **`missed_p2p_event_count_percentage`**:
48+
The percentage of missed P2P events.
49+
50+
- **`coordinated_omission_event_count_percentage`**:
51+
The percentage of coordinated omission events.
52+
3553
### Defaults
3654

3755
```yaml

pkg/coordinator/tasks/tx_pool_latency_analysis/task.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,24 @@ func (t *Task) Execute(ctx context.Context) error {
217217
t.ctx.Outputs.SetVar("duplicated_p2p_event_count", result.DuplicatedP2PEventCount)
218218
t.ctx.Outputs.SetVar("missed_p2p_event_count", result.NotReceivedP2PEventCount)
219219
t.ctx.Outputs.SetVar("coordinated_omission_event_count", result.CoordinatedOmissionEventCount)
220+
t.ctx.Outputs.SetVar("duplicated_p2p_event_count_percentage", float64(result.DuplicatedP2PEventCount)/float64(result.TotalTxs))
221+
t.ctx.Outputs.SetVar("missed_p2p_event_count_percentage", float64(result.NotReceivedP2PEventCount)/float64(result.TotalTxs))
222+
t.ctx.Outputs.SetVar("coordinated_omission_event_count_percentage", float64(result.CoordinatedOmissionEventCount)/float64(result.TotalTxs))
220223
t.ctx.Outputs.SetVar("hdr_plot", plot)
221224

222225
t.ctx.SetResult(types.TaskResultSuccess)
223226

224227
outputs := map[string]interface{}{
225-
"tx_count": result.TotalTxs,
226-
"min_latency_mus": minLatency,
227-
"max_latency_mus": maxLatency,
228-
"tx_pool_latency_hdr_plot": plot,
229-
"duplicated_p2p_event_count": result.DuplicatedP2PEventCount,
230-
"coordinated_omission_events_count": result.CoordinatedOmissionEventCount,
231-
"missed_p2p_event_count": result.NotReceivedP2PEventCount,
228+
"tx_count": result.TotalTxs,
229+
"min_latency_mus": minLatency,
230+
"max_latency_mus": maxLatency,
231+
"tx_pool_latency_hdr_plot": plot,
232+
"duplicated_p2p_event_count": result.DuplicatedP2PEventCount,
233+
"coordinated_omission_events_count": result.CoordinatedOmissionEventCount,
234+
"missed_p2p_event_count": result.NotReceivedP2PEventCount,
235+
"duplicated_p2p_event_count_percentage": float64(result.DuplicatedP2PEventCount) / float64(result.TotalTxs),
236+
"missed_p2p_event_count_percentage": float64(result.NotReceivedP2PEventCount) / float64(result.TotalTxs),
237+
"coordinated_omission_event_count_percentage": float64(result.CoordinatedOmissionEventCount) / float64(result.TotalTxs),
232238
}
233239

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

pkg/coordinator/tasks/tx_pool_throughput_analysis/README.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,39 @@ The `tx_pool_throughput_analysis` task evaluates the throughput of transaction p
2020

2121
### Outputs
2222

23-
- **`tx_count`**:
24-
The total number of transactions sent.
23+
- **`throughput_measures`**:
24+
An array of throughput measurement objects, each containing:
25+
- `load_tps`: The sending TPS for this measurement
26+
- `processed_tps`: The actual processed TPS achieved
27+
- `not_received_p2p_event_count`: Count of transactions that didn't receive P2P events
28+
- `coordinated_omission_event_count`: Count of coordinated omission events
2529

26-
- **`mean_tps_throughput`**:
27-
The mean throughput (tps)
30+
- **`total_sent_tx`**:
31+
The total number of transactions sent across all TPS measurements.
32+
33+
- **`missed_p2p_event_count`**:
34+
The total count of missed P2P events across all measurements.
35+
36+
- **`coordinated_omission_event_count`**:
37+
The total count of coordinated omission events across all measurements.
38+
39+
- **`missed_p2p_event_count_percentage`**:
40+
The percentage of transactions that missed P2P events.
41+
42+
- **`coordinated_omission_event_count_percentage`**:
43+
The percentage of transactions with coordinated omission events.
44+
45+
- **`starting_tps`**:
46+
The starting TPS value used in the test.
47+
48+
- **`ending_tps`**:
49+
The ending TPS value used in the test.
50+
51+
- **`increment_tps`**:
52+
The TPS increment value used between measurements.
53+
54+
- **`duration_s`**:
55+
The duration in seconds for each TPS measurement.
2856

2957
### Defaults
3058

pkg/coordinator/tasks/tx_pool_throughput_analysis/task.go

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

141+
totalSentTx := 0
141142
missedP2PEventCount := 0
142143
totalCoordinatedOmissionEventCount := 0
143144

@@ -159,6 +160,7 @@ func (t *Task) Execute(ctx context.Context) error {
159160
CoordinatedOmissionEventCount: coordinatedOmissionEventCount,
160161
})
161162

163+
totalSentTx += sendingTps * t.config.DurationS
162164
missedP2PEventCount += notReceivedP2PEventCount
163165
totalCoordinatedOmissionEventCount += coordinatedOmissionEventCount
164166
}
@@ -174,15 +176,21 @@ func (t *Task) Execute(ctx context.Context) error {
174176
t.ctx.Outputs.SetVar("ending_tps", t.config.EndingTPS)
175177
t.ctx.Outputs.SetVar("increment_tps", t.config.IncrementTPS)
176178
t.ctx.Outputs.SetVar("duration_s", t.config.DurationS)
179+
t.ctx.Outputs.SetVar("total_sent_tx", totalSentTx)
180+
t.ctx.Outputs.SetVar("missed_p2p_event_count_percentage", float64(missedP2PEventCount)/float64(totalSentTx))
181+
t.ctx.Outputs.SetVar("coordinated_omission_event_count_percentage", float64(totalCoordinatedOmissionEventCount)/float64(totalSentTx))
177182

178183
outputs := map[string]interface{}{
179-
"throughput_measures": throughoutMeasures,
180-
"missed_p2p_event_count": missedP2PEventCount,
181-
"coordinated_omission_event_count": totalCoordinatedOmissionEventCount,
182-
"starting_tps": t.config.StartingTPS,
183-
"ending_tps": t.config.EndingTPS,
184-
"increment_tps": t.config.IncrementTPS,
185-
"duration_s": t.config.DurationS,
184+
"throughput_measures": throughoutMeasures,
185+
"missed_p2p_event_count": missedP2PEventCount,
186+
"coordinated_omission_event_count": totalCoordinatedOmissionEventCount,
187+
"starting_tps": t.config.StartingTPS,
188+
"ending_tps": t.config.EndingTPS,
189+
"increment_tps": t.config.IncrementTPS,
190+
"duration_s": t.config.DurationS,
191+
"total_sent_tx": totalSentTx,
192+
"missed_p2p_event_count_percentage": float64(missedP2PEventCount) / float64(totalSentTx),
193+
"coordinated_omission_event_count_percentage": float64(totalCoordinatedOmissionEventCount) / float64(totalSentTx),
186194
}
187195

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

playbooks/dev/tx-pool-check.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ tasks:
2020
config:
2121
waitTime: 5
2222
- name: tx_pool_throughput_analysis
23-
timeout: 5m
23+
timeout: 15m
2424
title: "Check transaction pool throughput from 100 to 1000 TPS with 100 TPS increment, duration 2s per test"
2525
config:
2626
startingTps: 100
@@ -37,7 +37,7 @@ tasks:
3737
waitTime: 5
3838
- name: tx_pool_latency_analysis
3939
title: "Check transaction pool latency with 5.000 transactions in one second, duration 5s"
40-
timeout: 5m
40+
timeout: 15m
4141
config:
4242
tps: 5000
4343
durationS: 5
@@ -50,7 +50,7 @@ tasks:
5050
config:
5151
waitTime: 5
5252
- name: tx_pool_throughput_analysis
53-
timeout: 15m
53+
timeout: 30m
5454
title: "Check transaction pool throughput from 1000 to 5000 TPS with 500 TPS increment, duration 2s per test"
5555
config:
5656
startingTps: 1000

0 commit comments

Comments
 (0)