use super::*;
use tempfile::TempDir;
#[test]
#[ignore = "release-mode session snapshot measurement; run with --release --ignored --nocapture"]
fn session_snapshot_size_measurement() {
let temp = TempDir::new().unwrap();
for size in [64 * 1024usize, 32 * 1024 * 1024, 128 * 1024 * 1024] {
let path = temp.path().join(format!("snapshot-{size}.jsonl"));
fs::write(&path, vec![b'x'; size]).unwrap();
crate::sessions::store::profiling_support::secure_profiling_session_root(temp.path());
let started = std::time::Instant::now();
let snapshot = capture_session_snapshot(&path).unwrap().unwrap();
eprintln!(
"session_snapshot file_bytes={} bytes_read={} elapsed_us={}",
size,
snapshot.prefix.len() as u64
+ if snapshot.identity.is_none() {
snapshot.len
} else {
0
},
started.elapsed().as_micros()
);
}
}