Cheers all,

  Just as a heads-up to driver maintainers (and future authors): with the
recent merge
of https://github.com/networkupstools/nut/pull/2010 we now support
timestamps for
the state-tree entries (and a couple of methods to compare them). Precision
depends
on build circumstances (ideally monotonic timespec with nanosecond values,
else
plain timeval which may be confused by NTP, summer/winter times for non-UTC
hosts,
etc.)

  Currently the only practical use for this feature was in the same PR to
fix `apcupsd-ups` -
so it no longer wipes known info BEFORE querying the device/server, but can
wipe any
obsolete entries AFTER such query if their timestamps did not get updated.

  I suppose such an approach can be extended to many other drivers or even
the whole
framework (e.g. in the `main.c` loop), although some care should be taken
for e.g. "full"
vs. "partial" updates like in `snmp-ups` driver which does not expect
newest data points
for *everything* after *every* loop cycle. Surely, special handling is also
in order for fields
marked as (semi-)static, overrides, immutables, etc.

  In any case, such refactoring would be a future and separate endeavour,
although
people are welcome to get on with it and propose PRs :)

Jim Klimov
_______________________________________________
Nut-upsdev mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev

Reply via email to