From 2c4d99a4586a8aa143feb8614e3b0d4de09dd190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Thu, 5 Sep 2024 10:51:40 +0200 Subject: feat: include version number in all --json based outputs (#25335) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- cli/tools/bench/reporters.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cli/tools/bench') diff --git a/cli/tools/bench/reporters.rs b/cli/tools/bench/reporters.rs index 250655be7..9aabd760b 100644 --- a/cli/tools/bench/reporters.rs +++ b/cli/tools/bench/reporters.rs @@ -18,8 +18,11 @@ pub trait BenchReporter { fn report_uncaught_error(&mut self, origin: &str, error: Box); } +const JSON_SCHEMA_VERSION: u8 = 1; + #[derive(Debug, Serialize)] struct JsonReporterOutput { + version: u8, runtime: String, cpu: String, benches: Vec, @@ -28,6 +31,7 @@ struct JsonReporterOutput { impl Default for JsonReporterOutput { fn default() -> Self { Self { + version: JSON_SCHEMA_VERSION, runtime: format!( "{} {}", version::DENO_VERSION_INFO.user_agent, -- cgit v1.2.3