diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-01-05 10:40:52 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-01-05 10:40:52 +0000 |
commit | b6c4e5e0301158ac821e876aa0255168ed4043dc (patch) | |
tree | dc8e1b2216c9bcd50a95623ab5dec32921757174 /src/result.rs | |
parent | d438cc0b64edf207ad565eede5c0ed829131a27b (diff) | |
parent | 6e9e7e7af213c9258bc4009e05bb9a3ba5d172b6 (diff) | |
download | obnam-benchmark-b6c4e5e0301158ac821e876aa0255168ed4043dc.tar.gz |
Merge branch 'output-file' into 'main'
feat: output file for run command
See merge request obnam/obnam-benchmark!7
Diffstat (limited to 'src/result.rs')
-rw-r--r-- | src/result.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/result.rs b/src/result.rs index 4a0277e..22a49a0 100644 --- a/src/result.rs +++ b/src/result.rs @@ -67,13 +67,21 @@ impl SuiteMeasurements { measurements: vec![], obnam_version, obnam_benchmark_version: render_testament!(TESTAMENT), - benchmark_started: Utc::now().to_string(), + benchmark_started: Utc::now().format("%Y-%m-%dT%H%M%S").to_string(), hostname: hostname.to_string(), host_ram: mem.mem_total, host_cpus: cpu.num_cores(), }) } + pub fn hostname(&self) -> &str { + &self.hostname + } + + pub fn timestamp(&self) -> &str { + &self.benchmark_started + } + pub fn push(&mut self, m: OpMeasurements) { self.measurements.push(m); } |