Skip to content

Commit

Permalink
updating contaierd to be compliant be OCI runc.Stats
Browse files Browse the repository at this point in the history
  • Loading branch information
sshambhavi-252 committed Sep 28, 2023
1 parent df3c22d commit b8f4370
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 5 deletions.
25 changes: 25 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
go_library(
name = "runc",
srcs = [
"command_linux.go",
"command_other.go",
"console.go",
"container.go",
"events.go",
"io.go",
"io_unix.go",
"io_windows.go",
"monitor.go",
"runc.go",
"utils.go",
],
)

go_test(
name = "runc_test",
srcs = [
"console_test.go",
"runc_test.go",
],
library = ":runc",
)
25 changes: 20 additions & 5 deletions events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
1 change: 1 addition & 0 deletions go-runc
Submodule go-runc added at df3c22

0 comments on commit b8f4370

Please sign in to comment.