Struct HyperGenerator

Source
pub struct HyperGenerator<S: Scenario> {
    pub scenario: S,
    pub request: HttpConfig,
    pub max_open_connections: usize,
    /* private fields */
}
Expand description

A hyper based generator. This generator use’s HTTP multiplexing, and requires that the target server supports HTTP2. Much like the reqwest generator, HyperGenerator 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.

Graph of RequestGenerator

Fields§

§scenario: S§request: HttpConfig§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.

Implementations§

Source§

impl<S: Scenario> HyperGenerator<S>

Source

pub fn new( scenario: S, request: HttpConfig, max_open_connections: usize, worker_count: usize, warmup: bool, ) -> Self

Constructs a new HyperGenerator

Trait Implementations§

Source§

impl<T: Scenario> TrafficGenerator<T> for HyperGenerator<T>

Source§

fn run_scenario(&mut self)

Runs the current scenario
Source§

fn fire_hose(&mut self)

Run the generator at full throttle!
Source§

fn set_scenario(&mut self, schem: T)

Sets a Scenario for the generator to try and replicate.
Source§

fn get_scenario(&self) -> &T

Gets the current Scenario
Source§

fn send_packet(&mut self)

Send a single packet per call, used for debuging and low traffic testing.
Source§

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).
Source§

fn get_sent_packets_channel(&self) -> Receiver<usize>

Give a bounded channel that sends the total amount of packets/requests sent
Source§

fn get_error_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).

Auto Trait Implementations§

§

impl<S> Freeze for HyperGenerator<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for HyperGenerator<S>
where S: RefUnwindSafe,

§

impl<S> Send for HyperGenerator<S>

§

impl<S> Sync for HyperGenerator<S>

§

impl<S> Unpin for HyperGenerator<S>
where S: Unpin,

§

impl<S> UnwindSafe for HyperGenerator<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,