pub struct LoadTestRunner { /* private fields */ }Expand description
Load test runner
Implementations§
Source§impl LoadTestRunner
impl LoadTestRunner
Sourcepub fn new(config: LoadTestConfig) -> Self
pub fn new(config: LoadTestConfig) -> Self
Create a new load test runner
Sourcepub fn with_base_url(self, url: impl Into<String>) -> Self
pub fn with_base_url(self, url: impl Into<String>) -> Self
Set the base URL for testing
Sourcepub fn with_auth_token(self, token: impl Into<String>) -> Self
pub fn with_auth_token(self, token: impl Into<String>) -> Self
Set authentication for all requests
Sourcepub async fn run_scenario<F, Fut>(
&self,
scenario: F,
) -> TestResult<LoadTestResults>where
F: Fn(TestClient) -> Fut + Send + Sync + Clone + 'static,
Fut: Future<Output = TestResult<Duration>> + Send,
pub async fn run_scenario<F, Fut>(
&self,
scenario: F,
) -> TestResult<LoadTestResults>where
F: Fn(TestClient) -> Fut + Send + Sync + Clone + 'static,
Fut: Future<Output = TestResult<Duration>> + Send,
Run a load test with a custom scenario
Sourcepub async fn run_get_test(
&self,
path: impl Into<String>,
) -> TestResult<LoadTestResults>
pub async fn run_get_test( &self, path: impl Into<String>, ) -> TestResult<LoadTestResults>
Run a simple GET request load test
Sourcepub async fn run_post_test<T: Serialize + Clone + Send + Sync + 'static>(
&self,
path: impl Into<String>,
data: T,
) -> TestResult<LoadTestResults>
pub async fn run_post_test<T: Serialize + Clone + Send + Sync + 'static>( &self, path: impl Into<String>, data: T, ) -> TestResult<LoadTestResults>
Run a POST request load test
Auto Trait Implementations§
impl Freeze for LoadTestRunner
impl RefUnwindSafe for LoadTestRunner
impl Send for LoadTestRunner
impl Sync for LoadTestRunner
impl Unpin for LoadTestRunner
impl UnwindSafe for LoadTestRunner
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more