Skip to content

ntpstats.polladvice

Poll-interval advice: the longest interval between measurements that meets an accuracy target.

A client that polls every T seconds runs, between polls, on the phase and frequency it estimated from the polls so far. Its error just before the next poll is the time-interval error of a holdover of length T that starts from an estimate made with measurements T apart. For each candidate interval (the log's own interval times 1, 2, 4, ...) the log is decimated to that interval and the holdover model of :mod:ntpstats.holdover predicts that error, including the uncertainty of the fitted frequency and of the noise model. Decimating makes the fewer measurements of a long interval count against it.

The answer is as good as the log: it should cover the conditions the client will see (time of day, temperature, network load), and an interval is only offered when the decimated log still has min_samples measurements.

poll_advice(series, target=None, ci=0.95, model='frequency', min_samples=32, max_interval=None, uncertainty=20)

Predicted error versus poll interval for the clock and path of series (offsets, reference - local).

target (s) selects the longest candidate interval whose ci bound is within it. model is what the clock applies between polls ("frequency" or "drift"), uncertainty the bootstrap noise models mixed into each prediction.