Skip to main content

Crate microsandbox_metrics

Crate microsandbox_metrics 

Source
Expand description

Shared-memory live metrics registry for microsandbox.

Replaces continuous sandbox_metric inserts into the catalog SQLite database with a single POSIX shared-memory region. Every running sandbox owns one fixed slot; readers scan the region to produce typed metrics responses without per-sandbox RPC or per-sample writes.

Structs§

ActivateSlot
Caller-supplied data used to transition a reservation to active.
LiveMetric
Coherent live sample read from a single registry slot.
MetricsRegistry
Shared-memory registry.
MetricsSlotWriter
Per-slot writer handle held by the runtime process.
ReserveSlot
Caller-supplied data used to reserve a slot.
SampleWrite
Sample bytes to write into a slot.
SandboxMetricSnapshot
Metrics plus shared-memory identity metadata for one active sandbox slot.
SandboxMetrics
Point-in-time metrics for a running sandbox (no identity fields).
SlotReservation
Reservation token returned by MetricsRegistry::reserve.

Enums§

LiveMetricState
Slot state observed when a LiveMetric was read.
MetricsError
Errors produced by the metrics registry.
ReleaseMode
Mode passed to MetricsRegistry::release.

Constants§

REGISTRY_ABI_VERSION
Maximum bytes reserved for a sandbox name inside a fixed metrics slot. Current shared-memory registry ABI version.
SLOT_NAME_BYTES
Maximum bytes reserved for a sandbox name inside a fixed metrics slot. Maximum bytes reserved for the sandbox name inside a slot.

Functions§

default_capacity
Default capacity used by the host launcher when creating a registry.

Type Aliases§

MetricsResult
Result alias for metrics operations.