Merge pull request #874 from micro/tun-metrics

Add placeholders for link metrics
This commit is contained in:
Asim Aslam 2019-10-22 17:03:07 +01:00 committed by GitHub
commit 418b8648bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
}
// 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()

View File

@ -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