pub struct IntegrationLoadTest { /* private fields */ }Expand description
Integration load test that measures real application frame times.
Unlike synthetic load tests, this tests the ACTUAL application with real collectors, real system calls, and real data. It catches issues like blocking I/O, slow system calls, and expensive operations.
§Example
ⓘ
use jugar_probar::tui_load::IntegrationLoadTest;
// Test that real app renders frames under 100ms
let test = IntegrationLoadTest::new()
.with_frame_budget_ms(100.0)
.with_timeout_ms(5000)
.with_frame_count(10);
let result = test.run(|| {
// Your real app initialization and render
let mut app = App::new();
app.collect_metrics();
// Simulate frame render...
});
assert!(result.is_ok(), "Real app should not hang");Implementations§
Source§impl IntegrationLoadTest
impl IntegrationLoadTest
Sourcepub fn with_frame_budget_ms(self, budget: f64) -> Self
pub fn with_frame_budget_ms(self, budget: f64) -> Self
Set frame budget
Sourcepub fn with_timeout_ms(self, timeout: u64) -> Self
pub fn with_timeout_ms(self, timeout: u64) -> Self
Set timeout for hang detection
Sourcepub fn with_frame_count(self, count: usize) -> Self
pub fn with_frame_count(self, count: usize) -> Self
Set number of frames to test
Sourcepub fn with_component_budget(self, name: &str, max_ms: f64) -> Self
pub fn with_component_budget(self, name: &str, max_ms: f64) -> Self
Add component budget (e.g., “container_analyzer” -> 100ms max)
Sourcepub fn run<F>(&self, frame_fn: F) -> TuiLoadResult<TuiFrameMetrics>where
F: FnMut() -> ComponentTimings,
pub fn run<F>(&self, frame_fn: F) -> TuiLoadResult<TuiFrameMetrics>where
F: FnMut() -> ComponentTimings,
Run integration test with a closure that performs one frame
The closure should:
- Initialize app (first call only)
- Collect metrics
- Render frame
Returns timing for each frame.
Trait Implementations§
Source§impl Clone for IntegrationLoadTest
impl Clone for IntegrationLoadTest
Source§fn clone(&self) -> IntegrationLoadTest
fn clone(&self) -> IntegrationLoadTest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IntegrationLoadTest
impl Debug for IntegrationLoadTest
Auto Trait Implementations§
impl Freeze for IntegrationLoadTest
impl RefUnwindSafe for IntegrationLoadTest
impl Send for IntegrationLoadTest
impl Sync for IntegrationLoadTest
impl Unpin for IntegrationLoadTest
impl UnsafeUnpin for IntegrationLoadTest
impl UnwindSafe for IntegrationLoadTest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more