From 88c36fd4140f65c2133c9b5836bc807a6c22b35a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 11 Jul 2022 20:58:32 +0200 Subject: benchmarks: fix exec_time and latency benchmarks (#15155) --- cli/bench/metrics.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'cli/bench/metrics.rs') diff --git a/cli/bench/metrics.rs b/cli/bench/metrics.rs index c49ca9020..964fdde4b 100644 --- a/cli/bench/metrics.rs +++ b/cli/bench/metrics.rs @@ -17,9 +17,9 @@ static GIT_HASH: Lazy = Lazy::new(|| { }); #[derive(serde::Serialize)] -struct Metric { +struct Metric { name: String, - value: i64, + value: T, sha1: String, #[serde(rename = "type")] type_: String, @@ -62,7 +62,12 @@ impl Reporter { } } - pub fn write_one(&mut self, type_: &str, name: &str, value: i64) { + pub fn write_one( + &mut self, + type_: &str, + name: &str, + value: T, + ) { self .wtr .serialize(Metric { @@ -75,7 +80,11 @@ impl Reporter { .unwrap(); } - pub fn write(&mut self, type_: &str, hashmap: &HashMap) { + pub fn write( + &mut self, + type_: &str, + hashmap: &HashMap, + ) { for (name, value) in hashmap { self.write_one(type_, name, *value); } -- cgit v1.2.3