pub struct HealthcheckConfig {
pub test: Option<Vec<String>>,
pub interval: Option<u64>,
pub timeout: Option<u64>,
pub retries: Option<u8>,
pub start_period: Option<u64>,
pub start_interval: Option<u64>,
}Expand description
Configuration for container healthchecks.
Fields§
§test: Option<Vec<String>>The test to perform. Possible values are:
[]inherit healthcheck from image or parent image["NONE"]disable healthcheck["CMD", args...]exec arguments directly["CMD-SHELL", command]run command with system’s default shell
interval: Option<u64>The time to wait between checks in nanoseconds. It should be 0 or at least 1_000_000 (1 ms). 0 means inherit.
timeout: Option<u64>The time to wait before considering the check to have hung in nanoseconds. It should be 0 or at least 1_000_000 (1 ms). 0 means inherit.
retries: Option<u8>The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit.
start_period: Option<u64>Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1_000_000 (1 ms). 0 means inherit.
start_interval: Option<u64>The time to wait between checks in nanoseconds during the start period. It should be 0 or at least 1_000_000 (1 ms). 0 means inherit.
Implementations§
Source§impl HealthcheckConfig
impl HealthcheckConfig
Sourcepub fn test(&mut self, test: Vec<String>) -> &mut Self
pub fn test(&mut self, test: Vec<String>) -> &mut Self
Sets the test command for the healthcheck.
Sourcepub fn interval(&mut self, interval: Duration) -> &mut Self
pub fn interval(&mut self, interval: Duration) -> &mut Self
Sets the interval between health checks. The duration will be converted to nanoseconds.
Sourcepub fn timeout(&mut self, timeout: Duration) -> &mut Self
pub fn timeout(&mut self, timeout: Duration) -> &mut Self
Sets the timeout for a single health check. The duration will be converted to nanoseconds.
Sourcepub fn retries(&mut self, retries: u8) -> &mut Self
pub fn retries(&mut self, retries: u8) -> &mut Self
Sets the number of retries before marking the container as unhealthy.
Sourcepub fn start_period(&mut self, start_period: Duration) -> &mut Self
pub fn start_period(&mut self, start_period: Duration) -> &mut Self
Sets the start period for the container. Health checks will not be considered failed during this period. The duration will be converted to nanoseconds.
Trait Implementations§
Source§impl Clone for HealthcheckConfig
impl Clone for HealthcheckConfig
Source§fn clone(&self) -> HealthcheckConfig
fn clone(&self) -> HealthcheckConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more