diff --git a/uplink/src/base/monitor/mod.rs b/uplink/src/base/monitor/mod.rs index d3bf75318..41612ab90 100644 --- a/uplink/src/base/monitor/mod.rs +++ b/uplink/src/base/monitor/mod.rs @@ -80,7 +80,9 @@ impl Monitor { continue; } serializer_stream_metrics.push(o); + dbg!(&serializer_stream_metrics); let v = serde_json::to_string(&serializer_stream_metrics).unwrap(); + dbg!(&v); serializer_stream_metrics.clear(); self.client.publish(&serializer_stream_metrics_topic, QoS::AtLeastOnce, false, v).await.unwrap(); } diff --git a/uplink/src/base/serializer/metrics.rs b/uplink/src/base/serializer/metrics.rs index 9b1f67a65..12eea18aa 100644 --- a/uplink/src/base/serializer/metrics.rs +++ b/uplink/src/base/serializer/metrics.rs @@ -1,7 +1,7 @@ use std::time::Duration; use serde::Serialize; -use serde_with::{serde_as, DurationSeconds}; +use serde_with::{serde_as, DurationSecondsWithFrac}; use crate::base::clock; @@ -113,15 +113,15 @@ pub struct StreamMetrics { pub compressed_data_size: usize, #[serde(skip)] pub serializations: u32, - #[serde_as(as = "DurationSeconds")] + #[serde_as(as = "DurationSecondsWithFrac")] pub total_serialization_time: Duration, - #[serde_as(as = "DurationSeconds")] + #[serde_as(as = "DurationSecondsWithFrac")] pub avg_serialization_time: Duration, #[serde(skip)] pub compressions: u32, - #[serde_as(as = "DurationSeconds")] + #[serde_as(as = "DurationSecondsWithFrac")] pub total_compression_time: Duration, - #[serde_as(as = "DurationSeconds")] + #[serde_as(as = "DurationSecondsWithFrac")] pub avg_compression_time: Duration, }