Skip to content

Commit d4e32d1

Browse files
committed
refactor(walltime): rename PerfMetadata to WalltimeMetadata
Output filename also changes from perf.metadata to walltime.metadata. This is a wire-breaking change that requires a coordinated server rollout to read the new filename.
1 parent 7402bb5 commit d4e32d1

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

crates/runner-shared/src/metadata.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::module_symbols::MappedProcessModuleSymbols;
1212
use crate::unwind_data::MappedProcessUnwindData;
1313

1414
#[derive(Serialize, Deserialize, Default)]
15-
pub struct PerfMetadata {
15+
pub struct WalltimeMetadata {
1616
/// The version of this metadata format.
1717
pub version: u64,
1818

@@ -71,13 +71,13 @@ pub struct PerfMetadata {
7171
pub debug_info_by_pid: HashMap<pid_t, Vec<ModuleDebugInfo>>,
7272
}
7373

74-
impl PerfMetadata {
74+
impl WalltimeMetadata {
7575
pub fn from_reader<R: std::io::Read>(reader: R) -> anyhow::Result<Self> {
76-
serde_json::from_reader(reader).context("Could not parse perf metadata from JSON")
76+
serde_json::from_reader(reader).context("Could not parse walltime metadata from JSON")
7777
}
7878

7979
pub fn save_to<P: AsRef<Path>>(&self, path: P) -> anyhow::Result<()> {
80-
let file = std::fs::File::create(path.as_ref().join("perf.metadata"))?;
80+
let file = std::fs::File::create(path.as_ref().join("walltime.metadata"))?;
8181
const BUFFER_SIZE: usize = 256 * 1024 /* 256 KB */;
8282

8383
let writer = BufWriter::with_capacity(BUFFER_SIZE, file);

src/executor/wall_time/profiler/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
77
pub mod perf;
88

9+
const WALLTIME_METADATA_CURRENT_VERSION: u64 = 1;
10+
911
use crate::executor::ExecutorConfig;
1012
use crate::executor::ToolStatus;
1113
use crate::executor::helpers::command::CommandBuilder;

src/executor/wall_time/profiler/perf/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use crate::executor::helpers::run_with_sudo::run_with_sudo;
1212
use crate::executor::helpers::run_with_sudo::wrap_with_sudo;
1313
use crate::executor::shared::fifo::FifoBenchmarkData;
1414
use crate::executor::shared::fifo::RunnerFifo;
15+
use crate::executor::wall_time::profiler::WALLTIME_METADATA_CURRENT_VERSION;
1516
use crate::executor::wall_time::profiler::perf::perf_executable::get_working_perf_executable;
1617
use crate::prelude::*;
1718
use anyhow::Context;
@@ -23,7 +24,7 @@ use runner_shared::artifacts::ArtifactExt;
2324
use runner_shared::artifacts::ExecutionTimestamps;
2425
use runner_shared::fifo::Command as FifoCommand;
2526
use runner_shared::fifo::IntegrationMode;
26-
use runner_shared::metadata::PerfMetadata;
27+
use runner_shared::metadata::WalltimeMetadata;
2728
use std::path::Path;
2829
use std::path::PathBuf;
2930
use std::{cell::OnceCell, process::ExitStatus};
@@ -36,7 +37,6 @@ pub(crate) mod setup;
3637
pub mod fifo;
3738
pub mod perf_executable;
3839

39-
const PERF_METADATA_CURRENT_VERSION: u64 = 1;
4040
const PERF_PIPEDATA_FILE_NAME: &str = "perf.pipedata";
4141

4242
pub struct PerfRunner {
@@ -328,8 +328,8 @@ impl BenchmarkData {
328328

329329
debug!("Saving metadata");
330330
#[allow(deprecated)]
331-
let metadata = PerfMetadata {
332-
version: PERF_METADATA_CURRENT_VERSION,
331+
let metadata = WalltimeMetadata {
332+
version: WALLTIME_METADATA_CURRENT_VERSION,
333333
integration: self
334334
.fifo_data
335335
.integration

0 commit comments

Comments
 (0)