@@ -518,15 +518,23 @@ log_channel& datastore::create_channel(const boost::filesystem::path& location)
518518
519519void datastore::register_transaction_tpm_id (std::string_view tx_id, std::uint64_t tpm_id) {
520520 TRACE_START << " tx_id=" << std::string (tx_id) << " , tpm_id=" << tpm_id;
521- LOG_LP (INFO ) << " register_transaction_tpm_id called: tx_id=" << std::string (tx_id)
522- << " tpm_id=" << tpm_id
523- << " epoch_id_informed=" << epoch_id_informed_.load ();
524521 if (!impl_->is_tp_monitor_enabled ()) {
522+ LOG_LP (INFO ) << " register_transaction_tpm_id called: tx_id=" << std::string (tx_id)
523+ << " tpm_id=" << tpm_id
524+ << " tp_monitor=disabled" ;
525525 TRACE_END << " tp_monitor disabled" ;
526526 return ;
527527 }
528- std::lock_guard<std::mutex> lock (mtx_txid_tpmid_);
529- txid_to_tpmid_[std::string (tx_id)] = tpm_id;
528+ const auto start_time = std::chrono::steady_clock::now ();
529+ {
530+ std::lock_guard<std::mutex> lock (mtx_txid_tpmid_);
531+ txid_to_tpmid_[std::string (tx_id)] = tpm_id;
532+ }
533+ const auto elapsed_ms = std::chrono::duration_cast<std::chrono::milliseconds>(
534+ std::chrono::steady_clock::now () - start_time).count ();
535+ LOG_LP (INFO ) << " register_transaction_tpm_id called: tx_id=" << std::string (tx_id)
536+ << " tpm_id=" << tpm_id
537+ << " elapsed_ms=" << elapsed_ms;
530538 TRACE_END ;
531539}
532540
@@ -902,10 +910,16 @@ void datastore::rotate_epoch_file() {
902910}
903911
904912void datastore::register_transaction_for_epoch (std::string_view tx_id, epoch_id_type epoch_id) {
913+ const auto start_time = std::chrono::steady_clock::now ();
914+ {
915+ std::lock_guard<std::mutex> lock (mtx_epoch_txids_);
916+ epoch_to_txids_[epoch_id].emplace_back (tx_id);
917+ }
918+ const auto elapsed_ms = std::chrono::duration_cast<std::chrono::milliseconds>(
919+ std::chrono::steady_clock::now () - start_time).count ();
905920 LOG_LP (INFO ) << " register_transaction_for_epoch called: tx_id=" << std::string (tx_id)
906- << " epoch_id=" << epoch_id;
907- std::lock_guard<std::mutex> lock (mtx_epoch_txids_);
908- epoch_to_txids_[epoch_id].emplace_back (tx_id);
921+ << " epoch_id=" << epoch_id
922+ << " elapsed_ms=" << elapsed_ms;
909923}
910924
911925bool datastore::get_tpm_id_for_transaction (std::string_view tx_id, std::uint64_t & tpm_id) {
0 commit comments