Skip to content

Commit

Permalink
peer-selection: log current number of warm local root peers
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed May 31, 2023
1 parent 85757e7 commit 18321ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ouroboros-network/CHANGELOG.md
Expand Up @@ -50,6 +50,12 @@
`Ouroboros.Network.NodeToClient.ipSubscriptionWorker`,
`Ouroboros.Network.NodeToClient.dnsSubscriptionWorker` were modified.

### Non-breaking

* The counters logged by `PeerSelectionCounters` for local root peers are now
the number of warm and hot peers per group (before the first one was the
target of the given group).

## 0.7.0.1

### Non-breaking changes
Expand Down
Expand Up @@ -461,10 +461,11 @@ peerStateToCounters st = PeerSelectionCounters { coldPeers, warmPeers, hotPeers,
coldPeers = Set.size $ knownGenericPeersSet Set.\\ establishedPeersSet
warmPeers = Set.size $ establishedPeersSet Set.\\ activePeers st
hotPeers = Set.size $ activePeers st
localRoots =
[ (target, active)
| (target, members) <- LocalRootPeers.toGroupSets (localRootPeers st)
, let active = Set.size (members `Set.intersection` activePeers st)
localRoots =
[ (warm, active)
| (_, members) <- LocalRootPeers.toGroupSets (localRootPeers st)
, let warm = Set.size $ members `Set.intersection` warmPeersSet
active = Set.size $ members `Set.intersection` hotPeersSet
]

emptyPeerSelectionState :: StdGen
Expand Down

0 comments on commit 18321ba

Please sign in to comment.