(output_dir: &Path, metadata: &VisualizerMetadata)
| 917 | } |
| 918 | |
| 919 | fn write_metadata_atomically(output_dir: &Path, metadata: &VisualizerMetadata) -> Result<()> { |
| 920 | let destination = output_dir.join("metadata.json"); |
| 921 | let temporary = output_dir.join(format!(".metadata.json.{}.tmp", std::process::id())); |
| 922 | fs::write(&temporary, serde_json::to_vec_pretty(metadata)?).wrap_err_with(|| { |
| 923 | format!("failed to write aggregate metadata temporary file {}", temporary.display()) |
| 924 | })?; |
| 925 | fs::rename(&temporary, &destination).wrap_err_with(|| { |
| 926 | format!("failed to replace aggregate metadata {}", destination.display()) |
| 927 | })?; |
| 928 | println!( |
| 929 | "aggregated {} selected benchmark run(s): {}", |
| 930 | metadata.runs.len(), |
| 931 | destination.display() |
| 932 | ); |
| 933 | Ok(()) |
| 934 | } |
| 935 | } |
| 936 | |
| 937 | impl SnapshotBenchmarkArgs { |
nothing calls this directly
no outgoing calls
no test coverage detected