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§
- Component
Timings - Component timing results from a frame render
- Data
Generator - Data generator for synthetic load test data
- Integration
Load Test - Integration load test that measures real application frame times.
- Synthetic
Item - A synthetic item for load testing (framework-agnostic)
- TuiFrame
Metrics - Metrics collected during TUI load testing
- TuiLoad
Assertion - Assertion helpers for TUI load test results
- TuiLoad
Config - Configuration for TUI load testing
- TuiLoad
Test - TUI Load Test Runner
Enums§
- TuiLoad
Error - Errors that can occur during TUI load testing
Type Aliases§
- TuiLoad
Result - Result type for TUI load tests