Skip to content

Commit

Permalink
CAD-391 output every 100th elided message
Browse files Browse the repository at this point in the history
  • Loading branch information
CodiePP committed Jan 3, 2020
1 parent 3a8126b commit 54c8875
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cardano-node/src/Cardano/Tracing/Tracers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ instance ElidingTracer
doelide (WithSeverity _ (WithTip _ (ChainDB.TraceLedgerReplayEvent _))) = True
doelide (WithSeverity _ (WithTip _ (ChainDB.TraceGCEvent _))) = True
doelide _ = False

conteliding _tform _tverb _tr _ (Nothing, _count) = return (Nothing, 0)
conteliding _tform _tverb tr ev (_old, count) = do
when (count > 0 && count `mod` 100 == 0) $ do -- report every 100th elided message
meta <- mkLOMeta (defineSeverity ev) (definePrivacyAnnotation ev)
traceNamedObject tr (meta, LogValue "messages elided so far" (PureI $ toInteger count))
return (Just ev, count + 1)

-- | Smart constructor of 'NodeTraces'.
--
Expand Down

0 comments on commit 54c8875

Please sign in to comment.