mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-20 08:05:33 +03:00
print average block rate at different block height windows (#11064)
This commit is contained in:
parent
bb57ccffa9
commit
492503f109
@ -83,6 +83,7 @@ async def run_sync_test(file: Path, db_version, profile: bool, single_thread: bo
|
||||
|
||||
print()
|
||||
counter = 0
|
||||
height = 0
|
||||
async with aiosqlite.connect(file) as in_db:
|
||||
|
||||
rows = await in_db.execute(
|
||||
@ -109,10 +110,16 @@ async def run_sync_test(file: Path, db_version, profile: bool, single_thread: bo
|
||||
assert success
|
||||
assert advanced_peak
|
||||
counter += len(block_batch)
|
||||
print(f"\rheight {counter} {counter/(time.monotonic() - start_time):0.2f} blocks/s ", end="")
|
||||
height += len(block_batch)
|
||||
print(f"\rheight {height} {counter/(time.monotonic() - start_time):0.2f} blocks/s ", end="")
|
||||
block_batch = []
|
||||
if check_log.exit_with_failure:
|
||||
raise RuntimeError("error printed to log. exiting")
|
||||
|
||||
if counter >= 100000:
|
||||
start_time = time.monotonic()
|
||||
counter = 0
|
||||
print()
|
||||
finally:
|
||||
print("closing full node")
|
||||
full_node._close()
|
||||
|
Loading…
Reference in New Issue
Block a user