WIP: amari.xlog: Approximate utc timestamp
Older versions of lteenb do not implement .utc field in remote API reponses, only .time which is relative to the start of the process. For such versions, inject an approximation of .utc into each logged message.
Without this the KPI computation from enb.xlog
fails because .utc is missing. Also, it is generally useful to know when each message was logged, e.g. to implement promises on lteenb statistics using enb.xlog
.
Approximation method
We take utc0 = time.now()
as an approximation of the .utc time when receiving the first message after (re)connecting, and then for each subsequent message we compute utc = utc0 - time0 + time
.
Quick empirical comparisons with the actual .utc field seem to show this is more precise than finding out the creation time of lteenb process and computing utc = utc_start + time
, by one order of magnitude: the first seems precise to 0.1s, while the second may be off by up to 1s.
Both methods preserve the relative time interval between each message, as given by the .time field.
Correlation with enb.log
Currently, only the E-RAB Accessibility KPI is implemented, and it relies only on enb.xlog
. So the approximation doesn't matter since the relative time intervals between messages are preserved.
However, other KPIs will require correlating events between enb.log
and enb.xlog
, for which end the .utc field would be used. It is hoped that the approximation might be good enough to produce reasonable results for such KPIs.