Skip to content

Commit

Permalink
Trace the updated GSV
Browse files Browse the repository at this point in the history
  • Loading branch information
karknu committed Jul 1, 2020
1 parent 5f74eaf commit 901ffc8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ouroboros-network/src/Ouroboros/Network/KeepAlive.hs
Expand Up @@ -65,11 +65,14 @@ keepAliveClient tracer peer dqCtx KeepAliveInterval { keepAliveInterval } startT
Just startTime -> do
let rtt = diffTime endTime startTime
sample = fromSample startTime endTime payloadSize
gsv' <- atomically $ do
m <- readTVar dqCtx
assert (peer `M.member` m) $ do
let m' = M.adjust (\a -> a <> sample) peer m
writeTVar dqCtx m'
return $ (M.!) m' peer
traceWith tracer $ AddSample peer rtt gsv'

traceWith tracer $ AddSample peer rtt sample
atomically $ modifyTVar dqCtx $ \m ->
assert (peer `M.member` m) $
M.adjust (\a -> a <> sample) peer m
Nothing -> return ()

let keepAliveInterval' = case startTime_m of
Expand Down

0 comments on commit 901ffc8

Please sign in to comment.