8000 fix(cli): calculate coder ping max correctly (#18734) · coder/coder@7500aa4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7500aa4

Browse files
fix(cli): calculate coder ping max correctly (#18734)
Embarassing mistake I made months ago 😦 *Doesn't effect schmoder, since we don't parse that max, it calculates it itself
1 parent 6db6f48 commit 7500aa4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cli/ping.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (s *pingSummary) addResult(r *ipnstate.PingResult) {
5353
if s.Min == nil || r.LatencySeconds < s.Min.Seconds() {
5454
s.Min = ptr.Ref(time.Duration(r.LatencySeconds * float64(time.Second)))
5555
}
56-
if s.Max == nil || r.LatencySeconds > s.Min.Seconds() {
56+
if s.Max == nil || r.LatencySeconds > s.Max.Seconds() {
5757
s.Max = ptr.Ref(time.Duration(r.LatencySeconds * float64(time.Second)))
5858
}
5959
s.latencySum += r.LatencySeconds

cli/ping_internal_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ func TestBuildSummary(t *testing.T) {
2121
},
2222
{
2323
Err: "",
24-
LatencySeconds: 0.2,
24+
LatencySeconds: 0.3,
2525
},
2626
{
2727
Err: "",
28-
LatencySeconds: 0.3,
28+
LatencySeconds: 0.2,
2929
},
3030
{
3131
Err: "ping error",

0 commit comments

Comments
 (0)
0