pub struct LoadTestConfig {
pub concurrency: usize,
pub total_requests: u64,
pub duration: Option<Duration>,
pub rate_limit: Option<f64>,
pub timeout: Duration,
}Expand description
Load test configuration
Fields§
§concurrency: usizeNumber of concurrent requests
total_requests: u64Total number of requests
duration: Option<Duration>Duration of test (alternative to total_requests)
rate_limit: Option<f64>Requests per second limit
timeout: DurationTimeout per request
Implementations§
Source§impl LoadTestConfig
impl LoadTestConfig
Sourcepub fn new(concurrency: usize, total_requests: u64) -> Self
pub fn new(concurrency: usize, total_requests: u64) -> Self
Create new load test config
§Examples
use armature_testing::load::LoadTestConfig;
let config = LoadTestConfig::new(10, 1000);Sourcepub fn with_duration(self, duration: Duration) -> Self
pub fn with_duration(self, duration: Duration) -> Self
Set test duration instead of request count
Sourcepub fn with_rate_limit(self, rps: f64) -> Self
pub fn with_rate_limit(self, rps: f64) -> Self
Set rate limit (requests per second)
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set timeout per request
Trait Implementations§
Source§impl Clone for LoadTestConfig
impl Clone for LoadTestConfig
Source§impl Debug for LoadTestConfig
impl Debug for LoadTestConfig
Auto Trait Implementations§
impl Freeze for LoadTestConfig
impl RefUnwindSafe for LoadTestConfig
impl Send for LoadTestConfig
impl Sync for LoadTestConfig
impl Unpin for LoadTestConfig
impl UnsafeUnpin for LoadTestConfig
impl UnwindSafe for LoadTestConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<R, D> DepsPresent<D> for R
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging