reallyBusy counter

This commit is contained in:
voidlizard 2024-11-01 12:24:35 +03:00
parent 4dae285d25
commit 2ae8989c62
1 changed files with 5 additions and 1 deletions

View File

@ -350,7 +350,7 @@ blockDownloadLoop env0 = do
-- UPDATE-STATS-LOOP
void $ ContT $ withAsync $ updateRates e rates nonces
replicateM_ downT $ ContT $ withAsync do
void $ ContT $ withAsync do
forever do
pause @'Seconds 120
atomically do
@ -638,6 +638,10 @@ blockDownloadLoop env0 = do
S.yield =<< liftIO (readTVarIO sizeReq <&> ("sizeReq",) . fromIntegral . HashMap.size)
S.yield =<< liftIO (readTVarIO seen <&> ("seen",) . fromIntegral . HashMap.size)
b <- liftIO (readTVarIO busy) <&> HM.elems
let reallyBusy = sum [ 1 | v <- b, v > 0 ]
S.yield ("reallyBusy", reallyBusy)
forever do
withPeerM e $ withDownload env0 do
pause @'Seconds 5