On Thu, Jul 2, 2009 at 12:46 AM, Jaap Struyk<[email protected]> wrote:
> On 01-07-09 03:48, Paul Alfille wrote:
>
>> There are 2 issues here:
>> 1. There is no automatic reread of data once a cached item times out.
>> A timeout_volatile of 1 second would make the maximum lifespan of a
>> data element be 1 second (but since the resolution of that timestamp
>> is 1 second, it's more likely to be 1/2 second on average.
>
> Aha, that's where I misunderstood, so I must see it as an "expiration
> date" as soon as it expires the next read will refresh the cache.
>
>> 2. Purging the cache is a rather rough approach. We probably would
>> only want to purge volatile data which would require a minor
>> change.(maybe a volatile generation counter).
>
> That was the behaviour I had hoped for, a "refresh" rate...
>
>> 4. Set a short volatile timeout. No one data element will be more than
>> that number of seconds old. Not currently set up for resolutions under
>> a second or 2.
>
> Currently I have a setting of zero which seems to have the same
> behaviour as reading uncached.
>
>>> I tried timeout_volatile with values of 0.5 but that didn't worked...
>> Unlikely to work since the cache timestamp is in time_t (seconds)
>> resolution. It could easily be changed, but I doubt 1-wire really has
>> the speed to warrant higher resolution.
>
> If I poll a single sensor it takes between 0.1 and 0.2sec. depending on
> the hardware to get data back in uncached, in cached it is lightning
> fast (off-course)
>
> I know that with what I try to do I am pushing it to the limits but it
> does work: http://www.dlogger.deserver.nl/live.html
>

Nice graph. You are monitoring car engine parameters?

So would the volatile cache purge do the trick? All volatile cache properties
(temperature,  sensed readings, voltages, ...) would be invalidated and thus
remeasured.

I'd probably put the switch under /settings/purge_cache/volatile

There is one other design alternative (which is sort of suggested by your note).

Currently each cache item starts its timeout from the time it was
actually measured.

We could start all the volatile timeouts from a common time, so they
would all expire at the same time.
That would give the behavior you want. It would be less precise, but
more automatic than having a cache purge switch.

Paul Alfille

------------------------------------------------------------------------------
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to