Skip to content
Sign in

system

v0.1.2

The machine the engine runs on — CPU and each core, memory and swap, load, temperatures, fans, power, pressure, the battery, GPUs, disk I/O and space, SSD health, and network, now (system::snapshot) and over 24 hours (system::history), sampled every second only while someone observes system::on-sample; the busiest processes, each worker's usage and each container's while observed; plus the System page of the iii app.

Install

bash
iii call compose::add worker=system

Run in your project with the iii engine running. Exact versions are immutable and digest-pinned.

Functions12

system::disks

Function

The physical disks as options: { options: [{ value: '', label: 'All disks' } (the disk.read series), then each: { value: <id in disk.read:<id>>, label, detail?: '<model> · <size>' }] }; empty without one.

Request
Empty object
Response
  • optionsobject[]required
    • detailstring
    • labelstringrequired
    • valuestringrequired

      What the series keys use after the colon (`gpu:<value>`); `""` for the choice that stands for them all (`gpu`, `net.rx`, `disk.read`).

system::gpus

Function

The GPUs as options: { options: [{ value: '', label: 'Automatic', detail: 'the GPU with the most memory' } (the gpu series), then each GPU, that one first: { value: <id in gpu:<id>>, label: <name>, detail: <memory, e.g. '16 GB'> }] }; empty without a GPU.

Request
Empty object
Response
  • optionsobject[]required
    • detailstring
    • labelstringrequired
    • valuestringrequired

      What the series keys use after the colon (`gpu:<value>`); `""` for the choice that stands for them all (`gpu`, `net.rx`, `disk.read`).

system::history

Function

History of the machine's series for a window: 1m (a point a second, only while system::on-sample is observed), 15m (10 s), 1h (1 min) or 24h (15 min). Keys: cpu, ram, swap, gpu, vram, space, psi.cpu, psi.mem, psi.io, battery (%), load, temp (°C), power.gpu (every GPU), power.cpu (W), disk.read, disk.write, net.rx, net.tx (B/s), and <key>:<device> per device (cpu:3, temp:nvme0, temp:gpu:card1, fan:gpu:card1 in RPM, gpu:card1, power.gpu:card1, space:/, net.rx:enp8s0). A series the machine lacks is absent. Empty series: all. Gaps are null; memory only, a restart starts empty.

Request
  • seriesstring[]

    Series keys (`cpu`, `ram`, `gpu:card1`, `net.rx`, `space:/`...). Empty or missing: every series. Unknown keys are left out of the answer.

  • windowone ofrequired

    The window `system::history` answers.

    one of (4)
    Variant 1
    valuestringenum 1m
    Variant 2
    valuestringenum 15m
    Variant 3
    valuestringenum 1h
    Variant 4
    valuestringenum 24h
Response
  • end_atinteger· int64required

    The start of the newest point's slot, ms since the epoch; each earlier point is `step_s` before the next.

  • seriesobjectrequired

    Each asked series that exists: its points, oldest first, `null` for a gap (nothing sampled then). Every array has the window's length (60, 90, 60 or 96).

  • step_sinteger· uint32requiredmin 0

    Seconds between points.

  • windowone ofrequired

    The window `system::history` answers.

    one of (4)
    Variant 1
    valuestringenum 1m
    Variant 2
    valuestringenum 15m
    Variant 3
    valuestringenum 1h
    Variant 4
    valuestringenum 24h

system::interfaces

Function

The physical network interfaces as options: { options: [{ value: '', label: 'All interfaces' } (the net.rx series), then each: { value: <id in net.rx:<id>>, label, detail?: 'Wi-Fi' | 'Ethernet · 1 Gb/s' }] }; empty without one.

Request
Empty object
Response
  • optionsobject[]required
    • detailstring
    • labelstringrequired
    • valuestringrequired

      What the series keys use after the colon (`gpu:<value>`); `""` for the choice that stands for them all (`gpu`, `net.rx`, `disk.read`).

system::native-ui

Function

Serve the system worker's native app bundle for the iii app.

