mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
lh stats
This commit is contained in:
@@ -56,6 +56,10 @@ LedgerHistory::insert(
|
||||
std::shared_ptr<Ledger const> const& ledger,
|
||||
bool validated)
|
||||
{
|
||||
static unsigned long call_count{0};
|
||||
JLOG(j_.debug()) << "LedgerHistory lock stats,"
|
||||
<< ", insert, call_count = " << call_count++;
|
||||
|
||||
if (!ledger->isImmutable())
|
||||
LogicError("mutable Ledger in insert");
|
||||
|
||||
@@ -74,6 +78,10 @@ LedgerHistory::insert(
|
||||
LedgerHash
|
||||
LedgerHistory::getLedgerHash(LedgerIndex index)
|
||||
{
|
||||
static unsigned long call_count{0};
|
||||
JLOG(j_.debug()) << "LedgerHistory lock stats,"
|
||||
<< ", getLedgerHash, call_count = " << call_count++;
|
||||
|
||||
if (auto it = mLedgersByIndex.find(index); it != mLedgersByIndex.end())
|
||||
return it->second;
|
||||
return {};
|
||||
@@ -82,6 +90,10 @@ LedgerHistory::getLedgerHash(LedgerIndex index)
|
||||
std::shared_ptr<Ledger const>
|
||||
LedgerHistory::getLedgerBySeq(LedgerIndex index)
|
||||
{
|
||||
static unsigned long call_count{0};
|
||||
JLOG(j_.debug()) << "LedgerHistory lock stats,"
|
||||
<< ", getLedgerBySeq, call_count = " << call_count++;
|
||||
|
||||
{
|
||||
auto it = mLedgersByIndex.find(index);
|
||||
|
||||
@@ -525,6 +537,10 @@ LedgerHistory::validatedLedger(
|
||||
bool
|
||||
LedgerHistory::fixIndex(LedgerIndex ledgerIndex, LedgerHash const& ledgerHash)
|
||||
{
|
||||
static unsigned long call_count{0};
|
||||
JLOG(j_.debug()) << "LedgerHistory lock stats,"
|
||||
<< ", fixIndex, call_count = " << call_count++;
|
||||
|
||||
auto ledger = m_ledgers_by_hash.fetch(ledgerHash);
|
||||
auto it = mLedgersByIndex.find(ledgerIndex);
|
||||
if (ledger && (it != mLedgersByIndex.end()) && (it->second != ledgerHash))
|
||||
|
||||
Reference in New Issue
Block a user