pub struct ChunkedBenchConfig {Show 13 fields
pub target_url: String,
pub method: Method,
pub concurrency: u32,
pub duration: Duration,
pub chunk_size_bytes: usize,
pub total_size_bytes: usize,
pub chunk_interval_ms: u64,
pub headers: HashMap<String, String>,
pub skip_tls_verify: bool,
pub rps: Option<u32>,
pub no_keep_alive: bool,
pub body: Option<Arc<Vec<u8>>>,
pub request_timeout: Option<Duration>,
}Expand description
Configuration for the native chunked-encoding bench.
Fields§
§target_url: StringTarget URL (e.g. http://localhost:3000/upload).
method: MethodHTTP method. POST/PUT/PATCH make sense; GET/HEAD don’t take a body.
concurrency: u32Number of concurrent workers (each holds its own connection / future).
duration: DurationTotal run duration.
chunk_size_bytes: usizeBytes per chunk emitted into the request body stream.
total_size_bytes: usizeTotal body size per request, in bytes.
chunk_interval_ms: u64Sleep between chunks, in milliseconds. 0 = back-to-back.
headers: HashMap<String, String>Extra headers to attach to every request. Transfer-Encoding: chunked
is set automatically by hyper because the body has no Content-Length.
skip_tls_verify: boolSkip TLS certificate verification (useful for test self-signed certs).
rps: Option<u32>Cap on request starts per second, shared by all workers. None =
each worker starts its next request as soon as the previous one ends.
The achieved rate can’t exceed concurrency / request_duration.
no_keep_alive: boolOpen a fresh TCP/TLS connection for every request (no pooling), so the connections-per-second rate equals the request rate.
body: Option<Arc<Vec<u8>>>Pre-built request body to stream instead of X filler (e.g. a JSON
document from build_json_body). When set, its length replaces
total_size_bytes as the per-request body size.
request_timeout: Option<Duration>Deadline for one whole request: connect, the chunked upload, and the
response. A request that misses it counts as failed and timed out,
freeing its worker. None waits on OS TCP timeouts, which can hold
a worker for many minutes when packets are silently dropped.
Implementations§
Source§impl ChunkedBenchConfig
impl ChunkedBenchConfig
Sourcepub fn min_upload_time(&self) -> Duration
pub fn min_upload_time(&self) -> Duration
Shortest possible upload: the pauses between chunks, ignoring network time.
Sourcepub fn auto_request_timeout(&self) -> Duration
pub fn auto_request_timeout(&self) -> Duration
Default request timeout: twice the minimum upload time plus a minute, so healthy slow uploads and responses fit comfortably.
Trait Implementations§
Source§impl Clone for ChunkedBenchConfig
impl Clone for ChunkedBenchConfig
Auto Trait Implementations§
impl Freeze for ChunkedBenchConfig
impl RefUnwindSafe for ChunkedBenchConfig
impl Send for ChunkedBenchConfig
impl Sync for ChunkedBenchConfig
impl Unpin for ChunkedBenchConfig
impl UnsafeUnpin for ChunkedBenchConfig
impl UnwindSafe for ChunkedBenchConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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