Skip to content

chore(dogfood): update the dogfood template to add workspace CPU and RAM usage from cgroup #7529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 19, 2023
Prev Previous commit
Next Next commit
Update dogfood/main.tf
Co-authored-by: Cian Johnston <cian@coder.com>
  • Loading branch information
matifali and johnstcn authored May 18, 2023
commit 92d18517f40c18cc28d751fb341abdf40da52a3c
2 changes: 1 addition & 1 deletion dogfood/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ resource "coder_agent" "dev" {
cusage=$(cat /sys/fs/cgroup/cpu.stat | head -n 1 | awk '{ print $2 }')
else
# cgroup v1
cusage=$(cat /sys/fs/cgroup/cpuacct,cpu/cpuacct.usage)
cusage=$(cat /sys/fs/cgroup/cpu,cpuacct/cpuacct.usage)
fi
echo "$cusage $cusage_p $interval $ncores" | awk '{ printf "%2.0f%%\n", (($1 - $2)/$3/$4)*100 }'
echo $cusage > /tmp/cusage
Expand Down