@@ -1157,6 +1157,7 @@ where
1157
1157
1158
1158
// check if the job was cancelled, if so we can exit early
1159
1159
if self . cancel . is_cancelled ( ) {
1160
+ self . record_tx_metrics ( num_txs_considered, num_txs_simulated, num_txs_simulated_success, num_txs_simulated_fail) ;
1160
1161
return Ok ( Some ( ( ) ) ) ;
1161
1162
}
1162
1163
@@ -1224,20 +1225,23 @@ where
1224
1225
info. executed_senders . push ( tx. signer ( ) ) ;
1225
1226
info. executed_transactions . push ( tx. into_inner ( ) ) ;
1226
1227
}
1228
+ self . record_tx_metrics ( num_txs_considered, num_txs_simulated, num_txs_simulated_success, num_txs_simulated_fail) ;
1229
+ Ok ( None )
1230
+ }
1227
1231
1232
+ /// Record transaction metrics for payload building
1233
+ fn record_tx_metrics ( & self , considered : usize , simulated : usize , success : usize , fail : usize ) {
1228
1234
self . metrics
1229
1235
. payload_num_tx_considered
1230
- . record ( num_txs_considered as f64 ) ;
1236
+ . record ( considered as f64 ) ;
1231
1237
self . metrics
1232
1238
. payload_num_tx_simulated
1233
- . record ( num_txs_simulated as f64 ) ;
1239
+ . record ( simulated as f64 ) ;
1234
1240
self . metrics
1235
1241
. payload_num_tx_simulated_success
1236
- . record ( num_txs_simulated_success as f64 ) ;
1242
+ . record ( success as f64 ) ;
1237
1243
self . metrics
1238
1244
. payload_num_tx_simulated_fail
1239
- . record ( num_txs_simulated_fail as f64 ) ;
1240
-
1241
- Ok ( None )
1245
+ . record ( fail as f64 ) ;
1242
1246
}
1243
1247
}
0 commit comments