|
7 | 7 | {-# LANGUAGE PolyKinds #-} |
8 | 8 | {-# LANGUAGE QuantifiedConstraints #-} |
9 | 9 | {-# LANGUAGE ScopedTypeVariables #-} |
| 10 | +{-# LANGUAGE StandaloneDeriving #-} |
10 | 11 | {-# LANGUAGE TypeApplications #-} |
11 | 12 | {-# LANGUAGE TypeFamilies #-} |
12 | 13 | {-# LANGUAGE UndecidableInstances #-} |
13 | 14 |
|
14 | 15 | {-# OPTIONS_GHC -Wno-orphans #-} |
| 16 | +{-# LANGUAGE GeneralizedNewtypeDeriving #-} |
15 | 17 |
|
16 | 18 | module Cardano.Tracing.OrphanInstances.Network () where |
17 | 19 |
|
@@ -82,7 +84,8 @@ import Ouroboros.Network.PeerSelection.Governor (DebugPeerSelection (. |
82 | 84 | TracePeerSelection (..)) |
83 | 85 | import qualified Ouroboros.Network.PeerSelection.KnownPeers as KnownPeers |
84 | 86 | import Ouroboros.Network.PeerSelection.LedgerPeers |
85 | | -import Ouroboros.Network.PeerSelection.LocalRootPeers (LocalRootPeers) |
| 87 | +import Ouroboros.Network.PeerSelection.LocalRootPeers (HotValency (..), LocalRootPeers, |
| 88 | + WarmValency (..)) |
86 | 89 | import qualified Ouroboros.Network.PeerSelection.LocalRootPeers as LocalRootPeers |
87 | 90 | import Ouroboros.Network.PeerSelection.PeerStateActions (PeerSelectionActionsTrace (..)) |
88 | 91 | import Ouroboros.Network.PeerSelection.RootPeersDNS (TraceLocalRootPeers (..), |
@@ -425,6 +428,7 @@ instance HasSeverityAnnotation (TracePeerSelection addr) where |
425 | 428 | TraceGovernorWakeup {} -> Info |
426 | 429 | TraceChurnWait {} -> Info |
427 | 430 | TraceChurnMode {} -> Info |
| 431 | + TraceKnownInboundConnection {} -> Info |
428 | 432 |
|
429 | 433 | instance HasPrivacyAnnotation (DebugPeerSelection addr) |
430 | 434 | instance HasSeverityAnnotation (DebugPeerSelection addr) where |
@@ -1357,6 +1361,17 @@ instance ToObject peer => ToObject (WithMuxBearer peer MuxTrace) where |
1357 | 1361 |
|
1358 | 1362 | instance Aeson.ToJSONKey RelayAccessPoint where |
1359 | 1363 |
|
| 1364 | +instance ToJSON HotValency where |
| 1365 | + toJSON (HotValency v) = toJSON v |
| 1366 | +instance ToJSON WarmValency where |
| 1367 | + toJSON (WarmValency v) = toJSON v |
| 1368 | + |
| 1369 | +instance FromJSON HotValency where |
| 1370 | + parseJSON v = HotValency <$> parseJSON v |
| 1371 | + |
| 1372 | +instance FromJSON WarmValency where |
| 1373 | + parseJSON v = WarmValency <$> parseJSON v |
| 1374 | + |
1360 | 1375 | instance Show exception => ToObject (TraceLocalRootPeers RemoteAddress exception) where |
1361 | 1376 | toObject _verb (TraceLocalRootDomains groups) = |
1362 | 1377 | mconcat [ "kind" .= String "LocalRootDomains" |
@@ -1513,10 +1528,9 @@ instance ToObject (TracePeerSelection SockAddr) where |
1513 | 1528 | , "actualEstablished" .= actualKnown |
1514 | 1529 | , "selectedPeers" .= Aeson.toJSONList (toList sp) |
1515 | 1530 | ] |
1516 | | - toObject _verb (TracePromoteColdLocalPeers tLocalEst aLocalEst sp) = |
| 1531 | + toObject _verb (TracePromoteColdLocalPeers tLocalEst sp) = |
1517 | 1532 | mconcat [ "kind" .= String "PromoteColdLocalPeers" |
1518 | 1533 | , "targetLocalEstablished" .= tLocalEst |
1519 | | - , "actualLocalEstablished" .= aLocalEst |
1520 | 1534 | , "selectedPeers" .= Aeson.toJSONList (toList sp) |
1521 | 1535 | ] |
1522 | 1536 | toObject _verb (TracePromoteColdFailed tEst aEst p d err) = |
@@ -1624,6 +1638,10 @@ instance ToObject (TracePeerSelection SockAddr) where |
1624 | 1638 | toObject _verb (TraceChurnMode c) = |
1625 | 1639 | mconcat [ "kind" .= String "ChurnMode" |
1626 | 1640 | , "event" .= show c ] |
| 1641 | + toObject _verb (TraceKnownInboundConnection addr sharing) = |
| 1642 | + mconcat [ "kind" .= String "KnownInboundConnection" |
| 1643 | + , "peer" .= show addr |
| 1644 | + , "peerSharing" .= show sharing ] |
1627 | 1645 |
|
1628 | 1646 | -- Connection manager abstract state. For explanation of each state see |
1629 | 1647 | -- <https://hydra.iohk.io/job/Cardano/ouroboros-network/native.network-docs.x86_64-linux/latest/download/2> |
|
0 commit comments