From 6b96ec9805ca07bdb6cc78759797a9d57ee997bd Mon Sep 17 00:00:00 2001 From: dakota Date: Fri, 20 Mar 2026 16:55:57 -0700 Subject: [PATCH] [HR-148] add subvalue by timestamp to CLI --- src/client/models/simulation.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/client/models/simulation.rs b/src/client/models/simulation.rs index fe3be29..08e6918 100644 --- a/src/client/models/simulation.rs +++ b/src/client/models/simulation.rs @@ -119,6 +119,21 @@ fn truncate(s: &str, max: usize) -> String { } } +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct SubvalueByTimestamp { + pub start_offset: f64, + pub end_offset: f64, + pub output_type: String, + #[serde(default)] + pub float_value: f64, + #[serde(default)] + pub string_value: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub role: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub message_index: Option, +} + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct SimpleMetricOutput { pub metric_output_id: String, @@ -127,6 +142,8 @@ pub struct SimpleMetricOutput { pub status: Option, #[serde(default)] pub value: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subvalues_by_timestamp: Option>, } #[derive(Debug, Deserialize)] @@ -141,7 +158,7 @@ pub struct GetSimulationMetricResponse { impl Tabular for SimpleMetricOutput { fn headers() -> Vec<&'static str> { - vec!["OUTPUT ID", "METRIC ID", "STATUS", "VALUE"] + vec!["OUTPUT ID", "METRIC ID", "STATUS", "VALUE", "SUBVALUES"] } fn row(&self) -> Vec { @@ -153,6 +170,10 @@ impl Tabular for SimpleMetricOutput { .as_ref() .map(|v| truncate(&v.to_string(), 30)) .unwrap_or_else(|| "-".into()), + self.subvalues_by_timestamp + .as_ref() + .map(|sv| format!("{}", sv.len())) + .unwrap_or_else(|| "-".into()), ] } }