Skip to content

Report per-workspace disk size in dl --ls #153

Description

@blooop

Question

devlaunch reports zero size information anywhere: dl --ls --json (dl.py:490-503) has checkedOut, lastUsed, unsaved — no bytes; no shutil.disk_usage/du/st_size exists in the codebase. The disk work on this map needs a measurement primitive before anything is "reduced": add a per-workspace disk-size field to dl --ls / --ls --json.

Scope (deliberately narrow — measure what devlaunch owns):

  • Size = bytes on disk of the workspace clone directory (<cache>/repos/<owner>/<repo>/<id>), computed with hardlink awareness (count each inode once — the clone shares pack files with the bare cache via hardlinks, so a naive du -s per workspace double-counts what is actually shared; report the workspace's exclusive bytes, or clearly label the number as apparent size — decide during build, document the choice in --help and README).
  • Docker named volumes and image sizes are explicitly out: volume reporting is owned by issue Build: persist the devpod workspace id instead of re-deriving it, and reconcile the orphans #88's reconciler; image layers belong to Docker.
  • JSON field name and human rendering consistent with the existing table; must not slow --ls unacceptably on many workspaces (a size walk is O(files) — if it costs more than ~100ms per workspace, make it opt-in, e.g. --ls --size, and say so).
  • Failing test first: a workspace tree of known content reports the expected bytes; JSON schema gains the field; hardlinked pack files are not double-counted (or the apparent-size choice is pinned by test).

Pointers: dl.py:490-503 (--ls rendering), devlaunch/workspace_state.py (per-workspace facts, PR #134's seam), test coverage for --ls in test/.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions