pub struct WorkerMeta {
pub worker_id: String,
pub host: String,
pub pid: i32,
pub queues: Vec<String>,
pub concurrency: u32,
pub started_at_ms: i64,
pub heartbeat_at_ms: i64,
pub inflight: u32,
pub polls: u64,
pub empty_polls: u64,
}Fields§
§worker_id: String§host: String§pid: i32§queues: Vec<String>§concurrency: u32The worker’s configured capacity — the denominator of inflight / capacity.
started_at_ms: i64§heartbeat_at_ms: i64§inflight: u32Jobs this worker is running right now.
polls: u64Admissions attempted in the runner’s rolling window.
empty_polls: u64Of those, how many returned zero jobs. The RATIO is the scale-down signal; the two counters ride the wire instead of a float so the aggregate is exact and so neither language has to agree with the other about float formatting.
Implementations§
Source§impl WorkerMeta
impl WorkerMeta
Sourcepub fn utilization(&self) -> f64
pub fn utilization(&self) -> f64
backlog metrics inflight / capacity. 0.0 when capacity is 0 — never a division by zero,
and never 1.0 for a worker that cannot run anything.
Sourcepub fn empty_poll_ratio(&self) -> f64
pub fn empty_poll_ratio(&self) -> f64
backlog metrics empty admissions / total admissions over the reported window. 0.0 when the window is empty — an idle-since-startup worker has no evidence either way, and reporting 1.0 there would signal “scale down” from no data at all.
Trait Implementations§
Source§impl Clone for WorkerMeta
impl Clone for WorkerMeta
Source§fn clone(&self) -> WorkerMeta
fn clone(&self) -> WorkerMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more