ntpq peers formatting needs floating point for time slots.

Matthew Selsky Matthew.Selsky at twosigma.com
Sat Feb 4 06:45:03 UTC 2017


On Fri, Feb 03, 2017 at 04:24:58AM -0800, Hal Murray wrote:
> 
> I just pushed a fix.  Please test.
> 
> I bumped the width from 78 to 79.  If that screws up, we should document a 
> test case.  I'm assuming the output supports an 80 character line.
> 
> There was a space-space before the delay column.  I grabbed one of them.  
> Those 2 extra spaces let me change the width of the last 3 columns to 8 
> characters.  (1 was already 8, the other 2 were 7)

Hey Hal,

We need some backwards compatibility for ntp classic servers.  Eg, the server has only microsecond precision.  We need to avoid adding trailing zeros that are not actually significant.

$ /usr/bin/ntpq -p ; ./ntpclients/ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+clock1          .GPSs.           1 u    1    2  377    0.480    0.000   0.000
*clock2          .GPSs.           1 u    1    2  377    0.016    0.000   0.000
+clock3          .GPSs.           1 u    1    2  377    0.666    0.002   0.001
     remote           refid      st t when poll reach   delay   offset  jitter
=============================================================================
+clock1         .GPSs.           1 u    -    2  377   0.4800  -0.0000  0.0000
*clock2         .GPSs.           1 u    -    2  377   0.0160  -0.0000  0.0000
+clock3         .GPSs.           1 u    -    2  377   0.6660   0.0020  0.0010


Thanks,
-Matt


More information about the devel mailing list