code_executor/metrics.rs
1use std::time::Duration;
2
3#[derive(Debug, PartialEq, Eq)]
4pub enum ExitStatus {
5 Success,
6 RuntimeError,
7 Timeout,
8}
9
10impl From<std::process::ExitStatus> for ExitStatus {
11 fn from(raw: std::process::ExitStatus) -> Self {
12 if raw.success() {
13 Self::Success
14 } else {
15 Self::RuntimeError
16 }
17 }
18}
19
20#[derive(Debug)]
21pub struct Metrics {
22 pub exit_status: ExitStatus,
23 pub run_time: Duration,
24 pub stdout: Vec<u8>,
25 pub stderr: Vec<u8>,
26}