mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
Use steady clock for all millis bench logging
This commit is contained in:
@@ -533,7 +533,7 @@ bool BerkeleyDatabase::Rewrite(const char* pszSkip)
|
||||
|
||||
void BerkeleyEnvironment::Flush(bool fShutdown)
|
||||
{
|
||||
int64_t nStart = GetTimeMillis();
|
||||
const auto start{SteadyClock::now()};
|
||||
// Flush log data to the actual data file on all files that are not in use
|
||||
LogPrint(BCLog::WALLETDB, "BerkeleyEnvironment::Flush: [%s] Flush(%s)%s\n", strPath, fShutdown ? "true" : "false", fDbEnvInit ? "" : " database not started");
|
||||
if (!fDbEnvInit)
|
||||
@@ -561,7 +561,7 @@ void BerkeleyEnvironment::Flush(bool fShutdown)
|
||||
no_dbs_accessed = false;
|
||||
}
|
||||
}
|
||||
LogPrint(BCLog::WALLETDB, "BerkeleyEnvironment::Flush: Flush(%s)%s took %15dms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " database not started", GetTimeMillis() - nStart);
|
||||
LogPrint(BCLog::WALLETDB, "BerkeleyEnvironment::Flush: Flush(%s)%s took %15dms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " database not started", Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
|
||||
if (fShutdown) {
|
||||
char** listp;
|
||||
if (no_dbs_accessed) {
|
||||
@@ -591,14 +591,14 @@ bool BerkeleyDatabase::PeriodicFlush()
|
||||
|
||||
const std::string strFile = fs::PathToString(m_filename);
|
||||
LogPrint(BCLog::WALLETDB, "Flushing %s\n", strFile);
|
||||
int64_t nStart = GetTimeMillis();
|
||||
const auto start{SteadyClock::now()};
|
||||
|
||||
// Flush wallet file so it's self contained
|
||||
env->CloseDb(m_filename);
|
||||
env->CheckpointLSN(strFile);
|
||||
m_refcount = -1;
|
||||
|
||||
LogPrint(BCLog::WALLETDB, "Flushed %s %dms\n", strFile, GetTimeMillis() - nStart);
|
||||
LogPrint(BCLog::WALLETDB, "Flushed %s %dms\n", strFile, Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user