-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PeerMetrics: interpolate results when inserting a new peer #3915
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bolt12
approved these changes
Jul 27, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
coot
force-pushed
the
coot/peer-metrics
branch
2 times, most recently
from
August 9, 2022 14:18
819c681
to
9ee1fcf
Compare
We always access upstreameness and fechyness together, there's no need to store them in separate `TVar`s.
coot
force-pushed
the
coot/peer-metrics
branch
4 times, most recently
from
August 16, 2022 08:39
e47cb1e
to
ed56f39
Compare
bolt12
approved these changes
Aug 16, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just minor typo
ouroboros-network/test/Test/Ouroboros/Network/Diffusion/Node.hs
Outdated
Show resolved
Hide resolved
This patch allows to configure the number of events tracked by PeerMetrics.
When inserting new peers into `PeerMetricsState`, record the current average result. This average will be used to linearly interpolate for the missing history. Once a peer is longer than `maxEntriesToTrack` slots then the average is removed and no longer impacts the results (as there are enough results in the `PeerMetricsState`).
`Delay` constructor is useful when one needs a finer control over delays. `maybeStepScript` and `maybeStepScriptSTM` allow to step through the script and terminate once the script is over.
Resolve ties of hot demotion with slot number which indicates when a peer joined the leader board. Oldest entries are sorted first. This means that the peers who have the same low score but are longer are preferred for demotion (their result is more certain). This also allows to keep the newly added peers as hot if the leader board statistic is skewed (e.g. a log of peers have the same low score).
Two properties are included: * check that newly added peers are never in 20% of worst performing peers * check that the peer metric map never exceeds its configured sized.
coot
force-pushed
the
coot/peer-metrics
branch
from
August 16, 2022 13:58
ed56f39
to
977e73f
Compare
bors merge |
This was referenced Oct 27, 2022
iohk-bors bot
added a commit
that referenced
this pull request
Nov 9, 2022
4120: Cherry picked network changes for cardano-node-1.35.5 release r=coot a=coot This cherry-picked patches from the following PRs: * #3794 * #3844 * #3785 * #3904 * #3915 * #3852 * #3970 * #3979 * #4015 * #4067 * #4004 * #4086 * #4113 * #4106 * #4127 * #4103 Also cherry-picked almost all the commits which modify GitHub actions: * 18c5244 Run GitHub Actions on pull requests * 3adf5a9 Use newer version of io-sim * ee9b7a6 Fix GH Actions Windows CI: switch from pkgconf to pkg-config * e6cf074 github-actions: use `ubuntu-latest` * 9a8b959 Updated versions of github actions * fc8f8f0 Fix GH Actions Windows CI caching * 7f07c40 Windows Github Actions now use MSYS2 * b21a7ce Fix chocolatey CI error * #4134 TODO: * [x] bump versions of packages * [x] input-output-hk/cardano-haskell-packages#84 Co-authored-by: Mark Tullsen <[email protected]> Co-authored-by: Marcin Szamotulski <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR makes sure that newly added peers to
PeerMetrics
are never in 20% of worst performing peers. Currently the churn interval and number of records kept byPeerMetrics
are in sync, peers added just before the churn event can be removed as they might have too few results. In the future the churn interval and the number of records kept byPeerMetrics
might diverge, and thus it's more important to make sure that newly added peers are not immediately removed.This PR solves this problem by keeping track of average results when a peer joined the leader board and is using linear regression to adjust peer results for the leader board period where the peer was absent from the leader board.
Fixes #3861
Checklist
interface-CHANGELOG.md
interface-CHANGELOG.md