How to calculate CPU and Memory usage % in AWS ECS fargate with mutiple container running in single task?

Viewed 26

How can get the cpu and memory usage persentage in the AWS ECS which is running in fargate with mutiple container in single task ?

I am runnning 3 container(A, B, C) in the single ecs fargate task. each have 1vcpu and 2GB RAM reserved. i have a use case that i need to spin up a process based on the resource availablity in one of the container(A). to do so i need CPU % and memory usuage %. but when i use build in commends like free -h or top, i am getting host memory usage % and cpu usage % for the whole task not particularly for a container.

Please help me to finds out CPU % and MEMORY usage %

we are using golang package to get the resource usage programmatically. here are the package info

"github.com/mackerelio/go-osstat/cpu"

"github.com/mackerelio/go-osstat/memory"

0 Answers
Related