aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
diff options
context:
space:
mode:
authorwarptangent <warptangent@inbox.com>2015-02-11 15:55:53 -0800
committerwarptangent <warptangent@inbox.com>2015-02-23 00:33:38 -0800
commit8529c0ea9aa305f097d4a2c89d581163e208e04f (patch)
tree84d39b41cac786d3f5b6ceb5128c2a412cd2e308 /src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
parentBlockchainDB: Add virtual function declarations for batch transactions (diff)
downloadmonero-8529c0ea9aa305f097d4a2c89d581163e208e04f.tar.xz
BlockchainDB, BlockchainLMDB: Add profiling for DB commits
Diffstat (limited to 'src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp')
-rw-r--r--src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
index c3c0724ce..25c25f399 100644
--- a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
+++ b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
@@ -33,6 +33,7 @@
#include "cryptonote_core/cryptonote_format_utils.h"
#include "crypto/crypto.h"
+#include "profile_tools.h"
using epee::string_tools::pod_to_hex;
@@ -1666,7 +1667,10 @@ void BlockchainLMDB::batch_commit()
throw0(DB_ERROR("batch transaction not in progress"));
check_open();
LOG_PRINT_L3("batch transaction: committing...");
+ TIME_MEASURE_START(time1);
m_write_txn->commit();
+ TIME_MEASURE_FINISH(time1);
+ time_commit1 += time1;
LOG_PRINT_L3("batch transaction: committed");
if (mdb_txn_begin(m_env, NULL, 0, m_write_batch_txn))
@@ -1685,7 +1689,10 @@ void BlockchainLMDB::batch_stop()
throw0(DB_ERROR("batch transaction not in progress"));
check_open();
LOG_PRINT_L3("batch transaction: committing...");
+ TIME_MEASURE_START(time1);
m_write_txn->commit();
+ TIME_MEASURE_FINISH(time1);
+ time_commit1 += time1;
// for destruction of batch transaction
m_write_txn = nullptr;
m_batch_active = false;
@@ -1741,7 +1748,10 @@ uint64_t BlockchainLMDB::add_block( const block& blk
{
m_write_txn = NULL;
+ TIME_MEASURE_START(time1);
txn.commit();
+ TIME_MEASURE_FINISH(time1);
+ time_commit1 += time1;
}
}
catch (...)