pub struct RuntimeMetrics {Show 19 fields
pub registry: Registry,
pub vm_boot_duration: Histogram,
pub vm_count: IntGaugeVec,
pub vm_created_total: IntCounter,
pub vm_destroyed_total: IntCounter,
pub vm_cpu_percent: GaugeVec,
pub vm_memory_bytes: GaugeVec,
pub exec_total: IntCounter,
pub exec_duration: Histogram,
pub exec_errors_total: IntCounter,
pub image_pull_total: IntCounter,
pub image_pull_duration: Histogram,
pub image_build_total: IntCounter,
pub rootfs_cache_hits: IntCounter,
pub rootfs_cache_misses: IntCounter,
pub warm_pool_size: IntGauge,
pub warm_pool_capacity: IntGauge,
pub warm_pool_hits: IntCounter,
pub warm_pool_misses: IntCounter,
}Expand description
Pre-registered Prometheus metrics for the Box runtime.
Fields§
§registry: RegistryPrometheus registry holding all metrics.
vm_boot_duration: HistogramVM boot duration in seconds.
vm_count: IntGaugeVecNumber of VMs by state (created, ready, busy, compacting, stopped).
vm_created_total: IntCounterTotal VMs created since process start.
vm_destroyed_total: IntCounterTotal VMs destroyed since process start.
vm_cpu_percent: GaugeVecVM CPU usage percentage (per VM, labeled by box_id).
vm_memory_bytes: GaugeVecVM memory usage in bytes (per VM, labeled by box_id).
exec_total: IntCounterTotal exec commands executed.
exec_duration: HistogramExec command duration in seconds.
exec_errors_total: IntCounterExec commands that failed (non-zero exit or error).
image_pull_total: IntCounterTotal image pulls.
image_pull_duration: HistogramImage pull duration in seconds.
image_build_total: IntCounterTotal image builds.
rootfs_cache_hits: IntCounterRootfs cache hits.
rootfs_cache_misses: IntCounterRootfs cache misses.
warm_pool_size: IntGaugeCurrent warm pool size (idle VMs).
warm_pool_capacity: IntGaugeWarm pool capacity (max_size).
warm_pool_hits: IntCounterTotal VMs allocated from warm pool.
warm_pool_misses: IntCounterTotal VMs created fresh (warm pool miss).
Implementations§
Source§impl RuntimeMetrics
impl RuntimeMetrics
Sourcepub fn try_new() -> Result<Self, PrometheusError>
pub fn try_new() -> Result<Self, PrometheusError>
Try to create and register all metrics with a new registry.
Sourcepub fn with_registry(registry: Registry) -> Self
pub fn with_registry(registry: Registry) -> Self
Create and register all metrics with an existing registry.
Sourcepub fn try_with_registry(registry: Registry) -> Result<Self, PrometheusError>
pub fn try_with_registry(registry: Registry) -> Result<Self, PrometheusError>
Try to create and register all metrics with an existing registry.
Trait Implementations§
Source§impl Clone for RuntimeMetrics
impl Clone for RuntimeMetrics
Source§fn clone(&self) -> RuntimeMetrics
fn clone(&self) -> RuntimeMetrics
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RuntimeMetrics
impl Debug for RuntimeMetrics
Source§impl Default for RuntimeMetrics
impl Default for RuntimeMetrics
Source§impl MetricsCollector for RuntimeMetrics
impl MetricsCollector for RuntimeMetrics
Source§fn record_vm_boot(&self, duration_secs: f64)
fn record_vm_boot(&self, duration_secs: f64)
Source§fn inc_vm_state(&self, state: &str)
fn inc_vm_state(&self, state: &str)
Source§fn dec_vm_state(&self, state: &str)
fn dec_vm_state(&self, state: &str)
Source§fn inc_vm_created(&self)
fn inc_vm_created(&self)
Source§fn inc_vm_destroyed(&self)
fn inc_vm_destroyed(&self)
Source§fn record_exec(&self, duration_secs: f64, success: bool)
fn record_exec(&self, duration_secs: f64, success: bool)
Source§fn inc_cache_hit(&self)
fn inc_cache_hit(&self)
Source§fn inc_cache_miss(&self)
fn inc_cache_miss(&self)
Auto Trait Implementations§
impl !RefUnwindSafe for RuntimeMetrics
impl !UnwindSafe for RuntimeMetrics
impl Freeze for RuntimeMetrics
impl Send for RuntimeMetrics
impl Sync for RuntimeMetrics
impl Unpin for RuntimeMetrics
impl UnsafeUnpin for RuntimeMetrics
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more