Skip to content

Commit

Permalink
feat: cache all metrics data for 10 seconds for performances reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
Psycojoker committed Feb 4, 2025
1 parent 555e3b7 commit 006342b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/aleph/web/controllers/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ async def fetch_eth_height() -> Optional[int]:
return -1 # We got a boggus value!


@cached(ttl=10)
async def get_metrics(session: DbSession, node_cache: NodeCache) -> Metrics:
sync_messages_reference_total = await fetch_reference_total_messages()
eth_reference_height = await fetch_eth_height()
Expand Down

0 comments on commit 006342b

Please sign in to comment.