@@ -2,7 +2,7 @@ use dial9_trace_format::encoder::{Encoder, RawEncoder};
22
33use crate :: rate_limit:: rate_limited;
44use crate :: telemetry:: collector:: Batch ;
5- use crate :: telemetry:: events:: { clock_monotonic_ns , clock_pair} ;
5+ use crate :: telemetry:: events:: clock_pair;
66use crate :: telemetry:: format:: { ClockSyncEvent , SegmentMetadataEvent } ;
77use std:: collections:: VecDeque ;
88use std:: fs:: { self , File } ;
@@ -277,11 +277,11 @@ impl RotatingWriter {
277277 ) -> std:: io:: Result < RawEncoder < BufWriter < File > > > {
278278 let mut encoder = Encoder :: new_to ( writer) ?;
279279 let entries = segment_metadata. to_vec ( ) ;
280+ let ( mono, real) = clock_pair ( ) ;
280281 encoder. write ( & SegmentMetadataEvent {
281- timestamp_ns : clock_monotonic_ns ( ) ,
282+ timestamp_ns : mono ,
282283 entries,
283284 } ) ?;
284- let ( mono, real) = clock_pair ( ) ;
285285 encoder. write ( & ClockSyncEvent {
286286 timestamp_ns : mono,
287287 realtime_ns : real,
@@ -297,11 +297,11 @@ impl RotatingWriter {
297297 } ;
298298 let entries = self . segment_metadata . clone ( ) ;
299299 let mut enc = Encoder :: new ( ) ;
300+ let ( mono, real) = clock_pair ( ) ;
300301 enc. write ( & SegmentMetadataEvent {
301- timestamp_ns : clock_monotonic_ns ( ) ,
302+ timestamp_ns : mono ,
302303 entries,
303304 } ) ?;
304- let ( mono, real) = clock_pair ( ) ;
305305 enc. write ( & ClockSyncEvent {
306306 timestamp_ns : mono,
307307 realtime_ns : real,
0 commit comments