Skip to main content

Module tui_load

Module tui_load 

Source
Expand description

TUI Load Testing (Framework-Agnostic Performance Testing)

Test TUI performance with large datasets, hang detection, and frame timing. Works with any TUI framework (presentar-terminal, crossterm, etc.). TUI Load Testing Module

Framework-agnostic load testing for terminal user interfaces. Works with any TUI framework (presentar-terminal, crossterm, etc.).

§Key Features

  • Framework Agnostic: Uses callbacks/closures, not tied to any TUI library
  • Data Generation: Generate realistic data volumes (1000+ items)
  • Frame Timing: Measure render time per frame
  • Hang Detection: Timeout-based hang detection with detailed diagnostics
  • Filter/Search Testing: Test filter performance with large datasets

§Toyota Way Application

  • Jidoka: Automatic hang detection stops tests before infinite loops
  • Muda: Eliminate wasted time from slow filter implementations
  • Genchi Genbutsu: Measure actual render times, not theoretical

§Example

use jugar_probar::tui_load::{TuiLoadTest, DataGenerator, TuiFrameMetrics};

// Create load test with 5000 synthetic processes
let mut load_test = TuiLoadTest::new()
    .with_item_count(5000)
    .with_frame_budget_ms(16)  // 60 FPS target
    .with_timeout_ms(1000);     // 1 second hang detection

// Run test with your render function
let result = load_test.run(|items, filter| {
    // Your TUI render logic here
    // Returns frame time in microseconds
    render_process_list(items, filter)
});

assert!(result.is_ok(), "TUI should not hang");
assert!(result.unwrap().p95_frame_ms < 16.0, "Should maintain 60 FPS");

Structs§

ComponentTimings
Component timing results from a frame render
DataGenerator
Data generator for synthetic load test data
IntegrationLoadTest
Integration load test that measures real application frame times.
SyntheticItem
A synthetic item for load testing (framework-agnostic)
TuiFrameMetrics
Metrics collected during TUI load testing
TuiLoadAssertion
Assertion helpers for TUI load test results
TuiLoadConfig
Configuration for TUI load testing
TuiLoadTest
TUI Load Test Runner

Enums§

TuiLoadError
Errors that can occur during TUI load testing

Type Aliases§

TuiLoadResult
Result type for TUI load tests