Daemon: resources

cua.daemon.v1 resource messages: processor, memory and disk of this Mac, its extra Spaces and your other computers.

What SpaceService.GetResources and WatchResources return: one snapshot, then updates and the low-disk warning. Numbers only.

Source: libs/cua/proto/cua/daemon/v1/resources.proto.

Types in cua/daemon/v1/resources.proto#

GetResourcesRequest#

Request for SpaceService.GetResources.

Field#TypeDescription
visible1boolA window shows the numbers: sample every 10 seconds for the next 30.

GetResourcesResponse#

Response for SpaceService.GetResources.

Field#TypeDescription
snapshot1ResourcesSnapshotEverything, now.

WatchResourcesRequest#

Request for SpaceService.WatchResources.

Field#TypeDescription
visible1boolA window shows the numbers (sample every 10 seconds) rather than only the menu bar warning (every 5 minutes).

WatchResourcesResponse#

One event of SpaceService.WatchResources.

Field#TypeDescription
snapshot1ResourcesSnapshot (oneof event)Everything, once at the start.
update2ResourcesUpdate (oneof event)Only what changed.
low_disk3DiskWarning (oneof event)The free-disk warning level changed.

ResourcesSnapshot#

One sample of everything.

Field#TypeDescription
sequence1uint64Grows by one per sample.
sampled_at_ms2uint64When it was sampled, in Unix milliseconds.
this_mac3ComputerResourcesThis computer.
spaces4repeated SpaceResourcesThe extra Spaces on this computer (the local ones).
computers5repeated ComputerResourcesYour other computers that published a summary (through the relay).
warning6DiskWarningthis_mac.warning, for the menu bar.

ResourcesUpdate#

What changed since the receiver's last update, past the thresholds.

Field#TypeDescription
sequence1uint64The sample it brings the receiver to.
sampled_at_ms2uint64When it was sampled, in Unix milliseconds.
this_mac3optional ComputerResourcesThis computer, when it changed.
spaces4repeated SpaceResourcesExtra Spaces that changed or appeared: replace by id.
computers5repeated ComputerResourcesOther computers that changed or appeared: replace by id.
removed6repeated stringIds (Spaces or computers) that are gone.

DiskWarning#

The low-disk signal.

Field#TypeDescription
level1stringok, low (under 50 GB or 15% of the volume, whichever line is higher, capped at 100 GB) or critical (under the floor where creates fail, 5 GiB unless CUA_DISK_MIN_FREE says otherwise).
free2uint64Free bytes on the volume that holds Spaces.
total3uint64Size of that volume in bytes.
threshold4uint64The line that was crossed in bytes (0 when ok).

ComputerResources#

A computer: this one, or one of your other computers.

Field#TypeDescription
id1stringthis-mac, or the relay machine id.
name2stringDisplay name (empty for this computer).
online3boolReachable now (always true for this computer).
sampled_at_ms4uint64When the computer measured this, in Unix milliseconds (another computer's can be minutes old).
cpu_count5uint32Processor cores.
cpu_percent6doubleBusy now, 0 to 100.
load_average_1m7double1-minute load average.
memory_total8uint64Memory size in bytes.
memory_used9uint64Memory in use in bytes, without reclaimable cache.
disk_total10uint64Size of the volume that holds Spaces in bytes.
disk_free11uint64Free bytes on that volume.
spaces_count12uint32Extra Spaces on it.
spaces_running13uint32Of those, running.
spaces_cpu_allocated14uint32Cores given to the running ones.
spaces_memory_allocated15uint64Memory given to the running ones in bytes.
spaces_memory_used16uint64Memory the running guests report in use in bytes.
spaces_disk_bytes17uint64Bytes all its extra Spaces take on it.
spaces_disk_exact18boolFalse when some Space's disk could only be estimated.
warning19DiskWarningThe low-disk signal.

GuestUsage#

What cua.env.v1.SystemService.Metrics reports from inside a Space.

Field#TypeDescription
cpu_count1uint32Cores the guest sees.
cpu_percent2doubleBusy now, 0 to 100.
load_average_1m3double1-minute load average.
memory_used4uint64Memory in use in bytes.
memory_total5uint64Memory size in bytes.
memory_limited6boolmemory_total is the guest's own limit.
disk_used7uint64Disk in use in bytes.
disk_total8uint64Disk size in bytes.
disk_limited9booldisk_total is the guest's own disk.

DiskOnHost#

What a Space costs this computer's disk, as opposed to what the guest sees.

Field#TypeDescription
bytes1optional uint64Bytes only this Space holds: what deleting it frees. Unset when they could not be measured.
allocated2uint64Blocks its files occupy, clones counted in full: an upper bound.
shares_space3boolPart of it is shared with other copies.

SpaceResources#

One extra Space on this computer.

Field#TypeDescription
id1stringThe Space id, for example local:aurora.
power_state2stringrunning, stopped, suspended, or empty when unknown.
cpu_allocated3uint32Cores given to it (0: unknown).
memory_allocated4uint64Memory given to it in bytes (0: unknown).
disk_allocated5uint64Its disk's size limit in bytes (0: unknown).
usage6GuestUsageThe guest's own numbers; unset while it is off or unreachable.
disk_on_host7DiskOnHostWhat it costs this computer; unset for a container.