pub trait DynamicDiscardController:
Send
+ Sync
+ 'static {
// Required method
fn compute<'life0, 'async_trait>(
&'life0 mut self,
current_threshold: usize,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}Expand description
Controls the dynamic concurrency level by receiving periodic snapshots of job statistics and emitting a new concurrency limit
Required Methods§
Sourcefn compute<'life0, 'async_trait>(
&'life0 mut self,
current_threshold: usize,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn compute<'life0, 'async_trait>(
&'life0 mut self,
current_threshold: usize,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Compute the new threshold for discarding
If you want to utilize metrics exposed in crate::factory::stats you can gather them
by utilizing stats_facebook::service_data::get_service_data_singleton to retrieve a
accessor to ServiceData which you can then resolve stats by name (either timeseries or
counters)
The namespace of stats collected on the base controller factory are
base_controller.factory.{FACTORY_NAME}.{STAT}
If no factory name is set, then “all” will be inserted