mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-02 09:01:25 +00:00
Store parameter usage metadata in benchmark results
This commit is contained in:
1 parent
29a0ef164d
commit
8c40de45f8
3 files changed
+50
-8
No files matched your search
@@ -2,6 +2,15 @@ use std::collections::BTreeMap;
|
||||
|
||||
use serde::Serialize;
|
||||
|
||||
/// Parameter value and whether it was used in the command line template
|
||||
#[derive(Debug, Default, Clone, Serialize, PartialEq)]
|
||||
#[serde(transparent)]
|
||||
pub struct Parameter {
|
||||
pub value: String,
|
||||
#[serde(skip)]
|
||||
pub is_unused: bool,
|
||||
}
|
||||
|
||||
/// Set of values that will be exported.
|
||||
// NOTE: `serde` is used for JSON serialization, but not for CSV serialization due to the
|
||||
// `parameters` map. Update `src/hyperfine/export/csv.rs` with new fields, as appropriate.
|
||||
@@ -49,5 +58,5 @@ pub struct BenchmarkResult {
|
||||
|
||||
/// Parameter values for this benchmark
|
||||
#[serde(skip_serializing_if = "BTreeMap::is_empty")]
|
||||
pub parameters: BTreeMap<String, String>,
|
||||
pub parameters: BTreeMap<String, Parameter>,
|
||||
}
|
||||
Reference in new issue
Block a user