[][src]Struct clobber::config::Config

pub struct Config {
    pub target: SocketAddr,
    pub connections: u32,
    pub rate: Option<u32>,
    pub duration: Option<Duration>,
    pub threads: Option<u32>,
    pub connect_timeout: Option<u32>,
    pub read_timeout: Option<u32>,
    pub limit: Option<u32>,
    pub repeat: u32,
}

Settings for the load test

todo: Make write/read optional. (Enum?)

Fields

target: SocketAddr

Socket address (ip and port) of the host we'll be calling

connections: u32

Connections is the a key knob to turn when tuning a performance test. Honestly 'connections' isn't the best name; it implies a certain persistance that

rate: Option<u32>

Optional rate-limiting. Precisely timing high rates is unreliable; if you're seeing slower than expected performance try running with no rate limit at all.

duration: Option<Duration>

Optional duration. If duration is None, clobber will run indefinitely.

threads: Option<u32>

Number of OS threads to distribute work between. 0 becomes num_cpus.

connect_timeout: Option<u32>

Optionally time out requests at a number of milliseconds. Note: checking timeouts costs CPU cycles; max performance will suffer. However, if you have an ill-behaving server that isn't connecting consistently and is hanging onto connections, this can improve the situation.

read_timeout: Option<u32>

Optionally time out read requests at a number of milliseconds. Note: checking timeouts costs CPU cycles; max performance will suffer. However, if you have an ill-behaving server that isn't sending EOF bytes or otherwise isn't dropping connections, this can be essential to maintaing a high(ish) throughput, at the cost of more CPU load.

limit: Option<u32>

Absolute number of requests to be made. Should split evenly across threads.

repeat: u32

Repeats the outgoing message

Methods

impl Config[src]

pub fn new(target: SocketAddr) -> Config[src]

pub fn num_threads(&self) -> u32[src]

Number of user-defined threads, or all the threads on the host.

pub fn connections_per_thread(&self) -> u32[src]

Number of connection loops each thread should maintain. Will never be less than the number of threads.

pub fn connection_delay(&self) -> Duration[src]

The amount a single connection should wait between loops in order to maintain the defined rate. Returns a default duration if there is no rate.

pub fn limit_per_connection(&self) -> Option<u32>[src]

The number of iterations each connection loop should perform before stopping. Doesn't play nice with limits that are not divisible by the number of threads and connections.

Trait Implementations

impl Clone for Config[src]

impl Copy for Config[src]

impl Debug for Config[src]

Auto Trait Implementations

impl Unpin for Config

impl Sync for Config

impl Send for Config

impl UnwindSafe for Config

impl RefUnwindSafe for Config

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]