Struct pdc_core::generator::reqwest_generator::ReqwestGenerator
source · [−]pub struct ReqwestGenerator<S: Scenario> {
pub scenario: S,
pub max_open_connections: usize,
pub warmup: bool,
pub req: Request,
/* private fields */
}
Expand description
Very simple reqwest based generator. This generator does not use HTTP multiplexing and is very sensitive to latency. For good proformance, it is recommended to test servers running on the same LAN as your machine. This Generator will reuse TCP connections for requests, and all request will be sent from the same IP.
Fields
scenario: S
max_open_connections: usize
This is the maximum amount of TCP file descriptors being used at any one time. The actual number of open connections will be higher, because it takes time to purge old fd’s.
warmup: bool
Let this generator warm up to the rate at t=0 before sending test data.
req: Request
The request to send.
Implementations
sourceimpl<S: Scenario> ReqwestGenerator<S>
impl<S: Scenario> ReqwestGenerator<S>
Trait Implementations
sourceimpl<T: Scenario> TrafficGenerator<T> for ReqwestGenerator<T>
impl<T: Scenario> TrafficGenerator<T> for ReqwestGenerator<T>
sourcefn run_scenario(&mut self)
fn run_scenario(&mut self)
Runs the current scenario
sourcefn set_scenario(&mut self, schem: T)
fn set_scenario(&mut self, schem: T)
Sets a Scenario
for the generator to try and replicate.
sourcefn get_scenario(&self) -> &T
fn get_scenario(&self) -> &T
Gets the current Scenario
sourcefn send_packet(&mut self)
fn send_packet(&mut self)
Send a single packet per call, used for debuging and low traffic testing.
sourcefn get_data_rate_channel(&self) -> Receiver<(f32, f32)>
fn get_data_rate_channel(&self) -> Receiver<(f32, f32)>
Give a bounded channel that sends time series data on the send rate of
a generator. The data is encoded as
(Miliseconds since start of scenario, counts/sec)
. Read more
sourcefn get_sent_packets_channel(&self) -> Receiver<usize>
fn get_sent_packets_channel(&self) -> Receiver<usize>
Give a bounded channel that sends the total amount of packets/requests sent
Auto Trait Implementations
impl<S> !RefUnwindSafe for ReqwestGenerator<S>
impl<S> Send for ReqwestGenerator<S>
impl<S> Sync for ReqwestGenerator<S>
impl<S> Unpin for ReqwestGenerator<S> where
S: Unpin,
impl<S> !UnwindSafe for ReqwestGenerator<S>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more