pub struct HealthState { /* private fields */ }Expand description
Shared health state, updated by the pipeline runtime and read by the probes. All methods are lock-free and callable from any thread.
Implementations§
Source§impl HealthState
impl HealthState
Sourcepub fn new(pipeline_threads: usize, thresholds: HealthThresholds) -> Arc<Self> ⓘ
pub fn new(pipeline_threads: usize, thresholds: HealthThresholds) -> Arc<Self> ⓘ
Create state for pipeline_threads heartbeating threads. All
heartbeats start “fresh” at creation time.
Sourcepub fn heartbeat(&self, thread: usize)
pub fn heartbeat(&self, thread: usize)
Beat thread thread’s heart on the clock given at construction, the
system clock from new. Called once per poll iteration;
out of range indices are ignored.
Sourcepub fn set_assignment_received(&self, received: bool)
pub fn set_assignment_received(&self, received: bool)
Mark whether the source has received its (initial) assignment.
Sourcepub fn set_sinks_connected(&self, connected: bool)
pub fn set_sinks_connected(&self, connected: bool)
Mark whether all sinks report connectivity.
Sourcepub fn report_watermark(&self, age: Duration, data_flowing: bool)
pub fn report_watermark(&self, age: Duration, data_flowing: bool)
Report the checkpointer’s oldest-unacknowledged-batch age and whether data is currently flowing (a stuck watermark only counts against liveness while records move).
Sourcepub fn healthy(&self) -> bool
pub fn healthy(&self) -> bool
Liveness now, on the clock given at construction, the system clock
from new.
Sourcepub fn healthy_at(&self, now: Instant) -> bool
pub fn healthy_at(&self, now: Instant) -> bool
Liveness as of now (injectable for tests).