pub struct BottleneckSimulator { /* private fields */ }Expand description
Bottleneck simulator
Simulates various types of bottlenecks.
Implementations§
Source§impl BottleneckSimulator
impl BottleneckSimulator
Sourcepub async fn add_bottleneck(&self, config: BottleneckConfig)
pub async fn add_bottleneck(&self, config: BottleneckConfig)
Add a bottleneck
Sourcepub async fn clear_bottlenecks(&self)
pub async fn clear_bottlenecks(&self)
Remove all bottlenecks
Sourcepub async fn get_bottlenecks(&self) -> Vec<BottleneckConfig>
pub async fn get_bottlenecks(&self) -> Vec<BottleneckConfig>
Get active bottlenecks
Sourcepub async fn apply_bottlenecks(&self, endpoint: &str) -> u64
pub async fn apply_bottlenecks(&self, endpoint: &str) -> u64
Apply bottlenecks for a request
Returns the total delay in milliseconds.
Trait Implementations§
Source§impl Clone for BottleneckSimulator
impl Clone for BottleneckSimulator
Source§fn clone(&self) -> BottleneckSimulator
fn clone(&self) -> BottleneckSimulator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BottleneckSimulator
impl Debug for BottleneckSimulator
Auto Trait Implementations§
impl Freeze for BottleneckSimulator
impl !RefUnwindSafe for BottleneckSimulator
impl Send for BottleneckSimulator
impl Sync for BottleneckSimulator
impl Unpin for BottleneckSimulator
impl !UnwindSafe for BottleneckSimulator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more