use monotonic clock when timing functions in harvester (#19567)

This commit is contained in:
Arvid Norberg
2025-05-05 08:44:44 -05:00
committed by GitHub
parent baceeb8417
commit 78ccd69885
+3 -3
View File
@@ -88,7 +88,7 @@ class HarvesterAPI:
f"sp_hash: {new_challenge.sp_hash}, signage_point_index: {new_challenge.signage_point_index}"
)
start = time.time()
start = time.monotonic()
assert len(new_challenge.challenge_hash) == 32
loop = asyncio.get_running_loop()
@@ -254,11 +254,11 @@ class HarvesterAPI:
self.harvester.log.debug(f"new_signage_point_harvester {passed} plots passed the plot filter")
# Concurrently executes all lookups on disk, to take advantage of multiple disk parallelism
time_taken = time.time() - start
time_taken = time.monotonic() - start
total_proofs_found = 0
for filename_sublist_awaitable in asyncio.as_completed(awaitables):
filename, sublist = await filename_sublist_awaitable
time_taken = time.time() - start
time_taken = time.monotonic() - start
if time_taken > 8:
self.harvester.log.warning(
f"Looking up qualities on {filename} took: {time_taken}. This should be below 8 seconds"