Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteCountBinary ¶ added in v0.10.0
ByteCountBinary formats b as human-readable size (1024-based: KiB, MiB, …, rendered as KB/MB/GB to match common storage conventions). Used by the API stats endpoint so disk usage figures line up with `du` / filesystem tools.
func ByteCountDecimal ¶
ByteCountDecimal formats b as human-readable size (1000-based: kB, MB, …). Use ByteCountBinary for filesystem-style 1024-based output.
func DirSize ¶
DirSize returns the total size in bytes of all files under path. Uses filepath.WalkDir for fewer syscalls and better performance (Go 1.16+).
func DiskAvailable ¶
DiskAvailable returns the number of bytes available to the current user in the filesystem hosting the given path. When path is empty it falls back to the current working directory (legacy behaviour). Unix-only.
func GetMemoryUsageAndGoroutine ¶
GetMemoryUsageAndGoroutine returns current Alloc bytes and the goroutine count (as a string for direct rendering on the home page). Results are cached for memStatsTTL to avoid back-to-back STW pauses under bursty scrapes.
Types ¶
This section is empty.