[Nut-upsdev] RFC: new variable driver.data.age (seconds since the driver last got data from the device)
Jim Klimov
jimklimov+nut at gmail.com
Sat Nov 14 14:53:58 GMT 2026
My take on the technical side of this is (and IIRC I posted a bug tracker
issue to remember the idea at some point), that NUT data state entries each
have a timestamp. We could publish them as such, maybe with a separate
option for the client and/or protocol (like we do "aux" data etc.) or
common namespace following the NUT tree and data point naming convention -
e.g. `timestamp.battery.charge`. We might offer a special name for the
newest timestamp (last successful data collection) especially relevant for
drivers that juggle full and quick/partial data walks.
Jim
On Sat, Nov 14, 2026, 14:49 Greg Troxel via Nut-upsdev <
nut-upsdev at alioth-lists.debian.net> wrote:
> Disclosure: I prepared the analysis and the code with the help of an AI
> coding assistant (Claude Code, model Claude Opus 5.5). I reviewed the
> changes and take responsibility for them.
>
> Please put this up front, not at the end, in the future.
>
> I'm not going to read this (because I think it's not ok to ask humans to
> read LLM output), but one concern about semantics. Happy to discuss
> that with people -- please ensure all LLM text in email is labelled as
> such.
>
> The proposal is for an age variable. Broadly that makes sense.
> However, it presumes there is a single age, and therefore that data is
> read all at once. That might be true for many drivers, but other
> drivers might fetch some data more often.
>
> I suspect blurring this doesn't really matter, but we should have clean
> semantics. Perhaps
>
> when there is a failure to read, a timestamp (of the start of the
> failed read) is stored, and age reflects time since that timestamp
>
> age is 0 when data is being read on the intended schedule, and the
> most recent read cycle did not fail
>
> Thus a reader doesn't know exactly when a data point was taken, and we
> can avoid per-item timestamps, but there is still "how stale is the
> data", with anything non-zero reflecting "problem reading data, began x
> seconds ago", and zero reflecting "data is not stale".
>
>
> _______________________________________________
> Nut-upsdev mailing list
> Nut-upsdev at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/nut-upsdev/attachments/20261114/8de24d00/attachment-0001.htm>
More information about the Nut-upsdev
mailing list