Commit Graph

9 Commits

Author SHA1 Message Date
Garrett Delfosse d8467c11ad
fix: handle no memory limit in coder stat mem (#11107) 2023-12-08 12:46:53 -05:00
Jon Ayers c3aface285
fix: fix coder stat mem (#8762)
- For cgroups v1 the wrong cgroup file was being read
  to determine max memory. This commit updates the file
  from '/sys/fs/cgroup/memory/memory.max_usage_in_bytes' to
  '/sys/fs/cgroup/memory/memory.limit_in_bytes'
2023-07-27 09:33:43 +01:00
Cian Johnston fd372f6735
fix(cli/clistat): improve detection of container environment (#8643)
Use the presence of /var/run/secrets/kubernetes.io/serviceaccount/token to determine if we are in a container in addition to sniffing /proc/1/cgroup
2023-07-21 10:18:56 +00:00
Cian Johnston 0965a2de70
fix(cli/clistat): read from alternate cgroup path (#8591)
* Attempts reading cgroupv1 quota, period, usage from /sys/fs/cgroup/cpu,cpuacct by default
* Fall back to /sys/fs/cgroup/cpu for v1 quota and period
* Fall back to /sys/fs/cgroup/cpuacct for v1 usage

Fixes https://github.com/coder/coder/issues/8468
2023-07-19 16:25:26 +01:00
Cian Johnston c1ab5cf0ba
fix(cli/clistat): better handle cgroups with no limits (#8373) 2023-07-07 15:49:36 +01:00
Cian Johnston 80ef147060
fix(cli): stat: explicitly specify resource SI prefix (#8206)
* fix(cli): move to explicitly specifying units

* make gen
2023-06-26 18:06:38 +01:00
Cian Johnston eb0783ff24
chore(cli): do not assert non-zero host cpu usage (#8097) 2023-06-20 13:03:56 +00:00
Cian Johnston 0f754f0bb9
fix(clistat): do not include buffers/cache for host memory used (#8095) 2023-06-20 13:29:27 +01:00
Cian Johnston d6f8bd7847
feat(cli): add `coder stat` command (#8005) 2023-06-20 11:16:57 +02:00