Skip to content

Commit 5f26578

Browse files
committed
fixup! feat: expose a collection entrypoint usable within walltime integrations
1 parent 59d80f9 commit 5f26578

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

crates/codspeed/src/walltime.rs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,26 @@ pub struct RawWallTimeData {
1616
#[serde(flatten)]
1717
pub metadata: BenchmarkMetadata,
1818
pub iter_per_round: u32,
19-
pub times_ps: Vec<u128>,
19+
pub min_time_ns: Option<u128>,
20+
pub max_time_ns: Option<u128>,
21+
pub times_ns: Vec<u128>,
2022
}
2123

2224
impl RawWallTimeData {
2325
fn from_runtime_data(
2426
name: String,
2527
uri: String,
2628
iter_per_round: u32,
27-
times_ps: Vec<u128>,
29+
min_time_ns: Option<u128>,
30+
max_time_ns: Option<u128>,
31+
times_ns: Vec<u128>,
2832
) -> Self {
2933
RawWallTimeData {
3034
metadata: BenchmarkMetadata { name, uri },
3135
iter_per_round,
32-
times_ps,
36+
min_time_ns,
37+
max_time_ns,
38+
times_ns,
3339
}
3440
}
3541

@@ -54,13 +60,21 @@ pub fn collect_raw_walltime_results(
5460
name: String,
5561
uri: String,
5662
iter_per_round: u32,
57-
times_ps: Vec<u128>,
63+
max_time_ns: Option<u128>,
64+
times_ns: Vec<u128>,
5865
) {
5966
let workspace_root = std::env::var("CODSPEED_CARGO_WORKSPACE_ROOT").map(PathBuf::from);
6067
let Ok(workspace_root) = workspace_root else {
6168
eprintln!("codspeed failed to get workspace root. skipping");
6269
return;
6370
};
64-
let data = RawWallTimeData::from_runtime_data(name, uri, iter_per_round, times_ps);
71+
let data = RawWallTimeData::from_runtime_data(
72+
name,
73+
uri,
74+
iter_per_round,
75+
min_time_ns,
76+
max_time_ns,
77+
times_ns,
78+
);
6579
data.dump_to_results(&workspace_root, scope);
6680
}

0 commit comments

Comments
 (0)