Skip to content

Commit 376e260

Browse files
committed
based on Release v2026.04.05.043512-f3a469b
1 parent f410223 commit 376e260

7 files changed

Lines changed: 142 additions & 158 deletions

File tree

internal/client/balancer.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,20 @@ func (b *Balancer) GetAllValidConnections() []Connection {
385385
return snapshotConnections(snap.connections, snap.valid)
386386
}
387387

388+
func (b *Balancer) AverageRTT(serverKey string) (time.Duration, bool) {
389+
stats := b.statsForKey(serverKey)
390+
if stats == nil {
391+
return 0, false
392+
}
393+
394+
_, _, sum, count := stats.snapshot()
395+
if count == 0 {
396+
return 0, false
397+
}
398+
399+
return time.Duration(sum/count) * time.Microsecond, true
400+
}
401+
388402
func rebuildValidIndices(connections []Connection) []int {
389403
valid := make([]int, 0, len(connections))
390404
for idx := range connections {

internal/client/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ type Connection struct {
181181
UploadMTUBytes int
182182
UploadMTUChars int
183183
DownloadMTUBytes int
184+
MTUResolveTime time.Duration
184185
}
185186

186187
// Bootstrap initializes a new Client by loading configuration, setting up logging,

0 commit comments

Comments
 (0)