From 2aa346db48266770f3c9bc5757cd0680ae63a6ca Mon Sep 17 00:00:00 2001 From: voidlizard Date: Fri, 1 Nov 2024 08:34:48 +0300 Subject: [PATCH] monotonic time probe --- hbs2-peer/app/PeerMain.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hbs2-peer/app/PeerMain.hs b/hbs2-peer/app/PeerMain.hs index 9b337638..6e7d6ad3 100644 --- a/hbs2-peer/app/PeerMain.hs +++ b/hbs2-peer/app/PeerMain.hs @@ -1151,6 +1151,13 @@ runPeer opts = respawnOnError opts $ runResourceT do peerThread "checkMetrics" (checkMetrics metrics metricsProbe) + t0 <- getTimeCoarse + + peerThread "monotonicTime" $ forever do + pause @'Seconds 10 + tx <- getTimeCoarse + acceptReport metricsProbe [("monotonicTime", fromIntegral (tx-t0) `div` round 1e9)] + peerThread "peerPingLoop" (peerPingLoop @e conf penv) peerThread "knownPeersPingLoop" (knownPeersPingLoop @e conf (SomeBrains brains))