From 2642b42a08dc61babc674bc2a70e804be3e51119 Mon Sep 17 00:00:00 2001 From: Shambhavi Srivastava Date: Fri, 29 Sep 2023 00:13:30 +0000 Subject: [PATCH] Updating go-runc Stats to be compliant be OCI runc.Stats Signed-off-by: Shambhavi Srivastava --- events.go | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/events.go b/events.go index 6584c49..35f5b93 100644 --- a/events.go +++ b/events.go @@ -30,11 +30,12 @@ type Event struct { // Stats is statistical information from the runc process type Stats struct { - Cpu Cpu `json:"cpu"` //revive:disable - Memory Memory `json:"memory"` - Pids Pids `json:"pids"` - Blkio Blkio `json:"blkio"` - Hugetlb map[string]Hugetlb `json:"hugetlb"` + Cpu Cpu `json:"cpu"` //revive:disable + Memory Memory `json:"memory"` + Pids Pids `json:"pids"` + Blkio Blkio `json:"blkio"` + Hugetlb map[string]Hugetlb `json:"hugetlb"` + NetworkInterfaces []*NetworkInterface `json:"network_interfaces"` } // Hugetlb represents the detailed hugetlb component of the statistics data @@ -113,3 +114,17 @@ type Memory struct { KernelTCP MemoryEntry `json:"kernelTCP,omitempty"` Raw map[string]uint64 `json:"raw,omitempty"` } + +type NetworkInterface struct { + // Name is the name of the network interface. + Name string + + RxBytes uint64 + RxPackets uint64 + RxErrors uint64 + RxDropped uint64 + TxBytes uint64 + TxPackets uint64 + TxErrors uint64 + TxDropped uint64 +}