feat: add directory-level disk usage stats
Nobody has claimed this yet.
- #33 by @blinkagent — closed without merging
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- go
- Domain
- observability-sre
Research direction
Start by reading the existing Disk() implementation and its use of syscall.Statfs. Clarify the new directory-usage API and settle whether caching, depth limits, or refresh guidance are required for large trees. Done means directory-tree usage is reported separately while the existing filesystem-level Disk() behavior remains available.
Written by the indexing model from the issue text.
Description
Summary
Currently, clistat only supports disk usage at the block device/filesystem level via syscall.Statfs. This reports total filesystem usage, which isn't ideal in Docker containers where multiple directories share the same underlying filesystem but you want to track usage of specific directories (e.g., /home or /var/lib/docker).
Problem
In containerized environments:
- The current
Disk()function shows the entire host filesystem usage - Users need visibility into actual disk usage of specific directories within the container
- This is particularly important for Docker-in-Docker setups where
/homeand/var/lib/dockerneed separate tracking
Proposed Solution
Add a new function (e.g., DiskUsage or DirectoryUsage) that calculates the actual disk usage of a directory tree, similar to du -sh.
Considerations:
- Performance:
du-style operations can be expensive for large directory trees with many small files (e.g., node_modules). May need to consider:- Caching strategies
- Configurable depth limits
- Recommended refresh intervals (current workaround uses 1h intervals)
- Should complement, not replace, the existing
Disk()function which is still useful for filesystem-level stats
Use Case
This would enable accurate disk usage monitoring in agent metadata for containerized workspaces, showing real directory usage instead of host filesystem totals.
Created on behalf of @matifali
- Dominant language
- Go
- Stars
- 11
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coder/clistat
-
bug: CPU usage misses other processes that share the same CPU limit (cgroup v2)Possibly taken @DanielleMaywood claimed this 2 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 67/100
-
bug: clistat only checks the nearest limit, but every parent's limit applies (cgroup v2)Possibly taken @david-fraley claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
-
Bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
Similar issues
-
[flaky test] TestValidatorCommitterDropsEmptyStatusBatch: submits to the mock VC before its stream is registeredPossibly taken @liran-funaro claimed this today. Opencoordinator flaky-test race-condition testing
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
hyperledger/fabric-x-committer#876 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
garethgeorge/backrest#1426 ·
Maintainers usually reply within 1 day
-
enhancement nav-pilot
Difficulty 2/5 Half a day Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
valkey-io/valkey-operator#549 · 1 comment ·
Maintainers usually reply within 3 days
-
kind/features
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
TencentBlueKing/bk-nodemgr#3804 ·
Maintainers usually reply within 1 day