Skip to content
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

Remove circular buffer #106

Closed
fujiapple852 opened this issue May 3, 2022 · 0 comments · Fixed by #105
Closed

Remove circular buffer #106

fujiapple852 opened this issue May 3, 2022 · 0 comments · Fixed by #105
Labels
enhancement New feature or request
Milestone

Comments

@fujiapple852
Copy link
Owner

The Tracer uses a circular buffer to track the state of all Probe in-flight. To access a Probe in this buffer, the index is calculated as sequence number of the probe modulo the buffer size.

Whilst this works, it has the draw back that the probes for a given round may wrap around the buffer and therefore must be processed with an Iterator rather than a slice.

This changes the logic to index into the buffer using sequence - round_sequence (i.e. the sequence number - the initial sequence number of the round).

Therefore the buffer access will always start from 0 in every round and will never wrap around as the buffer size is the same as the maximum ttl allowed.

@fujiapple852 fujiapple852 added the enhancement New feature or request label May 3, 2022
@fujiapple852 fujiapple852 added this to the 0.3.0 milestone May 3, 2022
@fujiapple852 fujiapple852 self-assigned this May 3, 2022
@fujiapple852 fujiapple852 removed their assignment May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant