From 7c34e4bb96da4cdff6f9c928d1563034a782d0d8 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 16 Jun 2021 16:47:41 -0400 Subject: [PATCH] logging --- lbry/wallet/server/block_processor.py | 2 ++ lbry/wallet/server/leveldb.py | 17 +---------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/lbry/wallet/server/block_processor.py b/lbry/wallet/server/block_processor.py index 82524b885..e3b63d723 100644 --- a/lbry/wallet/server/block_processor.py +++ b/lbry/wallet/server/block_processor.py @@ -442,7 +442,9 @@ class BlockProcessor: start = time.perf_counter() try: for block in blocks: + start = time.perf_counter() await self.run_in_thread_with_lock(self.advance_block, block) + self.logger.info("advanced to %i in %ds", self.height, time.perf_counter() - start) # TODO: we shouldnt wait on the search index updating before advancing to the next block # await self.db.search_index.claim_consumer(self.claim_producer()) self.db.search_index.clear_caches() diff --git a/lbry/wallet/server/leveldb.py b/lbry/wallet/server/leveldb.py index a17820439..0c2af0198 100644 --- a/lbry/wallet/server/leveldb.py +++ b/lbry/wallet/server/leveldb.py @@ -728,26 +728,11 @@ class LevelDB: batch_put(DB_PREFIXES.UTXO_PREFIX.value + hashX + suffix, value[-8:]) flush_data.adds.clear() - # Flush state last as it reads the wall time. - start_time = time.time() - add_count = len(flush_data.adds) - spend_count = len(flush_data.deletes) // 2 - - if self.db.for_sync: - block_count = flush_data.height - self.db_height - tx_count = flush_data.tx_count - self.db_tx_count - elapsed = time.time() - start_time - self.logger.info(f'advanced to {flush_data.height:,d} with ' - f'{tx_count:,d} txs, {add_count:,d} UTXO adds, ' - f'{spend_count:,d} spends, {op_count:,d} claim ops in ' - f'{elapsed:.1f}s, committing...') - self.utxo_flush_count = self.hist_flush_count self.db_height = flush_data.height self.db_tx_count = flush_data.tx_count self.db_tip = flush_data.tip - # self.flush_state(batch) - # + now = time.time() self.wall_time += now - self.last_flush self.last_flush = now