cloudflare / cloudflare/roughtime

Possible left over sum for averaging of deltas

Open
#54 1 comment 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.