Move interface counter state from global map to Interface struct

This commit is contained in:
Ian Gulliver
2026-02-02 10:16:37 -08:00
parent 2a8e376cbf
commit d4e7a8a9b7
2 changed files with 23 additions and 41 deletions

View File

@@ -362,6 +362,13 @@ type Interface struct {
IPs IPSet `json:"ips,omitempty"`
Up bool `json:"up,omitempty"`
Stats *InterfaceStats `json:"stats,omitempty"`
prevInPkts uint64
prevOutPkts uint64
prevInBytes uint64
prevOutBytes uint64
prevUptime uint64
prevTimestamp time.Time
}
func (i *Interface) MarshalJSON() ([]byte, error) {