@@ -38,7 +38,7 @@ impl From<protocol::MetricLabel> for proto::MetricLabel {
3838 protocol:: MetricLabel :: PublisherRtt => Self :: PublisherRtt ,
3939 protocol:: MetricLabel :: ServerMeshRtt => Self :: ServerMeshRtt ,
4040 protocol:: MetricLabel :: SubscriberRtt => Self :: SubscriberRtt ,
41- protocol:: MetricLabel :: PredefinedMaxValue => Self :: MetricLabelPredefinedMaxValue ,
41+ protocol:: MetricLabel :: PredefinedMaxValue => Self :: PredefinedMaxValue ,
4242 }
4343 }
4444}
@@ -47,7 +47,7 @@ impl From<protocol::MetricSample> for proto::MetricSample {
4747 fn from ( value : protocol:: MetricSample ) -> Self {
4848 Self {
4949 timestamp_ms : value. timestamp_ms ,
50- normalized_timestamp : value. normalized_timestamp . map ( Into :: into ) ,
50+ normalized_timestamp : value. normalized_timestamp ,
5151 value : value. value ,
5252 }
5353 }
@@ -73,8 +73,8 @@ impl From<protocol::EventMetric> for proto::EventMetric {
7373 track_sid : value. track_sid ,
7474 start_timestamp_ms : value. start_timestamp_ms ,
7575 end_timestamp_ms : value. end_timestamp_ms ,
76- normalized_start_timestamp : value. normalized_start_timestamp . map ( Into :: into ) ,
77- normalized_end_timestamp : value. normalized_end_timestamp . map ( Into :: into ) ,
76+ normalized_start_timestamp : value. normalized_start_timestamp ,
77+ normalized_end_timestamp : value. normalized_end_timestamp ,
7878 metadata : value. metadata ,
7979 rid : value. rid ,
8080 }
@@ -85,7 +85,57 @@ impl From<protocol::MetricsBatch> for proto::MetricsBatch {
8585 fn from ( value : protocol:: MetricsBatch ) -> Self {
8686 Self {
8787 timestamp_ms : value. timestamp_ms ,
88- normalized_timestamp : value. normalized_timestamp . map ( Into :: into) ,
88+ normalized_timestamp : value. normalized_timestamp ,
89+ str_data : value. str_data ,
90+ time_series : value. time_series . into_iter ( ) . map ( Into :: into) . collect ( ) ,
91+ events : value. events . into_iter ( ) . map ( Into :: into) . collect ( ) ,
92+ }
93+ }
94+ }
95+
96+ impl From < proto:: TimeSeriesMetric > for protocol:: TimeSeriesMetric {
97+ fn from ( value : proto:: TimeSeriesMetric ) -> Self {
98+ Self {
99+ label : value. label ,
100+ participant_identity : value. participant_identity ,
101+ track_sid : value. track_sid ,
102+ samples : value. samples . into_iter ( ) . map ( Into :: into) . collect ( ) ,
103+ rid : value. rid ,
104+ }
105+ }
106+ }
107+
108+ impl From < proto:: MetricSample > for protocol:: MetricSample {
109+ fn from ( value : proto:: MetricSample ) -> Self {
110+ Self {
111+ timestamp_ms : value. timestamp_ms ,
112+ normalized_timestamp : value. normalized_timestamp ,
113+ value : value. value ,
114+ }
115+ }
116+ }
117+
118+ impl From < proto:: EventMetric > for protocol:: EventMetric {
119+ fn from ( value : proto:: EventMetric ) -> Self {
120+ Self {
121+ label : value. label ,
122+ participant_identity : value. participant_identity ,
123+ track_sid : value. track_sid ,
124+ start_timestamp_ms : value. start_timestamp_ms ,
125+ end_timestamp_ms : value. end_timestamp_ms ,
126+ normalized_start_timestamp : value. normalized_start_timestamp ,
127+ normalized_end_timestamp : value. normalized_end_timestamp ,
128+ metadata : value. metadata ,
129+ rid : value. rid ,
130+ }
131+ }
132+ }
133+
134+ impl From < proto:: MetricsBatch > for protocol:: MetricsBatch {
135+ fn from ( value : proto:: MetricsBatch ) -> Self {
136+ Self {
137+ timestamp_ms : value. timestamp_ms ,
138+ normalized_timestamp : value. normalized_timestamp ,
89139 str_data : value. str_data ,
90140 time_series : value. time_series . into_iter ( ) . map ( Into :: into) . collect ( ) ,
91141 events : value. events . into_iter ( ) . map ( Into :: into) . collect ( ) ,
0 commit comments