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

Possible left over sum for averaging of deltas #54

Open
radioflyer28 opened this issue Jul 21, 2024 · 1 comment
Open

Possible left over sum for averaging of deltas #54

radioflyer28 opened this issue Jul 21, 2024 · 1 comment

Comments

@radioflyer28
Copy link

It looks delay is a rolling sum of all the server requests' round trip times. I may be mistaken, but it doesn't make sense for the new median calculation, delay should just be the delay for each server instead. It would make sense for the old mean calculation since this sum divided by the number of server requests would be the mean.

delay += res.Delay

Also, I was wondering why delay is not a portion of the round trip time? In the function Do, the delay is computed as the total round trip time for the request. It seems like delay should only be the difference between the midpoint (reported by the server) and time of receipt by the client. Or this could be approximated by dividing the round trip time by two. It seems like the calculation at this line is expecting the delay between the server's response and client receipt.

deltas = append(deltas, t1.Sub(t0)-delay)

@cjpatton
Copy link
Contributor

Thanks for pointing these out! Please send a PR at your convenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants