Documentation
¶
Overview ¶
Package fsstat holds small, dependency-free helpers for reporting filesystem usage: human-readable byte sizes, on-disk directory accounting, and statfs capacity. They are shared by the operator inspector (mlfs-admin stats) and the standalone probe (mlfs-bench), neither of which should pull in the metadata or chunk-store packages just to print sizes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirUsage ¶
DirUsage returns (file count, total bytes) of the regular files under root. A missing or unreadable root yields (0,0); unreadable entries are skipped, so accounting is best-effort and never fails — callers want a number, not an error, when pointing at a directory that may not exist on this node.
func HumanBytes ¶
HumanBytes formats a byte count with binary (IEC) units (KiB, MiB, …).
func OldestModTime ¶
OldestModTime returns the oldest modification time among the regular files directly under root (NOT recursive — the staging dir is flat, one file per staged slice), and ok=false when the directory is empty or unreadable. The write-back oldest-unflushed-age gauge reads it: a staging file's mtime is when the (durable, fsync'd) write was staged, so the oldest mtime bounds how long the oldest still-unflushed write has waited. Tmp files (dotfiles) are skipped.
func StatfsBytes ¶
StatfsBytes returns (available, total) bytes for the filesystem holding path, or (0,0) if it cannot be stat'd.
Types ¶
This section is empty.