Isn't the most interesting information not how old some data is, but how long it's overdue (taking into account the peculiarities of this specific hardware)?
I don't now much about actual UPS protocols (except one, of course), but I would imagine that a) there are protocols where the UPS pushes data to the driver (think interrupts) and b) others where acquiring particular values is slow (hardware responds slowly, reading is expensive, value requires averaging). OTOH, my feeling is that most of this how-long-is-that-data-stale logic belongs into upsd, not into each individual driver. (And deciding whether a certain data being stale for a certain time is a problem belongs into the application: I can live with not knowing when it will be time to replace the battery for much longer than with not knowing whether I'm on battery.) So, what about the driver, at initialization time, telling upsd, for each value, what the expected update interval is (with upsd chosing a default for the majority of them) and having upsd deal with the rest? Of course, there should be an additional method for the driver to tell upsd that reading a value failed by providing an "undefined" value. _______________________________________________ Nut-upsdev mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev
