Skip to content

Commit

Permalink
Merge #3834
Browse files Browse the repository at this point in the history
3834: Better documentation generation for new-tracing r=jutaro a=jutaro

The format of the TOC is different and clearer. All messages with different namespace are now listed.

Co-authored-by: Yupanqui <[email protected]>
  • Loading branch information
iohk-bors[bot] and jutaro authored May 3, 2022
2 parents 4ef56ae + ab9a2aa commit 8cd2090
Show file tree
Hide file tree
Showing 6 changed files with 4,893 additions and 2,353 deletions.
9 changes: 8 additions & 1 deletion cardano-node/src/Cardano/Node/Tracing/Documentation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import Cardano.Node.Tracing.Tracers.BlockReplayProgress
import Cardano.Node.Tracing.Tracers.ChainDB
import Cardano.Node.Tracing.Tracers.Consensus
import Cardano.Node.Tracing.Tracers.Diffusion
import Cardano.Node.Tracing.Tracers.ForgingThreadStats (forgeThreadStats)
import Cardano.Node.Tracing.Tracers.ForgingThreadStats (docForgeStats, forgeThreadStats)
import Cardano.Node.Tracing.Tracers.KESInfo
import Cardano.Node.Tracing.Tracers.NodeToClient
import Cardano.Node.Tracing.Tracers.NodeToNode
Expand Down Expand Up @@ -402,6 +402,12 @@ docTracers configFileName outputFileName _ _ _ = do
(Either (Consensus.TraceLabelCreds (Consensus.TraceForgeEvent blk))
(Consensus.TraceLabelCreds TraceStartLeadershipCheckPlus)))

forgeThreadStatsTrDoc <- documentTracer trConfig forgeThreadStatsTr
(docForgeStats :: Documented
(Either
(Consensus.TraceLabelCreds (Consensus.TraceForgeEvent blk))
(Consensus.TraceLabelCreds TraceStartLeadershipCheckPlus)))

blockchainTimeTr <- mkCardanoTracer
trBase trForward mbTrEKG
"BlockchainTime"
Expand Down Expand Up @@ -871,6 +877,7 @@ docTracers configFileName outputFileName _ _ _ = do
<> localTxSubmissionServerTrDoc
<> mempoolTrDoc
<> forgeTrDoc
<> forgeThreadStatsTrDoc
<> blockchainTimeTrDoc
-- NodeToClient
<> keepAliveClientTrDoc
Expand Down
4 changes: 2 additions & 2 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/Diffusion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ docMux' = Documented [
[]
"Mux shutdown."
, DocMsg
["Terminating"]
["TCPInfo"]
[]
"Terminating."
"TCPInfo."
]

--------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import Cardano.Prelude hiding (All, concat, (:.:))
import Data.Aeson (Value (..), (.=))
import qualified Data.Map.Strict as Map

import Cardano.Node.Tracing.Tracers.StartLeadershipCheck (ForgeTracerType)
import Cardano.Node.Tracing.Tracers.StartLeadershipCheck (ForgeTracerType,
TraceStartLeadershipCheckPlus)
import Cardano.Slotting.Slot (SlotNo (..))
import Ouroboros.Consensus.Node.Tracers
import qualified Ouroboros.Consensus.Node.Tracers as Consensus
import Ouroboros.Consensus.Shelley.Node ()

--------------------------------------------------------------------------------
Expand Down Expand Up @@ -66,7 +68,10 @@ instance LogFormatting ForgeThreadStats where
emptyForgeThreadStats :: ForgeThreadStats
emptyForgeThreadStats = ForgeThreadStats 0 0 0 0 0

docForgeStats :: Documented ForgeThreadStats
docForgeStats :: Documented
(Either
(Consensus.TraceLabelCreds (Consensus.TraceForgeEvent blk))
(Consensus.TraceLabelCreds TraceStartLeadershipCheckPlus))
docForgeStats = Documented [
DocMsg
["ForgeStats"]
Expand Down
14 changes: 7 additions & 7 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ instance (ToJSONKey ntnAddr, ToJSONKey RelayAccessPoint, Show ntnAddr, Show exce
forHuman = pack . show

docLocalRootPeers :: Documented (TraceLocalRootPeers ntnAddr resolverError)
docLocalRootPeers = addDocumentedNamespace ["LocalRootPeers"] docLocalRootPeers'
docLocalRootPeers = addDocumentedNamespace [] docLocalRootPeers'

docLocalRootPeers' :: Documented (TraceLocalRootPeers ntnAddr resolverError)
docLocalRootPeers' = Documented [
Expand Down Expand Up @@ -456,7 +456,7 @@ instance LogFormatting (TracePeerSelection SockAddr) where
forHuman = pack . show

docPeerSelection :: Documented (TracePeerSelection SockAddr)
docPeerSelection = addDocumentedNamespace ["PeerSelection"] docPeerSelection'
docPeerSelection = addDocumentedNamespace [] docPeerSelection'

docPeerSelection' :: Documented (TracePeerSelection SockAddr)
docPeerSelection' = Documented [
Expand Down Expand Up @@ -706,7 +706,7 @@ instance LogFormatting (PeerSelectionActionsTrace SockAddr) where

docPeerSelectionActions :: Documented (PeerSelectionActionsTrace ntnAddr)
docPeerSelectionActions =
addDocumentedNamespace ["PeerSelectionActions"] docPeerSelectionActions'
addDocumentedNamespace [] docPeerSelectionActions'

docPeerSelectionActions' :: Documented (PeerSelectionActionsTrace ntnAddr)
docPeerSelectionActions' = Documented
Expand Down Expand Up @@ -984,7 +984,7 @@ docConnectionManager :: Documented
(ConnectionHandlerTrace
ntnVersion
ntnVersionData))
docConnectionManager = addDocumentedNamespace ["ConnectionManager"] docConnectionManager'
docConnectionManager = addDocumentedNamespace [] docConnectionManager'

docConnectionManager' :: Documented
(ConnectionManagerTrace
Expand Down Expand Up @@ -1171,7 +1171,7 @@ instance (Show addr, LogFormatting addr, ToJSON addr)


docServer :: Documented (ServerTrace ntnAddr)
docServer = addDocumentedNamespace ["Server"] docServer'
docServer = addDocumentedNamespace [] docServer'

docServer' :: Documented (ServerTrace ntnAddr)
docServer' = Documented
Expand Down Expand Up @@ -1345,12 +1345,12 @@ instance (ToJSON addr, Show addr)
docInboundGovernorLocal ::
Documented (InboundGovernorTrace LocalAddress)
docInboundGovernorLocal =
addDocumentedNamespace ["InboundGovernor"] docInboundGovernor
addDocumentedNamespace [] docInboundGovernor

docInboundGovernorRemote ::
Documented (InboundGovernorTrace SockAddr)
docInboundGovernorRemote =
addDocumentedNamespace ["LocalInboundGovernor"] docInboundGovernor
addDocumentedNamespace [] docInboundGovernor

docInboundGovernor :: Documented (InboundGovernorTrace peerAddr)
docInboundGovernor = Documented
Expand Down
Loading

0 comments on commit 8cd2090

Please sign in to comment.