[Nut-upsdev] RFC: new variable driver.data.age (seconds since the driver last got data from the device)
info@lenssen.biz
kl-git at lenssen.biz
Sat Nov 14 16:54:42 GMT 2026
Greg, Jim,
Thanks for your replies and the discussion about my proposal. I am new to this and will put the disclosure first from now on.
Re semantics: 0 = healthy; > 0 = seconds since the start of the first failed read cycle; by default datastale() sets the start and dataok() resets it.
What would be the failure criteria? "no item could be read“ or even partial failures?
I understand per-variable timestamps are an interesting option, but a separate topic. Is a simple variable acceptable for now?
Does something speak against that upsc warns as soon as the age is > 0, or shall this only happen after a grace period of one poll interval, so that a single transient error don’t issue a warning?
Thanks,
Klaus
> Am 14.11.2026 um 14:30 schrieb Greg Troxel <gdt at lexort.com>:
>
> 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".
>
More information about the Nut-upsdev
mailing list