mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Record session uptime (purely for the admin socket)
This commit is contained in:
parent
b2513fce56
commit
78eb40cbad
4 changed files with 6 additions and 1 deletions
|
@ -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[:])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue