gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] Print offset in ntpshmmon?


From: Miroslav Lichvar
Subject: Re: [gpsd-dev] Print offset in ntpshmmon?
Date: Wed, 22 Apr 2015 08:43:29 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Apr 21, 2015 at 07:45:17AM -0400, Eric S. Raymond wrote:
> Miroslav Lichvar <address@hidden>:
> > For me, it's quite useful to see the offset (the difference between
> > the clock and receive timestamps). Would there be any interest in
> > adding that to ntpshmmon?
> > 
> > It seems there is no more room for additional entries to fit in 80
> > columns. Would it be ok to replace the clock timestamp?
> 
> Not unconditionally, we need it for ntpshmviz.

Looking at the ntpshmviz code, it seems the clock timestamp is just
used to calculate the offset. If ntpshmmon did that, ntpshmviz could
use it directly and as a bonus there would be no loss in the precision
(avoiding substraction of two large close float values).

--- a/contrib/ntpshmviz
+++ b/contrib/ntpshmviz
@@ -110,7 +110,7 @@ class ntpOffset:
         #   - The NTP unit from which it was collected.
         #   - Collection time of day, expressed in seconds
         #   - Receiver time of day, expressed in seconds
-        #   - Clock time of day, expressed in seconds
+        #   - Offset, expressed in seconds
         #   - Leep-second notification status
         #   - Source precision (log(2) of source jitter)

@@ -128,7 +128,7 @@ class ntpOffset:
                 if line[:1] != '#':
                     line = line.lstrip()
                     record = line.split(' ')
-                    offset = (float(record[3]) - float(record[4]))
+                    offset = float(record[4])

                     # If the NTP unit is in the dictionary
                     # append the offset to the list

-- 
Miroslav Lichvar



reply via email to

[Prev in Thread] Current Thread [Next in Thread]