Cache and metadata function calls
last() and lastValue() will check the cache for the value(s) requested. The cache will expand to the size requested by filling in values from the databaes. Subsequent data will flow through the cache to the databases. The first call to a higher size can get to the database for the last few, then, but the rest will go to the cache.
since() will query the database, then include any newer values from the cache. The same is true of between().
before() will look in the cache, and not finding it check the database, after() will check the database then check the cache
past(), prev(), and previous() return statistics options, which rely on between()
So, all metadata functions that should use the most recent data reach into the cache for the most recent value?
If the datasource is polling at 1s intervals and logging a 1minute average, will last(0).value and all other related metadata functions that reach into the cache return the latest 1 minute average or the latest polled value?
What is the time period between pointvalues in the cache? Is it the logging interval, the polling interval, or a hybrid of the two?
Does the cache/disk boundary in any way affect the sample interval?
Similarly, does the configuration number that selects the number of points to cache for a datasource indicate the quantity of points before or after the point decimation? For example, if a datasource is configured for 1 second polling, and its point is configured for 1 minute logging, will a 60 point cache span 1 minute or 1 hour of point values?
For a 1-second polled datasource, if a metadata point calls
p.past(MINUTE, 10).average;should the cache be set to a size above '10' or '600' to ensure that the 10-minute average function call does not have to perform a disk read?
The context help for metadata functions in my version of Mango describes what the cache is for, but does not put it in the context of the logging properties. It would be very helpful to add all your answers in this thread to the cache context help and the metadata script context help. Otherwise each Mango user has to run test cases to confirm their assumptions, which can be quite time consuming.