pub struct ExternalRunner { /* private fields */ }Expand description
Runs external framework benchmarks as subprocesses.
Injects BENCH_START_EPOCH_NS into the subprocess environment,
passes the workload JSON path as the last argument, and parses
the EBP JSON output from stdout.
§Example
use adk_bench::ExternalRunner;
let runner = ExternalRunner::new(300);
assert_eq!(runner.timeout(), std::time::Duration::from_secs(300));Implementations§
Source§impl ExternalRunner
impl ExternalRunner
Sourcepub fn new(timeout_secs: u64) -> Self
pub fn new(timeout_secs: u64) -> Self
Creates a new ExternalRunner with the specified timeout in seconds.
Sourcepub async fn run(
&self,
config: &ExternalFrameworkConfig,
workload_path: &str,
) -> Result<ExternalMetricsOutput>
pub async fn run( &self, config: &ExternalFrameworkConfig, workload_path: &str, ) -> Result<ExternalMetricsOutput>
Executes the external framework and parses its EBP JSON output.
The subprocess receives:
BENCH_START_EPOCH_NSenv var (monotonic clock nanosecond timestamp at spawn time)- Workload JSON file path as the last CLI argument
Returns error if subprocess times out, exits non-zero, or emits invalid JSON.
§Errors
- [
BenchError::ExternalTimeout] if the subprocess exceeds the configured timeout - [
BenchError::ExternalRunner] if the subprocess exits with non-zero status or emits invalid JSON
Auto Trait Implementations§
impl Freeze for ExternalRunner
impl RefUnwindSafe for ExternalRunner
impl Send for ExternalRunner
impl Sync for ExternalRunner
impl Unpin for ExternalRunner
impl UnsafeUnpin for ExternalRunner
impl UnwindSafe for ExternalRunner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more