Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: xiang90/probing
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 43a291a
Choose a base ref
...
head repository: xiang90/probing
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a49e3df
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Sep 12, 2017

  1. Verified

    This commit was signed with the committer’s verified signature.
    parthban-db Parth Bansal
    Copy the full SHA
    7fc43d6 View commit details

Commits on Nov 25, 2022

  1. Merge pull request #5 from BlueBlue-Lee/status-bug-fix

    status: fix bug when compute first srtt
    xiang90 authored Nov 25, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    parthban-db Parth Bansal
    Copy the full SHA
    a49e3df View commit details
Showing with 7 additions and 1 deletion.
  1. +7 −1 status.go
8 changes: 7 additions & 1 deletion status.go
Original file line number Diff line number Diff line change
@@ -80,7 +80,13 @@ func (s *status) record(rtt time.Duration, when time.Time) {

s.total += 1
s.health = true
s.srtt = time.Duration((1-α)*float64(s.srtt) + α*float64(rtt))

lastSRTT := s.srtt
if lastSRTT == time.Duration(0) {
lastSRTT = rtt
}

s.srtt = time.Duration((1-α)*float64(lastSRTT) + α*float64(rtt))
s.clockdiff = time.Now().Sub(when) - s.srtt/2
s.err = nil
}