"[email protected]" <[email protected]> writes: > 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?
My quick take is any read failure. The simplest thing a reader wants to know is "things are ok" vs "things are not ok". In the latter case, a single value of "how long ago were things last ok" seems useful. I wouldn't really care about the few seconds between last good read and first failed read. > I understand per-variable timestamps are an interesting option, but a > separate topic. Is a simple variable acceptable for now? It's ok with me, but it's Jim's project and I think he might see it differently. > 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? I don't think upsc should "warn"; it currently has machine-parseable output, and we should be thinking about the protocol from upsc to upsd as much as upsc the particular client. I will reinterpret your question about "age going above 0". I think it's reasonable on a per-driver basis to retry reads, require two failures in a row, whatever, as the driver author thinks is reasonable for that device. Some devices and comms channels are 100% reliable (or if not they are "broken"), and some are not. To me, it's all about "are we in general getting fresh data on a good-enough basis to consider the data being presented as valid" vs "the data is stale". It is therefore important that after reading from device becomes troubled, so that the value are not valid, that the "not ok" indication be given. This makes me think about how Home Assistant handles things. nut isn't part of that, and there's no rule that we match, but HA has a lot of messy state handling under its belt. There, an "entity" (== "nut variable") can have a normal value, or be one of the special values "unknown" and "unavailable". More or less, "unavailable" is when the reporting of the variable isn't working, and "unknown" is when the subsystem isn't working. I would ask then: when nut starts, and the driver isn't functioning yet, what value does the variable have? How does it represent "unknown"? Could variables simply transition back to that state? I come back around to "if we have data_ok() and data_stale(), that's good enough". _______________________________________________ Nut-upsdev mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev
