diff options
author | Kamil Ogórek <kamil.ogorek@gmail.com> | 2024-09-05 10:51:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-05 08:51:40 +0000 |
commit | 2c4d99a4586a8aa143feb8614e3b0d4de09dd190 (patch) | |
tree | 0c07ee12254da10d9710616be8cc98a32c0f35c7 /cli/tools/bench | |
parent | 49340b96f6b3603186e03f0102b99bc4a34a1b63 (diff) |
feat: include version number in all --json based outputs (#25335)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/tools/bench')
-rw-r--r-- | cli/tools/bench/reporters.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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<JsError>); } +const JSON_SCHEMA_VERSION: u8 = 1; + #[derive(Debug, Serialize)] struct JsonReporterOutput { + version: u8, runtime: String, cpu: String, benches: Vec<JsonReporterBench>, @@ -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, |