Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

feat: add directory-level disk usage stats

Open
#32 0 comments 0 reactions 0 assignees View on GitHub

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

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

enhancement

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 /home and /var/lib/docker need 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coder/clistat

All issues in coder/clistat

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.