diff --git a/tunnel/link.go b/tunnel/link.go index 181121e7..22362198 100644 --- a/tunnel/link.go +++ b/tunnel/link.go @@ -85,6 +85,21 @@ func (l *link) expiry() { } } +// Delay is the current load on the link +func (l *link) Delay() int64 { + return 0 +} + +// Current transfer rate as bits per second (lower is better) +func (l *link) Rate() float64 { + return float64(10e8) +} + +// Length returns the roundtrip time as nanoseconds (lower is better) +func (l *link) Length() int64 { + return time.Second.Nanoseconds() +} + func (l *link) Id() string { l.RLock() defer l.RUnlock() diff --git a/tunnel/tunnel.go b/tunnel/tunnel.go index a2671f62..73c937f3 100644 --- a/tunnel/tunnel.go +++ b/tunnel/tunnel.go @@ -57,6 +57,12 @@ type Tunnel interface { type Link interface { // The id of the link Id() string + // Delay is the current load on the link (lower is better) + Delay() int64 + // Length returns the roundtrip time as nanoseconds (lower is better) + Length() int64 + // Current transfer rate as bits per second (lower is better) + Rate() float64 // Status of the link e.g connected/closed Status() string // honours transport socket