Skip to content

Commit 3cde31a

Browse files
committed
Log state sync progress in a single line
1 parent 9f8bee7 commit 3cde31a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

p2p/state.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,13 @@ async def _periodically_report_progress(self) -> None:
279279
while self.is_running:
280280
requested_nodes = sum(
281281
len(node_keys) for _, node_keys in self._active_requests.values())
282-
self.logger.info("====== State sync progress ========")
283-
self.logger.info("Nodes processed: %d", self._total_processed_nodes)
284-
self.logger.info("Nodes processed per second (average): %d",
285-
self._total_processed_nodes / self._timer.elapsed)
286-
self.logger.info("Nodes committed to DB: %d", self.scheduler.committed_nodes)
287-
self.logger.info("Nodes requested but not received yet: %d", requested_nodes)
288-
self.logger.info(
289-
"Nodes scheduled but not requested yet: %d", len(self.scheduler.requests))
290-
self.logger.info("Total nodes timed out: %d", self._total_timeouts)
282+
msg = "processed: %11d, " % self._total_processed_nodes
283+
msg += "tnps: %5d, " % (self._total_processed_nodes / self._timer.elapsed)
284+
msg += "committed: %11d, " % self.scheduler.committed_nodes
285+
msg += "requested: %7d, " % requested_nodes
286+
msg += "scheduled: %7d, " % len(self.scheduler.requests)
287+
msg += "timeouts: %5d, " % self._total_timeouts
288+
self.logger.info("State sync progress: %s", msg)
291289
try:
292290
await self.sleep(self._report_interval)
293291
except OperationCancelled:

0 commit comments

Comments
 (0)