pub struct WorkerCapabilities {Show 13 fields
pub rustc_version: Option<String>,
pub bun_version: Option<String>,
pub node_version: Option<String>,
pub npm_version: Option<String>,
pub num_cpus: Option<u32>,
pub load_avg_1: Option<f64>,
pub load_avg_5: Option<f64>,
pub load_avg_15: Option<f64>,
pub disk_free_gb: Option<f64>,
pub disk_total_gb: Option<f64>,
pub projects_root_ok: Option<bool>,
pub projects_root_issue: Option<String>,
pub projects_root_checked_at_unix_ms: Option<i64>,
}Expand description
Runtime capabilities detected on a worker.
These are probed during health checks and cached for routing decisions.
Commands requiring specific runtimes (e.g., bun test) can be routed
only to workers with the corresponding capability.
Fields§
§rustc_version: Option<String>Rust compiler version (from rustc --version).
bun_version: Option<String>Bun runtime version (from bun --version).
node_version: Option<String>Node.js version (from node --version).
npm_version: Option<String>npm version (from npm --version).
num_cpus: Option<u32>Number of CPU cores on the worker.
load_avg_1: Option<f64>1-minute load average.
load_avg_5: Option<f64>5-minute load average.
load_avg_15: Option<f64>15-minute load average.
disk_free_gb: Option<f64>Free disk space in GB (on /tmp or build directory).
disk_total_gb: Option<f64>Total disk space in GB.
projects_root_ok: Option<bool>Canonical path-topology preflight status (/data/projects + /dp alias).
Some(false) indicates a hard preflight failure that should exclude this
worker from remote scheduling until a subsequent successful revalidation.
projects_root_issue: Option<String>Machine-readable failure reason for path-topology preflight.
projects_root_checked_at_unix_ms: Option<i64>Unix timestamp (ms) when topology preflight last executed.
Implementations§
Source§impl WorkerCapabilities
impl WorkerCapabilities
Sourcepub fn mock_with_rust() -> Self
pub fn mock_with_rust() -> Self
Create mock capabilities with Rust installed.
Used by mock transport to simulate a worker with Rust toolchain.
Sourcepub fn load_per_core(&self) -> Option<f64>
pub fn load_per_core(&self) -> Option<f64>
Calculate load per core (1-minute load average / num_cpus). Returns None if metrics are unavailable.
Sourcepub fn is_high_load(&self, max_load_per_core: f64) -> Option<bool>
pub fn is_high_load(&self, max_load_per_core: f64) -> Option<bool>
Check if worker has high load (exceeds threshold). Returns None if metrics unavailable (fail-open).
Sourcepub fn is_low_disk(&self, min_free_gb: f64) -> Option<bool>
pub fn is_low_disk(&self, min_free_gb: f64) -> Option<bool>
Check if worker has low disk space (below threshold). Returns None if metrics unavailable (fail-open).
Sourcepub fn is_topology_healthy(&self) -> Option<bool>
pub fn is_topology_healthy(&self) -> Option<bool>
Check if canonical path-topology preflight is healthy.
Returns None when probe data is unavailable (fail-open behavior).
Trait Implementations§
Source§impl Clone for WorkerCapabilities
impl Clone for WorkerCapabilities
Source§fn clone(&self) -> WorkerCapabilities
fn clone(&self) -> WorkerCapabilities
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 WorkerCapabilities
impl Debug for WorkerCapabilities
Source§impl Default for WorkerCapabilities
impl Default for WorkerCapabilities
Source§fn default() -> WorkerCapabilities
fn default() -> WorkerCapabilities
Source§impl<'de> Deserialize<'de> for WorkerCapabilities
impl<'de> Deserialize<'de> for WorkerCapabilities
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for WorkerCapabilities
impl JsonSchema for WorkerCapabilities
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more