Request
  • pathstringrequired

    The descriptor's `bundle.path` (e.g. `browser/native.js`).

Response
  • contentstringrequired

    The bundle's JavaScript source, verbatim.

  • hashstringrequired

    sha256 of the UTF-8 bytes of `content`, lower-case hex.

  • sizeinteger· uintrequiredmin 0

    Size of `content` in UTF-8 bytes.

system::on-containers

Function

Every 3 seconds while observed (and never otherwise): { at, containers: [{ id, name, cpu, mem }], unsupported? }, each container's cgroup (Docker, Podman, systemd-nspawn, LXC): cpu % of one core, mem bytes. unsupported: true without cgroup v2 or without a container runtime (and on macOS). Only the system worker calls it.

Request
  • atinteger· int64required
  • containersobject[]required

    By CPU, the busiest first.

    • cpunumber· doublerequired

      Percent of one core since the previous scan.

    • idstringrequired

      Docker's and Podman's short id (12 hex digits), else the machine's or LXC container's name.

    • meminteger· uint64requiredmin 0

      The cgroup's `memory.current`, bytes (page cache included).

    • namestringrequired

      Docker's name for it when its socket answers, else `id`.

  • unsupportedboolean

    No cgroup v2 or no container runtime here (macOS, whose containers run in a VM, an old Linux, a machine without Docker, Podman, LXC or machined): `containers` is always empty.

Response
  • atinteger· int64required
  • containersobject[]required

    By CPU, the busiest first.

    • cpunumber· doublerequired

      Percent of one core since the previous scan.

    • idstringrequired

      Docker's and Podman's short id (12 hex digits), else the machine's or LXC container's name.

    • meminteger· uint64requiredmin 0

      The cgroup's `memory.current`, bytes (page cache included).

    • namestringrequired

      Docker's name for it when its socket answers, else `id`.

  • unsupportedboolean

    No cgroup v2 or no container runtime here (macOS, whose containers run in a VM, an old Linux, a machine without Docker, Podman, LXC or machined): `containers` is always empty.

system::on-processes

Function

Every 3 seconds while observed (and never otherwise): { at, processes: [{ pid, name, cpu, mem }] }, the 10 processes using the most CPU and the 10 using the most memory, by CPU. cpu is % of one core (can pass 100), mem resident bytes. Only the system worker calls it.

Request
  • atinteger· int64required

    When the scan was taken, ms since the epoch.

  • processesobject[]required

    The ten using the most CPU and the ten using the most memory (one row each), by CPU, the busiest first.

    • cpunumber· doublerequired

      Percent of one core since the previous scan (top-style: a process busy on four cores is 400).

    • meminteger· uint64requiredmin 0

      Resident memory, bytes.

    • namestringrequired
    • pidinteger· uint32requiredmin 0
Response
  • atinteger· int64required

    When the scan was taken, ms since the epoch.

  • processesobject[]required

    The ten using the most CPU and the ten using the most memory (one row each), by CPU, the busiest first.

    • cpunumber· doublerequired

      Percent of one core since the previous scan (top-style: a process busy on four cores is 400).

    • meminteger· uint64requiredmin 0

      Resident memory, bytes.

    • namestringrequired
    • pidinteger· uint32requiredmin 0

system::on-sample

Function

One call per sample of the machine: { at, values: { <key>: number } } with the keys of system::history. Observed, the worker samples every second and each new observer gets the current sample at once; unobserved, every 10 seconds. Takes no args. Only the system worker calls it.

Request
  • atinteger· int64required

    When it was taken, ms since the epoch.

  • valuesobjectrequired

    Every series known this time: `cpu`, `ram`, `swap`, `gpu`, `vram`, `space`, `psi.cpu`, `psi.mem`, `psi.io`, `battery` (%), `load`, `temp` (°C), `power.gpu` (every GPU), `power.cpu` (W), `disk.read`, `disk.write`, `net.rx`, `net.tx` (bytes a second), and `<key>:<device>` per device (`cpu:3`, `temp:nvme0`, `temp:gpu:card1`, `fan:gpu:card1` in RPM, `power.gpu:card1`). A series with no value this time is absent.

