From 2b8ad4ad2d95e012a1124aa21d567a388cb139ea Mon Sep 17 00:00:00 2001 From: David Peter Date: Wed, 1 Jan 2025 23:00:22 +0100 Subject: [PATCH] Rename to exit_code --- Cargo.lock | 7 ------- Cargo.toml | 1 - src/benchmark/measurement.rs | 2 +- src/benchmark/scheduler.rs | 32 ++++++++++++++++---------------- 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa00f6340..b531e67c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -432,7 +432,6 @@ dependencies = [ "serde", "serde_json", "shell-words", - "static_assertions", "statistical", "tempfile", "thiserror", @@ -1033,12 +1032,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "statistical" version = "1.0.0" diff --git a/Cargo.toml b/Cargo.toml index f6890efcb..45c25b000 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,6 @@ rand = "0.8" shell-words = "1.0" thiserror = "2.0" anyhow = "1.0" -static_assertions = "1.1.0" [target.'cfg(not(windows))'.dependencies] libc = "0.2" diff --git a/src/benchmark/measurement.rs b/src/benchmark/measurement.rs index 4dbfc4a02..f59fd4aa5 100644 --- a/src/benchmark/measurement.rs +++ b/src/benchmark/measurement.rs @@ -32,7 +32,7 @@ pub struct Measurement { pub peak_memory_usage: Byte, // The exit status of the process - #[serde(serialize_with = "serialize_exit_status")] + #[serde(rename = "exit_code", serialize_with = "serialize_exit_status")] pub exit_status: ExitStatus, } diff --git a/src/benchmark/scheduler.rs b/src/benchmark/scheduler.rs index 42a9b7996..17b826475 100644 --- a/src/benchmark/scheduler.rs +++ b/src/benchmark/scheduler.rs @@ -190,27 +190,27 @@ fn scheduler_basic() -> Result<()> { insta::assert_yaml_snapshot!(generate_results(&["--runs=2", "sleep 0.123", "sleep 0.456"])?, @r#" - command: sleep 0.123 measurements: - - wall_clock_time: 0.123 - user_time: 0 - system_time: 0 - memory_usage_byte: 0 + - time_wall_clock: 0.123 + time_user: 0 + time_system: 0 + peak_memory_usage: 0 exit_code: 0 - - wall_clock_time: 0.123 - user_time: 0 - system_time: 0 - memory_usage_byte: 0 + - time_wall_clock: 0.123 + time_user: 0 + time_system: 0 + peak_memory_usage: 0 exit_code: 0 - command: sleep 0.456 measurements: - - wall_clock_time: 0.456 - user_time: 0 - system_time: 0 - memory_usage_byte: 0 + - time_wall_clock: 0.456 + time_user: 0 + time_system: 0 + peak_memory_usage: 0 exit_code: 0 - - wall_clock_time: 0.456 - user_time: 0 - system_time: 0 - memory_usage_byte: 0 + - time_wall_clock: 0.456 + time_user: 0 + time_system: 0 + peak_memory_usage: 0 exit_code: 0 "#);