@@ -10,7 +10,7 @@ use tonic::Response;
1010
1111use crate :: {
1212 proto:: {
13- common:: v1alpha8 :: {
13+ common:: {
1414 metrics:: {
1515 Metric , MetricSample , MetricValueVariant , SimpleMetricValue , metric_value_variant,
1616 } ,
@@ -22,7 +22,8 @@ use crate::{
2222 electrical_component_category_specific_info:: Kind ,
2323 } ,
2424 } ,
25- microgrid:: v1alpha18:: {
25+ google:: protobuf,
26+ microgrid:: {
2627 ListElectricalComponentConnectionsRequest , ListElectricalComponentConnectionsResponse ,
2728 ListElectricalComponentsRequest , ListElectricalComponentsResponse ,
2829 ReceiveElectricalComponentTelemetryStreamRequest ,
@@ -330,7 +331,12 @@ impl MicrogridApiClient for MockMicrogridApiClient {
330331 for metrics in metrics. iter ( ) {
331332 interval. tick ( ) . await ;
332333 next_ts += dur;
333- let ts = Some ( prost_types:: Timestamp :: from ( next_ts) ) ;
334+ let duration_since_epoch =
335+ next_ts. duration_since ( SystemTime :: UNIX_EPOCH ) . unwrap ( ) ;
336+ let ts = Some ( protobuf:: Timestamp {
337+ seconds : duration_since_epoch. as_secs ( ) as i64 ,
338+ nanos : duration_since_epoch. subsec_nanos ( ) as i32 ,
339+ } ) ;
334340 let mut metric_samples = vec ! [ ] ;
335341 if let Some ( power) = metrics. 0 {
336342 metric_samples. push ( MetricSample {
0 commit comments