Skip to content

ntpstats.masks

Limit masks for stability curves (e.g. TDEV/MTIE network limits).

Masks are user supplied (no standards text is bundled): a CSV/whitespace file with two columns tau,limit (seconds, and the statistic's unit), optionally with a header and # comments. A mask applies to one statistic: the one named in the header's second column (tau,tdev, tau,mtie, tau,oadev ...), else the kind argument, else TDEV. Between breakpoints the limit is interpolated linearly in log-log coordinates, the way masks are drawn in ITU-T recommendations. Outside the defined tau range the mask does not apply.

load_mask(source, name=None, kind=None)

Read a mask from a path, a file object, or mask text (a string that is not an existing file). kind overrides the statistic named in the header.

check(result, mask)

Compare a stability result with a mask.

Returns per-tau limit and margin (limit / value; > 1 passes) and an overall passed flag over the taus where the mask applies. The upper confidence bound is used when available, which is the conservative choice.