pub fn try_init_from_env(
default_path: &str,
) -> Result<BenchInit, BenchInitError>Expand description
Initializes a gating benchmark session from environment variables.
Disabled collection is not an error. When enabled, the returned session must remain alive for the application run and must be explicitly finished so write, flush, sync, and publication errors remain observable.
The queue capacity comes from the modern/legacy/historical capacity variable;
invalid or zero values fall back to 4096. default_path is used only when
no nonempty path override exists.
§Errors
Propagates session path, metadata, writer startup, and global-install errors when collection is enabled.
§Panics
Panics only if the fixed fallback queue-capacity constant is changed to zero.
§Examples
use ailloli_ui_bench::try_init_from_env;
fn init() -> Result<(), Box<dyn std::error::Error>> {
let init = try_init_from_env("artifacts/bench/run.jsonl")?;
let _completed = init.finish()?;
Ok(())
}