vor 0.2.1

Cross-platform performance instrumentation with an in-app egui panel and live system and GPU metrics.
Documentation
//! Replay a `.vor` capture in a window: the live panel, fed from a
//! recorded stream instead of in-process sampling.
//!
//! Record one in another terminal (see examples/headless.rs), then:
//!
//!   cargo run --example replay --features viz,mac -- /tmp/run.vor
//!
//! With `follow` on (default) it tails a growing file, so you can watch
//! a job live; once the file stops growing it is a post-mortem of the
//! last few hundred frames. Click a bar to pause and inspect; if the
//! run captured flame frames, the pinned step's flame chart fills in.

use eframe::egui;
use vor::viz::ReplayState;

struct App {
    state: ReplayState,
}

impl eframe::App for App {
    fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
        self.state.show(ui);
        // Keep tailing + interactions responsive.
        ui.ctx().request_repaint();
    }
}

fn main() -> eframe::Result {
    env_logger::init();
    let path = std::env::args()
        .nth(1)
        .unwrap_or_else(|| panic!("usage: replay <capture.vor>"));
    let state = ReplayState::open(&path).unwrap_or_else(|e| panic!("open {path}: {e}"));

    let options = eframe::NativeOptions {
        viewport: egui::ViewportBuilder::default()
            .with_title("vor replay")
            .with_inner_size([960.0, 720.0])
            .with_active(true),
        ..Default::default()
    };
    eframe::run_native("vor replay", options, Box::new(|_cc| Ok(Box::new(App { state }))))
}