Skip to main content

TuiLoadTest

Struct TuiLoadTest 

Source
pub struct TuiLoadTest { /* private fields */ }
Expand description

TUI Load Test Runner

Framework-agnostic load testing for TUI applications.

Implementations§

Source§

impl TuiLoadTest

Source

pub fn new() -> Self

Create a new TUI load test with default configuration

Source

pub fn with_item_count(self, count: usize) -> Self

Create with specific item count

Source

pub fn with_frame_budget_ms(self, budget_ms: f64) -> Self

Set frame budget in milliseconds

Source

pub fn with_timeout_ms(self, timeout_ms: u64) -> Self

Set timeout for hang detection

Source

pub fn with_filters(self, filters: Vec<String>) -> Self

Set filters to test

Source

pub fn with_frames_per_filter(self, count: usize) -> Self

Set number of frames per filter

Source

pub fn with_strict_budget(self, strict: bool) -> Self

Enable strict budget enforcement

Source

pub fn data(&self) -> &[SyntheticItem]

Get the generated test data

Source

pub fn config(&self) -> &TuiLoadConfig

Get configuration

Source

pub fn run<F>(&self, render: F) -> TuiLoadResult<TuiFrameMetrics>
where F: FnMut(&[SyntheticItem], &str) -> Option<u64>,

Run load test with a render callback

The callback receives:

  • items: Slice of synthetic items to render
  • filter: Current filter string

The callback should perform the actual TUI rendering and return the frame time in microseconds, or None if it wants the test harness to measure time.

§Errors

Returns error if a frame times out (hang detected) or exceeds budget in strict mode.

Source

pub fn run_filter_stress<F>( &self, filter_fn: F, ) -> TuiLoadResult<Vec<(String, TuiFrameMetrics)>>

Run filter-specific performance test

Tests filtering with increasing filter lengths to detect O(n²) or worse complexity in filter implementations.

§Errors

Returns error if hang detected or budget exceeded.

Trait Implementations§

Source§

impl Debug for TuiLoadTest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TuiLoadTest

Source§

fn default() -> Self

Returns the “default value” for a type. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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.