1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! `tricord` — scan a process tree's wall time, CPU time, peak memory, and
//! disk I/O, then write the result in
//! [Snakemake's `benchmark:` directive][snakemake-benchmark] TSV format
//! (or, optionally, JSON). The companion binary is named `tricorder`.
//!
//! The library exposes the same components the binary uses, so you can embed
//! the sampler in another Rust tool when the CLI shape doesn't fit (for
//! example: pipeline coordinators that already manage their own subprocesses
//! and just need the resource numbers).
//!
//! [snakemake-benchmark]: https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#benchmark-rules
//!
//! # Quick start
//! ```no_run
//! use std::time::Duration;
//! use tricord::{
//! run::{run_command, RunOptions},
//! format::OutputFormat,
//! };
//!
//! let options = RunOptions {
//! interval: Duration::from_millis(500),
//! output_path: std::path::Path::new("/tmp/timing.tsv").into(),
//! format: OutputFormat::Tsv,
//! force_summary: false,
//! trace_path: None,
//! };
//! let outcome = run_command("echo", &["hello".to_string()], &options).unwrap();
//! assert_eq!(outcome.exit_code(), 0);
//! ```
// `cli` is re-exported as `pub` because the `tricorder` binary's `main.rs`
// (a separate compilation target) uses `tricord::cli::Args` to parse its
// flags. Library consumers won't normally need it.
// Internal modules — implementation detail of `run_command` / the sampler.
pub
pub
pub
pub use OutputFormat;
pub use ;
pub use ;