fn do_upscaling(
        &self,
        stats: &mut ActorGroupStats,
        actors: &FxHashMap<BastionId, (Sender, RecoverableHandle<()>)>,
    ) -> Option<ScalingRule> {
        match self.upscale_strategy {
            UpscaleStrategy::MailboxSizeThreshold(threshold) => {
                if stats.average_mailbox_size > threshold {
                    let count = (stats.actors_count as f64 * self.upscale_rate).ceil() as u64;
                    stats.average_mailbox_size = 0;
                    stats.store(self.stats.clone());
                    return Some(self.adjustment_upscaling(actors, count));
                }
            }
        }

        None
    }
// Scaling up based on the given strategy.
Scaling up based on the given strategy.
Scaling up based on the given strategy .
fn do_upscaling(
        &self,
        stats: &mut ActorGroupStats,
        actors: &FxHashMap<BastionId, (Sender, RecoverableHandle<()>)>,
    ) -> Option<ScalingRule> {
        match self.upscale_strategy {
            UpscaleStrategy::MailboxSizeThreshold(threshold) => {
                if stats.average_mailbox_size > threshold {
                    let count = (stats.actors_count as f64 * self.upscale_rate).ceil() as u64;
                    stats.average_mailbox_size = 0;
                    stats.store(self.stats.clone());
                    return Some(self.adjustment_upscaling(actors, count));
                }
            }
        }
        None
    }
fn do_upscaling ( & self , stats : & mut ActorGroupStats , actors : & FxHashMap < BastionId , ( Sender , RecoverableHandle < ( ) > ) > , ) -> Option < ScalingRule > { match self . upscale_strategy { UpscaleStrategy :: MailboxSizeThreshold ( threshold ) => { if stats . average_mailbox_size > threshold { let count = ( stats . actors_count as f64 * self . upscale_rate ) . ceil ( ) as u64 ; stats . average_mailbox_size = 0 ; stats . store ( self . stats . clone ( ) ) ; return Some ( self . adjustment_upscaling ( actors , count ) ) ; } } } None }
Scaling up based on the given strategy.
Scaling up based on the given strategy .
&self
stats
&mut ActorGroupStats
actors
&FxHashMap<BastionId, (Sender, RecoverableHandle<()>)>
&self
stats
&mut ActorGroupStats
actors
&FxHashMap<BastionId, (Sender, RecoverableHandle<()>)>