Skip to content

Commit 6c5c10f

Browse files
runtime: adding timestamps
1 parent 8450fb5 commit 6c5c10f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/flamenco/runtime/fd_runtime.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,8 @@ fd_runtime_commit_txn( fd_runtime_t * runtime,
11881188
fd_txn_in_t const * txn_in,
11891189
fd_txn_out_t * txn_out ) {
11901190

1191+
txn_out->details.commit_start_timestamp = fd_tickcount();
1192+
11911193
fd_funk_txn_xid_t xid = { .ul = { fd_bank_slot_get( bank ), bank->idx } };
11921194

11931195
if( FD_UNLIKELY( txn_out->err.txn_err ) ) {
@@ -1314,6 +1316,10 @@ fd_runtime_prepare_and_execute_txn( fd_runtime_t * runtime,
13141316
fd_txn_in_t const * txn_in,
13151317
fd_txn_out_t * txn_out ) {
13161318

1319+
txn_out->details.prep_start_timestamp = fd_tickcount();
1320+
txn_out->details.exec_start_timestamp = LONG_MAX;
1321+
txn_out->details.commit_start_timestamp = LONG_MAX;
1322+
13171323
txn_out->accounts.accounts_cnt = 0UL;
13181324

13191325
txn_out->details.programs_to_reverify_cnt = 0UL;
@@ -1346,6 +1352,8 @@ fd_runtime_prepare_and_execute_txn( fd_runtime_t * runtime,
13461352
fees-only, we return early. */
13471353
txn_out->err.txn_err = fd_runtime_pre_execute_check( runtime, bank, txn_in, txn_out );
13481354

1355+
txn_out->details.exec_start_timestamp = fd_tickcount();
1356+
13491357
/* Execute the transaction. */
13501358
if( FD_LIKELY( txn_out->err.is_committable && !txn_out->err.is_fees_only ) ) {
13511359
txn_out->err.txn_err = fd_execute_txn( runtime, bank, txn_in, txn_out );

src/flamenco/runtime/fd_runtime.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ struct fd_txn_out {
174174
ulong priority_fee; /* Priority fee paid by the fee payer in the transaction */
175175
ulong tips; /* Jito tips paid during execution */
176176
ulong signature_count; /* Number of signatures in the transaction */
177+
long prep_start_timestamp;
178+
long exec_start_timestamp;
179+
long commit_start_timestamp;
177180
/* When a program is deployed or upgraded, we must queue it to be
178181
updated in the program cache (if it exists already) so that
179182
the cache entry's ELF / sBPF information can be updated for

0 commit comments

Comments
 (0)