mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-26 14:45:52 +00:00
clean up logs
This commit is contained in:
@@ -21,55 +21,6 @@ BackendIndexer::addKey(ripple::uint256&& key)
|
||||
keys.insert(std::move(key));
|
||||
}
|
||||
|
||||
void
|
||||
writeKeyFlagLedger(
|
||||
uint32_t ledgerSequence,
|
||||
uint32_t shift,
|
||||
BackendInterface const& backend,
|
||||
std::unordered_set<ripple::uint256> const& keys)
|
||||
{
|
||||
uint32_t nextFlag = ((ledgerSequence >> shift << shift) + (1 << shift));
|
||||
ripple::uint256 zero = {};
|
||||
BOOST_LOG_TRIVIAL(info)
|
||||
<< __func__
|
||||
<< " starting. ledgerSequence = " << std::to_string(ledgerSequence)
|
||||
<< " nextFlag = " << std::to_string(nextFlag)
|
||||
<< " keys.size() = " << std::to_string(keys.size());
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
auto [objects, curCursor, warning] =
|
||||
backend.fetchLedgerPage({}, nextFlag, 1);
|
||||
if (!warning)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(warning)
|
||||
<< __func__ << " flag ledger already written. sequence = "
|
||||
<< std::to_string(ledgerSequence)
|
||||
<< " next flag = " << std::to_string(nextFlag)
|
||||
<< "returning";
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
catch (DatabaseTimeout& t)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
auto start = std::chrono::system_clock::now();
|
||||
|
||||
backend.writeKeys(keys, KeyIndex{nextFlag}, true);
|
||||
backend.writeKeys({zero}, KeyIndex{nextFlag}, true);
|
||||
auto end = std::chrono::system_clock::now();
|
||||
BOOST_LOG_TRIVIAL(info)
|
||||
<< __func__
|
||||
<< " finished. ledgerSequence = " << std::to_string(ledgerSequence)
|
||||
<< " nextFlag = " << std::to_string(nextFlag)
|
||||
<< " keys.size() = " << std::to_string(keys.size())
|
||||
<< std::chrono::duration_cast<std::chrono::seconds>(end - start)
|
||||
.count();
|
||||
}
|
||||
void
|
||||
BackendIndexer::doKeysRepair(
|
||||
BackendInterface const& backend,
|
||||
@@ -218,7 +169,7 @@ BackendIndexer::writeKeyFlagLedgerAsync(
|
||||
void
|
||||
BackendIndexer::finish(uint32_t ledgerSequence, BackendInterface const& backend)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info)
|
||||
BOOST_LOG_TRIVIAL(debug)
|
||||
<< __func__
|
||||
<< " starting. sequence = " << std::to_string(ledgerSequence);
|
||||
bool isFirst = false;
|
||||
@@ -243,7 +194,7 @@ BackendIndexer::finish(uint32_t ledgerSequence, BackendInterface const& backend)
|
||||
}
|
||||
isFirst_ = false;
|
||||
keys = {};
|
||||
BOOST_LOG_TRIVIAL(info)
|
||||
BOOST_LOG_TRIVIAL(debug)
|
||||
<< __func__
|
||||
<< " finished. sequence = " << std::to_string(ledgerSequence);
|
||||
}
|
||||
|
||||
@@ -752,7 +752,7 @@ CassandraBackend::writeKeys(
|
||||
cbs.reserve(keys.size());
|
||||
uint32_t concurrentLimit =
|
||||
isAsync ? indexerMaxRequestsOutstanding : keys.size();
|
||||
BOOST_LOG_TRIVIAL(info)
|
||||
BOOST_LOG_TRIVIAL(debug)
|
||||
<< __func__ << " Ledger = " << std::to_string(index.keyIndex)
|
||||
<< " . num keys = " << std::to_string(keys.size())
|
||||
<< " . concurrentLimit = "
|
||||
@@ -779,7 +779,7 @@ CassandraBackend::writeKeys(
|
||||
concurrentLimit;
|
||||
});
|
||||
if (numSubmitted % 100000 == 0)
|
||||
BOOST_LOG_TRIVIAL(info)
|
||||
BOOST_LOG_TRIVIAL(debug)
|
||||
<< __func__ << " Submitted " << std::to_string(numSubmitted)
|
||||
<< " write requests. Completed "
|
||||
<< (keys.size() - numRemaining);
|
||||
|
||||
@@ -244,7 +244,7 @@ Pg::bulkInsert(char const* table, std::string const& records)
|
||||
assert(conn_.get());
|
||||
auto copyCmd = boost::format(R"(COPY %s FROM stdin)");
|
||||
auto formattedCmd = boost::str(copyCmd % table);
|
||||
BOOST_LOG_TRIVIAL(info) << __func__ << " " << formattedCmd;
|
||||
BOOST_LOG_TRIVIAL(debug) << __func__ << " " << formattedCmd;
|
||||
auto res = query(formattedCmd.c_str());
|
||||
if (!res || res.status() != PGRES_COPY_IN)
|
||||
{
|
||||
|
||||
@@ -313,7 +313,7 @@ ReportingETL::buildNextLedger(org::xrpl::rpc::v1::GetLedgerResponse& rawData)
|
||||
auto end = std::chrono::system_clock::now();
|
||||
|
||||
auto duration = ((end - start).count()) / 1000000000.0;
|
||||
BOOST_LOG_TRIVIAL(info)
|
||||
BOOST_LOG_TRIVIAL(debug)
|
||||
<< __func__ << " Accumulated " << std::to_string(accumTxns_)
|
||||
<< " transactions. Wrote in " << std::to_string(duration)
|
||||
<< " transactions per second = "
|
||||
@@ -321,7 +321,7 @@ ReportingETL::buildNextLedger(org::xrpl::rpc::v1::GetLedgerResponse& rawData)
|
||||
accumTxns_ = 0;
|
||||
}
|
||||
else
|
||||
BOOST_LOG_TRIVIAL(info) << __func__ << " skipping commit";
|
||||
BOOST_LOG_TRIVIAL(debug) << __func__ << " skipping commit";
|
||||
BOOST_LOG_TRIVIAL(debug)
|
||||
<< __func__ << " : "
|
||||
<< "Inserted/modified/deleted all objects. Number of objects = "
|
||||
|
||||
Reference in New Issue
Block a user