Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

network: add initial support for latency tracking #3028

Merged
merged 21 commits into from
Oct 19, 2021

Conversation

tsachiherman
Copy link
Contributor

@tsachiherman tsachiherman commented Oct 9, 2021

Summary

This PR adds the node ( both client and server ), the ability to measure the time it takes to establish an outgoing connection ( excluding the TCP connection time ).
This duration is captured as the initial latency, which would need to get updated via a pingpong style logic.

Test Plan

  • Extend existing unit tests
  • mainnet-model testing is needed as well to confirm correctness

@tsachiherman tsachiherman changed the title network: add initial support for latency tracking. network: add initial support for latency tracking Oct 9, 2021
@codecov-commenter
Copy link

codecov-commenter commented Oct 9, 2021

Codecov Report

Merging #3028 (f1a6fa9) into master (a957519) will increase coverage by 0.01%.
The diff coverage is 64.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3028      +/-   ##
==========================================
+ Coverage   43.65%   43.67%   +0.01%     
==========================================
  Files         391      391              
  Lines       86792    86750      -42     
==========================================
- Hits        37890    37885       -5     
+ Misses      42873    42833      -40     
- Partials     6029     6032       +3     
Impacted Files Coverage Δ
config/config.go 47.82% <ø> (ø)
network/wsNetwork.go 65.11% <ø> (+1.97%) ⬆️
network/wsPeer.go 72.80% <60.00%> (-1.04%) ⬇️
network/latencyTracker.go 65.95% <65.95%> (ø)
network/multiplexer.go 94.11% <0.00%> (-2.95%) ⬇️
ledger/acctupdates.go 66.44% <0.00%> (ø)
catchup/peerSelector.go 100.00% <0.00%> (+1.04%) ⬆️
ledger/blockqueue.go 82.18% <0.00%> (+1.14%) ⬆️
cmd/algoh/blockWatcher.go 80.95% <0.00%> (+3.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a957519...f1a6fa9. Read the comment docs.

@brianolson
Copy link
Contributor

wsPeer already has lastPingRoundTripTime ?

@tsachiherman
Copy link
Contributor Author

wsPeer already has lastPingRoundTripTime ?

Yes.. this is only a POC. Clearly we won't need to have both when the solution is ready. My goal here was just to do the minimum so that we could measure the connection timing and determine if that aligns with the latencies we're configuring in the Mainnet-model.

@tsachiherman tsachiherman marked this pull request as ready for review October 18, 2021 20:34
@tsachiherman tsachiherman requested a review from a user October 18, 2021 20:34
@tsachiherman tsachiherman merged commit 48d4075 into algorand:master Oct 19, 2021
@tsachiherman tsachiherman deleted the tsachi/measurelatency branch October 19, 2021 15:47
onetechnical pushed a commit that referenced this pull request Oct 25, 2021
## Summary

This PR adds the node ( both client and server ), the ability to measure the time it takes to establish an outgoing connection ( excluding the TCP connection time ).
This duration is captured as the initial latency, which would need to get updated via a pingpong style logic.

## Test Plan

- [x] Extend existing unit tests
- [x] mainnet-model testing is needed as well to confirm correctness
@cce cce mentioned this pull request Nov 3, 2021
@egieseke egieseke mentioned this pull request Nov 23, 2021
@cce cce mentioned this pull request Sep 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants