Skip to main content

microsandbox_metrics/
lib.rs

1//! Shared-memory live metrics registry for microsandbox.
2//!
3//! Replaces continuous `sandbox_metric` inserts into the catalog SQLite
4//! database with a single POSIX shared-memory region. Every running sandbox
5//! owns one fixed slot; readers scan the region to produce typed metrics
6//! responses without per-sandbox RPC or per-sample writes.
7
8#![warn(missing_docs)]
9
10mod error;
11mod layout;
12mod registry;
13mod snapshot;
14
15//--------------------------------------------------------------------------------------------------
16// Re-Exports
17//--------------------------------------------------------------------------------------------------
18
19pub use error::{MetricsError, MetricsResult};
20/// Maximum bytes reserved for a sandbox name inside a fixed metrics slot.
21pub use layout::{NAME_BYTES as SLOT_NAME_BYTES, REGISTRY_ABI_VERSION};
22pub use registry::{
23    ActivateSlot, MetricsRegistry, MetricsSlotWriter, ReleaseMode, ReserveSlot, SampleWrite,
24    SlotReservation, default_capacity,
25};
26pub use snapshot::{LiveMetric, LiveMetricState, SandboxMetricSnapshot, SandboxMetrics};