oxidecomputer / omicron

Omicron: Oxide control plane
Mozilla Public License 2.0
251 stars 39 forks source link

NTP: Track statistics for external timesync #2310

Open bnaecker opened 1 year ago

bnaecker commented 1 year ago

Details TBD

jclulow commented 1 year ago

Assuming we end up with chrony, it has a variety of statistics one can fish out with chronyc:

$ chronyc tracking ; chronyc sources ; chronyc sourcestats
Reference ID    : D8E50032 (nu.binary.net)
Stratum         : 3
Ref time (UTC)  : Thu Feb 02 22:13:56 2023
System time     : 0.000294425 seconds slow of NTP time
Last offset     : -0.000083234 seconds
RMS offset      : 0.000176260 seconds
Frequency       : 23.373 ppm fast
Residual freq   : +0.007 ppm
Skew            : 0.053 ppm
Root delay      : 0.065539971 seconds
Root dispersion : 0.015596064 seconds
Update interval : 1038.6 seconds
Leap status     : Normal
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^+ gopher.fart.website           3   9   377   296   -315us[ -315us] +/-   66ms
^+ lithium.constant.com          2  10   377   566  -1588us[-1588us] +/-   61ms
^+ lax.clearnet.pw               3  10   377   463   -173us[ -173us] +/-   81ms
^* nu.binary.net                 2  10   377   750   -352us[ -436us] +/-   55ms
Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
==============================================================================
gopher.fart.website         6   4   42m     -0.237      0.088   -394us    21us
lithium.constant.com       19  13  309m     -0.023      0.137   -629us   900us
lax.clearnet.pw             9   8  137m     -0.128      0.138  -1221us   167us
nu.binary.net              10   7  155m     -0.166      0.062   -374us   123us

You can convince chronyc to output parseable CSV with -c, and there is ostensibly also a crate, chrony-candm, that can speak the protocol chronyd uses on its management socket, /var/run/chrony/chronyd.sock. I'm not sure if the protocol is actually Committed or not.