mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2026-05-21 13:26:29 +03:00
Record session uptime (purely for the admin socket)
This commit is contained in:
@@ -89,6 +89,7 @@ type Session struct {
|
||||
BytesSent uint64
|
||||
BytesRecvd uint64
|
||||
MTU uint16
|
||||
Uptime time.Duration
|
||||
WasMTUFixed bool
|
||||
}
|
||||
|
||||
@@ -216,6 +217,7 @@ func (c *Core) GetSessions() []Session {
|
||||
MTU: sinfo.getMTU(),
|
||||
BytesSent: sinfo.bytesSent,
|
||||
BytesRecvd: sinfo.bytesRecvd,
|
||||
Uptime: time.Now().Sub(sinfo.timeOpened),
|
||||
WasMTUFixed: sinfo.wasMTUFixed,
|
||||
}
|
||||
copy(session.PublicKey[:], sinfo.theirPermPub[:])
|
||||
|
||||
Reference in New Issue
Block a user