Response
  • atinteger· int64required

    When it was taken, ms since the epoch.

  • valuesobjectrequired

    Every series known this time: `cpu`, `ram`, `swap`, `gpu`, `vram`, `space`, `psi.cpu`, `psi.mem`, `psi.io`, `battery` (%), `load`, `temp` (°C), `power.gpu` (every GPU), `power.cpu` (W), `disk.read`, `disk.write`, `net.rx`, `net.tx` (bytes a second), and `<key>:<device>` per device (`cpu:3`, `temp:nvme0`, `temp:gpu:card1`, `fan:gpu:card1` in RPM, `power.gpu:card1`). A series with no value this time is absent.

system::on-workers

Function

Every 3 seconds while observed (and never otherwise): { at, workers: [{ name, kind: 'worker' | 'engine', pids, cpu, mem }] }, what each iii worker connected to the engine (and the engine) uses with every process it started: cpu % of one core, mem resident bytes. Only the system worker calls it.

Request
  • atinteger· int64required
  • workersobject[]required

    Each worker connected to the engine whose process runs on this machine, and the engine itself when its process is known; by CPU, the busiest first.

    • cpunumber· doublerequired

      Percent of one core, the whole tree.

    • kindstringrequired

      `worker` or `engine`.

    • meminteger· uint64requiredmin 0

      Resident memory of the whole tree, bytes (shared pages count once per process).

    • namestringrequired

      The worker's name (`engine` for the engine's own process).

    • pidsinteger[]· uint32requiredmin 0

      The worker's process first, then every process it started that is not itself a worker.

Response
  • atinteger· int64required
  • workersobject[]required

    Each worker connected to the engine whose process runs on this machine, and the engine itself when its process is known; by CPU, the busiest first.

    • cpunumber· doublerequired

      Percent of one core, the whole tree.

    • kindstringrequired

      `worker` or `engine`.

    • meminteger· uint64requiredmin 0

      Resident memory of the whole tree, bytes (shared pages count once per process).

    • namestringrequired

      The worker's name (`engine` for the engine's own process).

    • pidsinteger[]· uint32requiredmin 0

      The worker's process first, then every process it started that is not itself a worker.

system::sensors

Function

The temperature sensors as options, the CPU's first: { options: [{ value: <id in temp:<id>>, label, detail?: 'limit 89 °C' }] }.

Request
Empty object
Response
  • optionsobject[]required
    • detailstring
    • labelstringrequired
    • valuestringrequired

      What the series keys use after the colon (`gpu:<value>`); `""` for the choice that stands for them all (`gpu`, `net.rx`, `disk.read`).

system::snapshot

Function

