Skip to content

Commit f2859a2

Browse files
feat(tx_pool_throughput_analysis): add rates for not received P2P events and coordinated omission events to metrics
1 parent fa5d521 commit f2859a2

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

pkg/coordinator/tasks/tx_pool_throughput_analysis/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ The `tx_pool_throughput_analysis` task evaluates the throughput of transaction p
2525
- `load_tps`: The sending TPS for this measurement
2626
- `processed_tps`: The actual processed TPS achieved
2727
- `not_received_p2p_event_count`: Count of transactions that didn't receive P2P events
28+
- `not_received_p2p_event_rate`: Rate of transactions that didn't receive P2P events
2829
- `coordinated_omission_event_count`: Count of coordinated omission events
30+
- `coordinated_omission_event_rate`: Rate of transactions with coordinated omission events
2931

3032
- **`total_sent_tx`**:
3133
The total number of transactions sent across all TPS measurements.

pkg/coordinator/tasks/tx_pool_throughput_analysis/task.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ var (
2727
)
2828

2929
type ThroughoutMeasure struct {
30-
LoadTPS int `json:"load_tps"`
31-
ProcessedTPS int `json:"processed_tps"`
32-
NotReceivedP2PEventCount int `json:"not_received_p2p_event_count"`
33-
CoordinatedOmissionEventCount int `json:"coordinated_omission_event_count"`
30+
LoadTPS int `json:"load_tps"`
31+
ProcessedTPS int `json:"processed_tps"`
32+
NotReceivedP2PEventCount int `json:"not_received_p2p_event_count"`
33+
NotReceivedP2PEventRate float64 `json:"not_received_p2p_event_rate"`
34+
CoordinatedOmissionEventCount int `json:"coordinated_omission_event_count"`
35+
CoordinatedOmissionEventRate float64 `json:"coordinated_omission_event_rate"`
3436
}
3537

3638
type Task struct {
@@ -152,15 +154,19 @@ func (t *Task) Execute(ctx context.Context) error {
152154
return err
153155
}
154156

157+
partialSentTx := sendingTps * t.config.DurationS
158+
155159
// add to throughoutMeasures
156160
throughoutMeasures = append(throughoutMeasures, ThroughoutMeasure{
157161
LoadTPS: sendingTps,
158162
ProcessedTPS: processedTps,
159163
NotReceivedP2PEventCount: notReceivedP2PEventCount,
164+
NotReceivedP2PEventRate: float64(notReceivedP2PEventCount) / float64(partialSentTx),
160165
CoordinatedOmissionEventCount: coordinatedOmissionEventCount,
166+
CoordinatedOmissionEventRate: float64(coordinatedOmissionEventCount) / float64(partialSentTx),
161167
})
162168

163-
totalSentTx += sendingTps * t.config.DurationS
169+
totalSentTx += partialSentTx
164170
missedP2PEventCount += notReceivedP2PEventCount
165171
totalCoordinatedOmissionEventCount += coordinatedOmissionEventCount
166172
}

0 commit comments

Comments
 (0)