Add placeholders for link metrics

This commit is contained in:
Asim Aslam 2019-10-22 16:50:00 +01:00
parent 317cf76566
commit 4fddd69229
2 changed files with 21 additions and 0 deletions

View File

@ -85,6 +85,21 @@ func (l *link) expiry() {
}
}
// Delay is the current load on the link
func (l *link) Delay() int64 {
return 0
}
// Transfer rate capability as bits per second (higher 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()

View File

@ -59,6 +59,12 @@ type Link interface {
Id() string
// Status of the link e.g connected/closed
Status() string
// Delay is the current load on the link
Delay() int64
// Transfer rate capability as bits per second (higher is better)
Rate() float64
// Length returns the roundtrip time as nanoseconds (lower is better)
Length() int64
// honours transport socket
transport.Socket
}