The machine the engine runs on, now: host (name, OS, kernel, arch, uptime), CPU (model, threads, usage %, each core's %, MHz, load), memory and swap (bytes), every temperature sensor (°C and its limit), fans (RPM), power (W of the GPUs and the CPU package), pressure (% of the time tasks stalled on CPU, memory, I/O), the battery, NVMe health (wear, writes, errors, hours; or why it cannot be read), GPUs (busy %, VRAM, °C), disks (read/write B/s, busy %), volumes (bytes), physical network interfaces (rx/tx B/s) and the virtual ones by name.

Request
Empty object
Response
  • atinteger· int64required

    When the sample it reports was taken, ms since the epoch.

  • batteryany of
    any of (2)
    Variant 1
    • cyclesinteger· uint32min 0
    • health_pctnumber· double

      The full capacity now over the design capacity, percent.

    • pctnumber· doublerequired

      Percent charged.

    • statestringrequired

      `charging`, `discharging`, `full` or `unknown`.

    • time_sinteger· uint64min 0

      Seconds to full while charging, to empty while discharging.

    Variant 2
    valuenull
  • cpuobjectrequired
    • coresnumber[]· doublerequired

      Percent busy of each logical CPU (`cpu:<n>`, in order); null before the second sample.

    • loadnumber[]· doublerequired

      1, 5 and 15 minute load averages.

    • mhzinteger· uint32min 0

      The fastest core now, MHz.

    • modelstringrequired
    • threadsinteger· uint32requiredmin 0
    • usagenumber· double

      Percent of all cores busy; null before the second sample.

  • disksobject[]required
    • busynumber· double

      Percent of the time with I/O in flight (Linux).

    • idstringrequired
    • read_bpsinteger· uint64min 0
    • write_bpsinteger· uint64min 0
  • fansobject[]required

    Every fan that reports its speed.

    • idstringrequired
    • labelstringrequired
    • rpmnumber· doublerequired
  • gpusobject[]required
    • busynumber· double

      Percent busy.

    • cnumber· double

      °C.

    • idstringrequired
    • namestringrequired
    • vram_totalinteger· uint64min 0
    • vram_usedinteger· uint64min 0
  • hostobjectrequired
    • archstringrequired
    • kernelstringrequired
    • namestringrequired
    • osstringrequired
    • uptime_sinteger· uint64requiredmin 0
    • virtualstring

      `container` or `vm` when the worker runs in one (it then reports the sandbox, not the machine around it).

  • memoryobjectrequired

    Bytes.

    • availableinteger· uint64requiredmin 0
    • swap_totalinteger· uint64requiredmin 0
    • swap_usedinteger· uint64requiredmin 0
    • totalinteger· uint64requiredmin 0
    • usedinteger· uint64requiredmin 0
  • netobject[]required

    Physical interfaces (what the `net` series count).

    • idstringrequired
    • rx_bpsinteger· uint64min 0
    • tx_bpsinteger· uint64min 0
  • net_virtualstring[]required

    Interfaces left out of `net`: bridges, veths, tunnels, loopback.

  • powerobject[]required

    Every power reading: `gpu:<id>` and `cpu`.

    • idstringrequired

      `gpu:<id>` or `cpu`.

    • labelstringrequired
    • wnumber· doublerequired

      Watts.

  • pressureany of

    Percent of the time some task stalled; null where the machine says nothing of it.

    any of (2)
    Variant 1
    • cpunumber· double
    • ionumber· double
    • memnumber· double
    Variant 2
    valuenull
  • ssdany of[]required

    Each NVMe drive's health, read at most once an hour.

    any of (2)
    Variant 1
    • cnumber· double

      °C.

    • errorsinteger· uint64requiredmin 0

      Media and data integrity errors.

    • idstringrequired
    • modelstringrequired
    • power_on_hinteger· uint64requiredmin 0
    • wear_pctinteger· uint8requiredmin 0

      The drive's estimate of its life used, percent (may pass 100).

    • written_bytesinteger· uint64requiredmin 0
    Variant 2
    • cnumber· double

      °C, from the controller's own sensor when it has one.

    • errorstringrequired

      `permission` (the health log needs root) or `unsupported`.

    • idstringrequired
    • modelstringrequired
  • tempsobject[]required

    Every temperature sensor; `id: "cpu"` is the one the `temp` series follows.

    • cnumber· doublerequired

      °C.

    • idstringrequired
    • labelstringrequired
    • maxnumber· double

      The sensor's own limit, °C (hwmon `crit`, else `max`); null when it gives none.

  • volumesobject[]required
    • availableinteger· uint64requiredmin 0

      What is left for the person to fill.

    • fsstringrequired
    • mountstringrequired
    • totalinteger· uint64requiredmin 0
    • usedinteger· uint64requiredmin 0

system::volumes

Function

The volumes (real filesystems, one per device, / first) as options: { options: [{ value: <mount point>, label, detail: '<fs> · <used> of <size>' }] }.

Request
Empty object
Response
  • optionsobject[]required
    • detailstring
    • labelstringrequired
    • valuestringrequired

      What the series keys use after the colon (`gpu:<value>`); `""` for the choice that stands for them all (`gpu`, `net.rx`, `disk.read`).

Search the registry

Find workers, kits and executables, or jump to a page.