Skip to main content

RunConfig

Struct RunConfig 

Source
pub struct RunConfig {
    pub endpoint: Endpoint,
    pub claimed_model: Option<String>,
    pub depth: Depth,
    pub lang: Lang,
    pub selection: Selection,
    pub seed: Option<u64>,
    pub http: Option<Client>,
    pub pace: Option<Pace>,
    pub concurrency: usize,
    pub max_in_flight: usize,
}
Expand description

Everything a run needs.

Fields§

§endpoint: Endpoint§claimed_model: Option<String>

The model the vendor claims to serve, when it differs from the id being requested. Defaults to endpoint.model.

§depth: Depth§lang: Lang§selection: Selection§seed: Option<u64>

None draws one from the clock — see [Rng::from_seed] for why an embedder should choose its own instead.

§http: Option<Client>

Reuse the caller’s HTTP client. See Client::with_http.

§pace: Option<Pace>

Spread the run out instead of issuing it as a burst. See Pace.

§concurrency: usize

Overlap the steps instead of running them one at a time. See RunConfig::concurrency.

§max_in_flight: usize

Requests this run may have in flight at once, whatever the schedule. See RunConfig::max_in_flight.

Implementations§

Source§

impl RunConfig

Source

pub fn new(endpoint: Endpoint) -> Self

Source

pub fn model_only(self) -> Self

Probe only what survives a relay — see probes::Subject.

Source

pub fn turbo(self, in_flight: usize) -> Self

The cheapest run that still supports a verdict about the model.

Selection::turbo with the steps overlapped and the traffic capped. Twelve requests at Depth::Fast, in roughly four round trips instead of twenty-one, which is the difference between a run somebody can watch finish and one they give up on.

in_flight is the only number here worth thinking about, and it is a statement about the endpoint rather than about this crate: how many simultaneous requests it will answer without queueing or refusing. Set it too high and the run measures the endpoint’s saturation instead of its behaviour — and, on anything with a per-account concurrency budget, spends that budget on being examined. When in doubt, three.

Source

pub fn concurrency(self, n: usize) -> Self

How many steps may be in flight at once. 1 is sequential, the default, and what every release before 0.5.0 did.

Ignored while a Pace is set: pacing exists to make a run hard to pick out of ordinary traffic, and overlapping exists to compress it into the smallest possible burst. A caller asking for both is asking to be unobtrusive quickly, and pacing wins.

Steps marked exclusive still run alone — preflight because everything after it depends on its answer, perf because a latency measurement taken alongside this run’s own traffic measures this run.

Source

pub fn max_in_flight(self, n: usize) -> Self

Cap the requests in flight, independently of how many steps are.

Steps are uneven — the capability battery is a dozen requests and stop_sequence is one — so a step count does not bound what the endpoint sees. This does. 0 leaves it uncapped.

Source

pub fn depth(self, d: Depth) -> Self

Source

pub fn lang(self, l: Lang) -> Self

Source

pub fn seed(self, s: u64) -> Self

Source

pub fn claimed_model(self, m: impl Into<String>) -> Self

Source

pub fn http(self, c: Client) -> Self

Source

pub fn pace(self, min: Duration, max: Duration) -> Self

Wait a random interval between steps — see Pace.

Trait Implementations§

Source§

impl Clone for RunConfig

Source§

fn clone(&self) -> RunConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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