Skip to content

Latest commit

 

History

History
14 lines (7 loc) · 414 Bytes

File metadata and controls

14 lines (7 loc) · 414 Bytes

Docker-Kubernetes-Container-CPU-Utilization

Implementing CPU Load goroutine requires the user to call the goroutine from the main file.

go CPULoadCalc()

For multi-cpu env divide cpuLoad by cpu count.

Same code can be modified to calculate memory for docker/kubernetes container.

Path: /sys/fs/cgroup/memory/memory.usage_in_bytes

refer: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt