• Kirill Smelkov's avatar
    amari.xlog: attach,sync += information about on-service time · 0c772eb4
    Kirill Smelkov authored
    We currently emit information about local time in events, and
    information about on-service time in messages. Events don't have
    information about on-service time and messages don't carry information
    about local time. That is mostly ok, since primary xlog setup is to run
    on the same machine, where eNB runs because on-service .utc correlates
    with .time in events.
    
    However for eNB < 2022-12-01 on-service time includes only .time field
    without .utc field with .time representing "time passed since when eNB
    was started". This way for enb.xlog streams generated on older systems
    it is not possible for xlog.Reader to know the absolute timestamps of
    read messages.
    
    To fix this we amend "attach" and "sync" events to carry both local and
    on-service times. This way xlog.Reader, after seeing e.g. "sync" with
    .time and only .srv_time without .srv_utc, should be able to
    correlate local and on-service clocks and to approximate srv_utc as
    
    	srv_utc' = srv_time' + (time - srv_time)
    
    where time and srv_time correspond to last synchronization, and
    srv_time' is what xlog.Reader retrieves for a further-read message in
    question.
    
    See !3 for related discussion.
    0c772eb4
xlog_test.py 11.4 KB