mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-30 00:25:52 +00:00
add more logging
This commit is contained in:
@@ -53,6 +53,8 @@ doLedgerData(
|
||||
auto start = std::chrono::system_clock::now();
|
||||
auto [results, returnedMarker] =
|
||||
backend.doUpperBound(marker, ledger, limit);
|
||||
BOOST_LOG_TRIVIAL(debug)
|
||||
<< "doUpperBound returned " << results.size() << " results";
|
||||
|
||||
auto end = std::chrono::system_clock::now();
|
||||
|
||||
|
||||
@@ -273,6 +273,8 @@ flatMapReadObjectCallback(CassFuture* fut, void* cbData)
|
||||
else
|
||||
{
|
||||
auto finish = [&requestParams]() {
|
||||
BOOST_LOG_TRIVIAL(trace)
|
||||
<< "flatMapReadObjectCallback - finished a read";
|
||||
size_t batchSize = requestParams.batchSize;
|
||||
if (++(requestParams.numFinished) == batchSize)
|
||||
requestParams.cv.notify_all();
|
||||
|
||||
@@ -996,6 +996,7 @@ public:
|
||||
std::uint32_t seq,
|
||||
std::uint32_t limit) const
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(debug) << "Starting doUpperBound";
|
||||
CassStatement* statement = cass_prepared_bind(upperBound_);
|
||||
cass_statement_set_consistency(statement, CASS_CONSISTENCY_QUORUM);
|
||||
int64_t markerVal = marker ? marker.value() : INT64_MIN;
|
||||
@@ -1058,6 +1059,7 @@ public:
|
||||
cass_statement_free(statement);
|
||||
cass_future_free(fut);
|
||||
|
||||
BOOST_LOG_TRIVIAL(debug) << "doUpperBound - got keys";
|
||||
std::vector<ripple::uint256> keys;
|
||||
|
||||
CassIterator* iter = cass_iterator_from_result(res);
|
||||
@@ -1081,6 +1083,8 @@ public:
|
||||
}
|
||||
keys.push_back(ripple::uint256::fromVoid(outData));
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(debug)
|
||||
<< "doUpperBound - populated keys. num keys = " << keys.size();
|
||||
if (keys.size())
|
||||
{
|
||||
std::vector<LedgerObject> results;
|
||||
|
||||
4
test.py
4
test.py
@@ -52,7 +52,7 @@ async def ledger_data(ip, port, ledger, limit):
|
||||
address = 'ws://' + str(ip) + ':' + str(port)
|
||||
try:
|
||||
async with websockets.connect(address) as ws:
|
||||
await ws.send(json.dumps({"command":"ledger_data","ledger_index":int(ledger),"limit":int(limit)}))
|
||||
await ws.send(json.dumps({"command":"ledger_data","ledger_index":int(ledger),"limit":int(limit),"binary":True}))
|
||||
res = json.loads(await ws.recv())
|
||||
print(res)
|
||||
except websockets.exceptions.connectionclosederror as e:
|
||||
@@ -66,7 +66,7 @@ async def ledger_data_full(ip, port, ledger):
|
||||
marker = None
|
||||
while True:
|
||||
if marker is None:
|
||||
await ws.send(json.dumps({"command":"ledger_data","ledger_index":int(ledger)}))
|
||||
await ws.send(json.dumps({"command":"ledger_data","ledger_index":int(ledger),"binary":True}))
|
||||
res = json.loads(await ws.recv())
|
||||
print(res)
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ buildResponse(
|
||||
std::shared_ptr<PgPool>& pgPool)
|
||||
{
|
||||
std::string command = request.at("command").as_string().c_str();
|
||||
BOOST_LOG_TRIVIAL(info) << "Received rpc command : " << request;
|
||||
boost::json::object response;
|
||||
switch (commandMap[command])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user