mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-25 16:10:57 +00:00
Log high SHAMap destroy times in ~Ledger
This commit is contained in:
@@ -172,6 +172,43 @@ Ledger::Ledger (const std::string& rawLedger, bool hasPrefix) :
|
||||
initializeFees ();
|
||||
}
|
||||
|
||||
Ledger::~Ledger ()
|
||||
{
|
||||
double txDeleteSeconds = 0;
|
||||
|
||||
{
|
||||
int64 const startTime (Time::getHighResolutionTicks ());
|
||||
|
||||
mTransactionMap.reset ();
|
||||
|
||||
txDeleteSeconds = Time::highResolutionTicksToSeconds (
|
||||
Time::getHighResolutionTicks () - startTime);
|
||||
}
|
||||
|
||||
double acctDeleteSeconds = 0;
|
||||
|
||||
{
|
||||
int64 const startTime (Time::getHighResolutionTicks ());
|
||||
|
||||
mAccountStateMap.reset ();
|
||||
|
||||
acctDeleteSeconds = Time::highResolutionTicksToSeconds (
|
||||
Time::getHighResolutionTicks () - startTime);
|
||||
}
|
||||
|
||||
if (txDeleteSeconds >= 1)
|
||||
{
|
||||
WriteLog (lsWARNING, Ledger) << "mTransactionMap took " <<
|
||||
String (txDeleteSeconds, 1) << " seconds to destroy.";
|
||||
}
|
||||
|
||||
if (acctDeleteSeconds >= 1)
|
||||
{
|
||||
WriteLog (lsWARNING, Ledger) << "mAccountStateMap took " <<
|
||||
String (acctDeleteSeconds, 1) << " seconds to destroy.";
|
||||
}
|
||||
}
|
||||
|
||||
void Ledger::setImmutable ()
|
||||
{
|
||||
updateHash ();
|
||||
|
||||
@@ -80,6 +80,8 @@ public:
|
||||
|
||||
Ledger (Ledger & target, bool isMutable); // snapshot
|
||||
|
||||
~Ledger ();
|
||||
|
||||
static Ledger::pointer getSQL (const std::string & sqlStatement);
|
||||
static Ledger::pointer getSQL1 (SqliteStatement*);
|
||||
static void getSQL2 (Ledger::ref);
|
||||
|
||||
Reference in New Issue
Block a user