Skip to content

Commit

Permalink
Merge pull request #5864 from IntersectMBO/jutaro/new_tracer_fix
Browse files Browse the repository at this point in the history
Churn counters fix
  • Loading branch information
jutaro authored Jun 5, 2024
2 parents 4e70e55 + e529473 commit e975595
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 5 additions & 2 deletions cardano-node/src/Cardano/Node/Tracing/Consistency.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import Ouroboros.Network.KeepAlive (TraceKeepAliveClient (..))
import qualified Ouroboros.Network.NodeToClient as NtC
import Ouroboros.Network.NodeToNode (ErrorPolicyTrace (..), RemoteAddress, WithAddr (..))
import qualified Ouroboros.Network.NodeToNode as NtN
import Ouroboros.Network.PeerSelection.Governor (DebugPeerSelection (..),
import Ouroboros.Network.PeerSelection.Governor (ChurnCounters, DebugPeerSelection (..),
PeerSelectionCounters, TracePeerSelection (..))
import Ouroboros.Network.PeerSelection.LedgerPeers (TraceLedgerPeers)
import Ouroboros.Network.PeerSelection.PeerStateActions (PeerSelectionActionsTrace (..))
Expand Down Expand Up @@ -291,7 +291,9 @@ getAllNamespaces =
["Net", "PeerSelection", "Counters"])
(allNamespaces :: [Namespace
PeerSelectionCounters])

churnCountersNS = map (nsGetTuple . nsReplacePrefix
["Net", "Churn"])
(allNamespaces :: [Namespace ChurnCounters])
peerSelectionActionsNS = map (nsGetTuple . nsReplacePrefix
["Net", "PeerSelection", "Actions"])
(allNamespaces :: [Namespace
Expand Down Expand Up @@ -415,6 +417,7 @@ getAllNamespaces =
<> debugPeerSelectionNS
<> debugPeerSelectionResponderNS
<> peerSelectionCountersNS
<> churnCountersNS
<> peerSelectionActionsNS
<> connectionManagerNS
<> connectionManagerTransitionsNS
Expand Down
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 @@ -72,7 +72,7 @@ import Ouroboros.Network.KeepAlive (TraceKeepAliveClient (..))
import qualified Ouroboros.Network.NodeToClient as NtC
import Ouroboros.Network.NodeToNode (ErrorPolicyTrace (..), RemoteAddress, WithAddr (..))
import qualified Ouroboros.Network.NodeToNode as NtN
import Ouroboros.Network.PeerSelection.Governor (DebugPeerSelection (..),
import Ouroboros.Network.PeerSelection.Governor (ChurnCounters, DebugPeerSelection (..),
PeerSelectionCounters, TracePeerSelection (..))
import Ouroboros.Network.PeerSelection.LedgerPeers (TraceLedgerPeers)
import Ouroboros.Network.PeerSelection.PeerStateActions (PeerSelectionActionsTrace (..))
Expand Down Expand Up @@ -555,6 +555,12 @@ docTracersFirstPhase condConfigFileName = do
peerSelectionCountersTrDoc <- documentTracer (peerSelectionCountersTr ::
Trace IO PeerSelectionCounters)

churnCountersTr <- mkCardanoTracer
trBase trForward mbTrEKG
["Net", "Churn"]
configureTracers configReflection trConfig [churnCountersTr]
churnCountersTrDoc <- documentTracer (churnCountersTr :: Trace IO ChurnCounters)

peerSelectionActionsTr <- mkCardanoTracer
trBase trForward mbTrEKG
["Net", "PeerSelection", "Actions"]
Expand Down Expand Up @@ -731,6 +737,7 @@ docTracersFirstPhase condConfigFileName = do
<> debugPeerSelectionTrDoc
<> debugPeerSelectionResponderTrDoc
<> peerSelectionCountersTrDoc
<> churnCountersTrDoc
<> peerSelectionActionsTrDoc
<> connectionManagerTrDoc
<> connectionManagerTransitionsTrDoc
Expand Down

0 comments on commit e975595

Please sign in to comment.