Skip to main content

DynamicDiscardController

Trait DynamicDiscardController 

Source
pub trait DynamicDiscardController:
    Send
    + Sync
    + 'static {
    // Required method
    fn compute(&mut self, current_threshold: usize) -> BoxFuture<'_, usize>;
}
Expand description

Controls the dynamic concurrency level by receiving periodic snapshots of job statistics and emitting a new concurrency limit

Required Methods§

Source

fn compute(&mut self, current_threshold: usize) -> BoxFuture<'_, usize>

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§