Skip to content

Commit

Permalink
fixup! Upgraded to ouroboros-network-0.15.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed May 7, 2024
1 parent 087491b commit fca9108
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1629,6 +1629,15 @@ forMachineGov _dtal (InboundGovernor.TrInboundGovernorError err) =
mconcat [ "kind" .= String "InboundGovernorError"
, "remoteSt" .= String (pack . show $ err)
]
forMachineGov _dtal (InboundGovernor.TrMaturedConnections matured fresh) =
mconcat [ "kind" .= String "MaturedConnections"
, "matured" .= toJSON matured
, "fresh" .= toJSON fresh
]
forMachineGov _dtal (InboundGovernor.TrInactive fresh) =
mconcat [ "kind" .= String "Inactive"
, "fresh" .= toJSON fresh
]

instance MetaTrace (InboundGovernorTrace addr) where
namespaceFor TrNewConnection {} = Namespace [] ["NewConnection"]
Expand All @@ -1650,6 +1659,10 @@ instance MetaTrace (InboundGovernorTrace addr) where
Namespace [] ["UnexpectedlyFalseAssertion"]
namespaceFor InboundGovernor.TrInboundGovernorError {} =
Namespace [] ["InboundGovernorError"]
namespaceFor InboundGovernor.TrMaturedConnections {} =
Namespace [] ["MaturedConnections"]
namespaceFor InboundGovernor.TrInactive {} =
Namespace [] ["Inactive"]

severityFor (Namespace _ ["NewConnection"]) _ = Just Debug
severityFor (Namespace _ ["ResponderRestarted"]) _ = Just Debug
Expand All @@ -1668,6 +1681,8 @@ instance MetaTrace (InboundGovernorTrace addr) where
severityFor (Namespace _ ["RemoteState"]) _ = Just Debug
severityFor (Namespace _ ["UnexpectedlyFalseAssertion"]) _ = Just Error
severityFor (Namespace _ ["InboundGovernorError"]) _ = Just Error
severityFor (Namespace _ ["MaturedConnections"]) _ = Just Info
severityFor (Namespace _ ["Inactive"]) _ = Just Debug
severityFor _ _ = Nothing

documentFor (Namespace _ ["NewConnection"]) = Just ""
Expand All @@ -1693,6 +1708,8 @@ instance MetaTrace (InboundGovernorTrace addr) where
documentFor (Namespace _ ["RemoteState"]) = Just ""
documentFor (Namespace _ ["UnexpectedlyFalseAssertion"]) = Just ""
documentFor (Namespace _ ["InboundGovernorError"]) = Just ""
documentFor (Namespace _ ["MaturedConnections"]) = Just ""
documentFor (Namespace _ ["Inactive"]) = Just ""
documentFor _ = Nothing

metricsDocFor (Namespace [] ["InboundGovernorCounters"]) =
Expand Down Expand Up @@ -1735,6 +1752,8 @@ instance MetaTrace (InboundGovernorTrace addr) where
, Namespace [] ["RemoteState"]
, Namespace [] ["UnexpectedlyFalseAssertion"]
, Namespace [] ["InboundGovernorError"]
, Namespace [] ["MaturedConnections"]
, Namespace [] ["Inactive"]
]

--------------------------------------------------------------------------------
Expand Down
11 changes: 11 additions & 0 deletions cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,8 @@ instance HasSeverityAnnotation (InboundGovernorTrace addr) where
InboundGovernor.TrUnexpectedlyFalseAssertion {}
-> Error
InboundGovernor.TrInboundGovernorError {} -> Error
InboundGovernor.TrMaturedConnections {} -> Info
InboundGovernor.TrInactive {} -> Debug

instance HasPrivacyAnnotation (Server.RemoteTransitionTrace addr)
instance HasSeverityAnnotation (Server.RemoteTransitionTrace addr) where
Expand Down Expand Up @@ -2556,6 +2558,15 @@ instance (ToJSON addr, Show addr)
mconcat [ "kind" .= String "InboundGovernorError"
, "remoteSt" .= String (pack . show $ err)
]
toObject _verb (InboundGovernor.TrMaturedConnections matured fresh) =
mconcat [ "kind" .= String "MaturedConnections"
, "matured" .= toJSON matured
, "fresh" .= toJSON fresh
]
toObject _verb (InboundGovernor.TrInactive fresh) =
mconcat [ "kind" .= String "Inactive"
, "fresh" .= toJSON fresh
]

instance ToJSON addr
=> ToObject (Server.RemoteTransitionTrace addr) where
Expand Down

0 comments on commit fca9108

Please sign in to comment.