mempool_process_time_metric

This commit is contained in:
Jack Robison 2022-03-31 12:06:36 -04:00
parent 8e01f415d0
commit dfda41f85f
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -1,3 +1,5 @@
import time
import asyncio import asyncio
from scribe.blockchain.daemon import LBCDaemon from scribe.blockchain.daemon import LBCDaemon
from scribe.hub.session import SessionManager from scribe.hub.session import SessionManager
@ -45,7 +47,9 @@ class HubServerService(BlockchainReaderService):
def _detect_changes(self): def _detect_changes(self):
super()._detect_changes() super()._detect_changes()
start = time.perf_counter()
self.mempool_notifications.update(self.mempool.refresh()) self.mempool_notifications.update(self.mempool.refresh())
self.mempool.mempool_process_time_metric.observe(time.perf_counter() - start)
async def poll_for_changes(self): async def poll_for_changes(self):
await super().poll_for_changes() await super().poll_for_changes()