clean up logs

This commit is contained in:
CJ Cobb
2021-05-28 22:05:08 -04:00
parent 562f96a30f
commit 7f16951a18
4 changed files with 7 additions and 56 deletions

View File

@@ -21,55 +21,6 @@ BackendIndexer::addKey(ripple::uint256&& key)
keys.insert(std::move(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 void
BackendIndexer::doKeysRepair( BackendIndexer::doKeysRepair(
BackendInterface const& backend, BackendInterface const& backend,
@@ -218,7 +169,7 @@ BackendIndexer::writeKeyFlagLedgerAsync(
void void
BackendIndexer::finish(uint32_t ledgerSequence, BackendInterface const& backend) BackendIndexer::finish(uint32_t ledgerSequence, BackendInterface const& backend)
{ {
BOOST_LOG_TRIVIAL(info) BOOST_LOG_TRIVIAL(debug)
<< __func__ << __func__
<< " starting. sequence = " << std::to_string(ledgerSequence); << " starting. sequence = " << std::to_string(ledgerSequence);
bool isFirst = false; bool isFirst = false;
@@ -243,7 +194,7 @@ BackendIndexer::finish(uint32_t ledgerSequence, BackendInterface const& backend)
} }
isFirst_ = false; isFirst_ = false;
keys = {}; keys = {};
BOOST_LOG_TRIVIAL(info) BOOST_LOG_TRIVIAL(debug)
<< __func__ << __func__
<< " finished. sequence = " << std::to_string(ledgerSequence); << " finished. sequence = " << std::to_string(ledgerSequence);
} }

View File

@@ -752,7 +752,7 @@ CassandraBackend::writeKeys(
cbs.reserve(keys.size()); cbs.reserve(keys.size());
uint32_t concurrentLimit = uint32_t concurrentLimit =
isAsync ? indexerMaxRequestsOutstanding : keys.size(); isAsync ? indexerMaxRequestsOutstanding : keys.size();
BOOST_LOG_TRIVIAL(info) BOOST_LOG_TRIVIAL(debug)
<< __func__ << " Ledger = " << std::to_string(index.keyIndex) << __func__ << " Ledger = " << std::to_string(index.keyIndex)
<< " . num keys = " << std::to_string(keys.size()) << " . num keys = " << std::to_string(keys.size())
<< " . concurrentLimit = " << " . concurrentLimit = "
@@ -779,7 +779,7 @@ CassandraBackend::writeKeys(
concurrentLimit; concurrentLimit;
}); });
if (numSubmitted % 100000 == 0) if (numSubmitted % 100000 == 0)
BOOST_LOG_TRIVIAL(info) BOOST_LOG_TRIVIAL(debug)
<< __func__ << " Submitted " << std::to_string(numSubmitted) << __func__ << " Submitted " << std::to_string(numSubmitted)
<< " write requests. Completed " << " write requests. Completed "
<< (keys.size() - numRemaining); << (keys.size() - numRemaining);

View File

@@ -244,7 +244,7 @@ Pg::bulkInsert(char const* table, std::string const& records)
assert(conn_.get()); assert(conn_.get());
auto copyCmd = boost::format(R"(COPY %s FROM stdin)"); auto copyCmd = boost::format(R"(COPY %s FROM stdin)");
auto formattedCmd = boost::str(copyCmd % table); auto formattedCmd = boost::str(copyCmd % table);
BOOST_LOG_TRIVIAL(info) << __func__ << " " << formattedCmd; BOOST_LOG_TRIVIAL(debug) << __func__ << " " << formattedCmd;
auto res = query(formattedCmd.c_str()); auto res = query(formattedCmd.c_str());
if (!res || res.status() != PGRES_COPY_IN) if (!res || res.status() != PGRES_COPY_IN)
{ {

View File

@@ -313,7 +313,7 @@ ReportingETL::buildNextLedger(org::xrpl::rpc::v1::GetLedgerResponse& rawData)
auto end = std::chrono::system_clock::now(); auto end = std::chrono::system_clock::now();
auto duration = ((end - start).count()) / 1000000000.0; auto duration = ((end - start).count()) / 1000000000.0;
BOOST_LOG_TRIVIAL(info) BOOST_LOG_TRIVIAL(debug)
<< __func__ << " Accumulated " << std::to_string(accumTxns_) << __func__ << " Accumulated " << std::to_string(accumTxns_)
<< " transactions. Wrote in " << std::to_string(duration) << " transactions. Wrote in " << std::to_string(duration)
<< " transactions per second = " << " transactions per second = "
@@ -321,7 +321,7 @@ ReportingETL::buildNextLedger(org::xrpl::rpc::v1::GetLedgerResponse& rawData)
accumTxns_ = 0; accumTxns_ = 0;
} }
else else
BOOST_LOG_TRIVIAL(info) << __func__ << " skipping commit"; BOOST_LOG_TRIVIAL(debug) << __func__ << " skipping commit";
BOOST_LOG_TRIVIAL(debug) BOOST_LOG_TRIVIAL(debug)
<< __func__ << " : " << __func__ << " : "
<< "Inserted/modified/deleted all objects. Number of objects = " << "Inserted/modified/deleted all objects. Number of objects = "