trippy_tui/
report.rs

1use anyhow::anyhow;
2use trippy_core::State;
3use trippy_core::Tracer;
4
5pub mod csv;
6pub mod dot;
7pub mod flows;
8pub mod json;
9pub mod silent;
10pub mod stream;
11pub mod table;
12mod types;
13
14/// Block until trace data for round `round` is available.
15fn wait_for_round(trace_data: &Tracer, report_cycles: usize) -> anyhow::Result<State> {
16    let mut trace = trace_data.snapshot();
17    while trace.round(State::default_flow_id()).is_none()
18        || trace.round(State::default_flow_id()) < Some(report_cycles - 1)
19    {
20        trace = trace_data.snapshot();
21        if let Some(err) = trace.error() {
22            return Err(anyhow!("error: {}", err));
23        }
24    }
25    Ok(trace)
26}