pub fn estimate_wait_time(&self) -> u32 {
        // TODO: handle install case elsewhere..
        if let Some(size) = self.imageSize {
            // 512 default => extra 90s wait, then 90s per half gig...
            // TODO: smoothen..
            let pulltimeestimate = std::cmp::max(60, ((f64::from(size) * 90.0) / 512.0) as u32);
            let rollout_iterations = self.estimate_rollout_iterations();
            // println!("estimating wait for {} cycle rollout: size={} (est={})", rollout_iterations, size, pulltimeestimate);

            // how long each iteration needs to wait due to readinessProbe params.
            let delayTimeSecs = if let Some(ref hc) = self.health {
                hc.wait
            } else if let Some(ref rp) = self.readinessProbe {
                rp.initialDelaySeconds
            } else {
                30 // guess value in weird case where no health / readiessProbe
            };
            // give it some leeway
            let delayTime = (f64::from(delayTimeSecs) * 1.5).ceil() as u32;
            // leeway scales linearly with wait because we assume accuracy goes down..

            // Final formula: (how long to wait to poll + how long to pull) * num cycles
            (delayTime + pulltimeestimate) * rollout_iterations
        } else {
            warn!("Missing imageSize in {}", self.name);
            300 // helm default --timeout value
        }
    }
/// Estimate how long to wait for a kube rolling upgrade
///
/// Was used by helm, now used by the internal upgrade wait time.
Estimate how long to wait for a kube rolling upgrade
Was used by helm, now used by the internal upgrade wait time.
Estimate how long to wait for a kube rolling upgrade Was used by helm now used by the internal upgrade wait time .
pub fn estimate_wait_time(&self) -> u32 {
        // TODO: handle install case elsewhere..
        if let Some(size) = self.imageSize {
            // 512 default => extra 90s wait, then 90s per half gig...
            // TODO: smoothen..
            let pulltimeestimate = std::cmp::max(60, ((f64::from(size) * 90.0) / 512.0) as u32);
            let rollout_iterations = self.estimate_rollout_iterations();
            // println!("estimating wait for {} cycle rollout: size={} (est={})", rollout_iterations, size, pulltimeestimate);
            // how long each iteration needs to wait due to readinessProbe params.
            let delayTimeSecs = if let Some(ref hc) = self.health {
                hc.wait
            } else if let Some(ref rp) = self.readinessProbe {
                rp.initialDelaySeconds
            } else {
                30 // guess value in weird case where no health / readiessProbe
            };
            // give it some leeway
            let delayTime = (f64::from(delayTimeSecs) * 1.5).ceil() as u32;
            // leeway scales linearly with wait because we assume accuracy goes down..
            // Final formula: (how long to wait to poll + how long to pull) * num cycles
            (delayTime + pulltimeestimate) * rollout_iterations
        } else {
            warn!("Missing imageSize in {}", self.name);
            300 // helm default --timeout value
        }
    }
pub fn estimate_wait_time ( & self ) -> u32 { // TODO: handle install case elsewhere.. if let Some ( size ) = self . imageSize { // 512 default => extra 90s wait, then 90s per half gig... // TODO: smoothen.. let pulltimeestimate = std :: cmp :: max ( 60 , ( ( f64 :: from ( size ) * 90.0 ) / 512.0 ) as u32 ) ; let rollout_iterations = self . estimate_rollout_iterations ( ) ; // println!("estimating wait for {} cycle rollout: size={} (est={})", rollout_iterations, size, pulltimeestimate); // how long each iteration needs to wait due to readinessProbe params. let delayTimeSecs = if let Some ( ref hc ) = self . health { hc . wait } else if let Some ( ref rp ) = self . readinessProbe { rp . initialDelaySeconds } else { 30 // guess value in weird case where no health / readiessProbe } ; // give it some leeway let delayTime = ( f64 :: from ( delayTimeSecs ) * 1.5 ) . ceil ( ) as u32 ; // leeway scales linearly with wait because we assume accuracy goes down.. // Final formula: (how long to wait to poll + how long to pull) * num cycles ( delayTime + pulltimeestimate ) * rollout_iterations } else { warn ! ( " " self name ) ; 300 // helm default --timeout value } }
Estimate how long to wait for a kube rolling upgrade
Was used by helm, now used by the internal upgrade wait time.
Estimate how long to wait for a kube rolling upgrade Was used by helm now used by the internal upgrade wait time .
&self
&self