cloudflare / cloudflare/roughtime
Possible left over sum for averaging of deltas
- Dominant language
- Go
- Stars
- 177
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
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.
https://github.com/cloudflare/roughtime/blob/064fa609e691f037a06c575dd330d73b80d5e237/client/client.go#L314
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.
https://github.com/cloudflare/roughtime/blob/064fa609e691f037a06c575dd330d73b80d5e237/client/client.go#L326
Contributor guide
Assessment
This issue has not been assessed yet.