[][src]Struct trawler::WorkloadBuilder

pub struct WorkloadBuilder<'a> { /* fields omitted */ }

Set the parameters for a new Lobsters-like workload.

Methods

impl<'a> WorkloadBuilder<'a>[src]

pub fn scale(&mut self, factor: f64) -> &mut Self[src]

Set the scaling factor for the workload.

A factor of 1 generates a workload commensurate with what the real lobste.rs sees. At scale 1, the site starts out with ~40k stories with a total of ~300k comments spread across 9k users. The generated load is on average 44 requests/minute, with a request distribution set according to the one observed on lobste.rs (see data/ for details).

pub fn time(&mut self, warmup: Duration, runtime: Duration) -> &mut Self[src]

Set the runtime for the benchmark.

pub fn in_flight(&mut self, max: usize) -> &mut Self[src]

The maximum number of outstanding request any single issuer is allowed to have to the backend. Defaults to 20.

pub fn with_histogram<'this>(&'this mut self, path: &'a str) -> &'this mut Self[src]

Instruct the load generator to store raw histogram data of request latencies into the given file upon completion.

If the given file exists at the start of the benchmark, the existing histograms will be amended, not replaced.

impl<'a> WorkloadBuilder<'a>[src]

pub fn run<C>(&self, client: C, prime: bool) where
    C: LobstersClient + 'static, 
[src]

Run this workload with clients spawned from the given factory.

If prime is true, the database will be seeded with stories and comments according to the scaling factory before the benchmark starts. If the site has already been primed, there is no need to prime again unless the backend is emptied or the scaling factor is changed. Note that priming does not delete the database, nor detect the current scaling factor, so always empty the backend before calling run with prime set.

Trait Implementations

impl<'a> Default for WorkloadBuilder<'a>[src]

Auto Trait Implementations

impl<'a> Send for WorkloadBuilder<'a>

impl<'a> Sync for WorkloadBuilder<'a>

impl<'a> Unpin for WorkloadBuilder<'a>

impl<'a> UnwindSafe for WorkloadBuilder<'a>

impl<'a> RefUnwindSafe for WorkloadBuilder<'a>

Blanket Implementations

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]