package kaun-board

  1. Overview
  2. Docs

Module Sysstat.FsSource

Filesystem statistics (instantaneous).

Sourcetype partition = {
  1. mount_point : string;
    (*

    Mount point path (e.g., "/", "/home").

    *)
  2. total_bytes : int64;
    (*

    Total filesystem size.

    *)
  3. used_bytes : int64;
    (*

    Used space (calculated as total - free).

    *)
  4. avail_bytes : int64;
    (*

    Available space for unprivileged users.

    *)
}

Partition information for a single mounted filesystem.

All size fields are in bytes. Represents a snapshot of filesystem usage at the time of sampling.

Sourcetype t = {
  1. total_bytes : int64;
    (*

    Total filesystem size for the queried path.

    *)
  2. used_bytes : int64;
    (*

    Used space for the queried path.

    *)
  3. avail_bytes : int64;
    (*

    Available space for the queried path.

    *)
  4. partitions : partition list;
    (*

    All mounted partitions (excluding virtual filesystems).

    *)
}

Filesystem statistics for a specific path.

All size fields are in bytes. Contains statistics for the filesystem containing the specified path, plus a list of all mounted partitions.

Sourceval sample : ?path:string -> unit -> t

sample ?path () returns filesystem statistics for the specified path.

Returns statistics for the filesystem containing path (default: "/"), along with a list of all mounted partitions via partitions.

Virtual and system filesystems (e.g., devfs, tmpfs, proc, sysfs) are excluded from the partitions list. Filesystems smaller than approximately 100 MB are also excluded.

  • raises Sys_error

    if the path does not exist or an error occurs.

Sourceval partitions : unit -> partition list

partitions () returns a list of all mounted partitions.

Enumerates mounted filesystems and queries their usage. Excludes virtual/system filesystems and small filesystems (< 100 MB).

Returns an empty list if no partitions are found or an error occurs.