Skip to content

Commit

Permalink
ouroboros-network: renamed peerStateToCounters
Browse files Browse the repository at this point in the history
Using `peerSelectionStateToCounters` now.
  • Loading branch information
coot committed Apr 10, 2024
1 parent 8804a2c commit 1451f26
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ peerSelectionGovernorLoop tracer

let Decision { decisionTrace, decisionJobs, decisionState } =
timedDecision now
!newCounters = peerStateToCounters decisionState
!newCounters = peerSelectionStateToCounters decisionState

!outboundConnectionsState =
if activePeers st
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module Ouroboros.Network.PeerSelection.Governor.Types
, Completion (..)
, PeerSelectionCounters (.., PeerSelectionCountersHWC, numberOfColdPeers, numberOfWarmPeers, numberOfHotPeers, numberOfColdBigLedgerPeers, numberOfWarmBigLedgerPeers, numberOfHotBigLedgerPeers, numberOfColdLocalRootPeers, numberOfWarmLocalRootPeers, numberOfHotLocalRootPeers, localRootsHWC)
, emptyPeerSelectionCounters
, peerStateToCounters
, peerSelectionStateToCounters
-- * Peer Sharing Auxiliary data type
, PeerSharingResult (..)
-- * Traces
Expand Down Expand Up @@ -760,16 +760,20 @@ peerSelectionCountersHWC PeerSelectionCounters {..} =
}


peerStateToCounters :: Ord peeraddr => PeerSelectionState peeraddr peerconn -> PeerSelectionCounters
peerStateToCounters PeerSelectionState { knownPeers,
establishedPeers,
activePeers,
publicRootPeers,
localRootPeers,
inProgressPromoteCold,
inProgressPromoteWarm,
inProgressDemoteWarm,
inProgressDemoteHot } =
peerSelectionStateToCounters :: Ord peeraddr => PeerSelectionState peeraddr peerconn -> PeerSelectionCounters
peerSelectionStateToCounters
PeerSelectionState {
knownPeers,
establishedPeers,
activePeers,
publicRootPeers,
localRootPeers,
inProgressPromoteCold,
inProgressPromoteWarm,
inProgressDemoteWarm,
inProgressDemoteHot
}
=
PeerSelectionCounters {
numberOfRootPeers = LocalRootPeers.size localRootPeers
+ PublicRootPeers.size publicRootPeers,
Expand Down

0 comments on commit 1451f26

Please sign in to comment.