Now some more detail to add: of the 4 plotvalues datasets i get, two are fed by PI Points and have values at the interval start- and endtimes, and several values in between. The other two are more static, and only have values at start- and endtime. Is it a coincidence that these match? All 4 go into a batch PI Web API call with start -1d and end *, so is the webAPI ensuring these are resolved equal for all queries in the batch?
If these are called with the same parameters (starttime, endtime, intervals), do they always return the same number of results? On my amCharts charting lib, i need to provide a dataset with a single timestamp for all plotvalues.
For different PI tags and AF attributes, the number of results might be different with plotvalues and the timestamps are hard to control. It is better to use interpolatedvalues to ensure that the timestamps for all datasets are the same.
All 4 go into a batch PI Web API call with start -1d and end *, so is the webAPI ensuring these are resolved equal for all queries in the batch?
The default value for the startTime and endTime parameters are '*-1d' and '*'. So it is not the PI Web API ensuring that they are equal. i.e. you can use different starttimes and endtimes for each query in the batch.
This seems rather wasteful to me as 95% percent of the data won't change.
In my opinion, it might be simpler like this codewise than the alternative which is to cache the existing data and only fetch new events and then add them to the dataset.
Thanks for thinking along with me!
I already decided to go for interpolated values too to make sure the datasets are equal, and that any interpolation behaviour required to match the datasets does not end up at the client. That would be a major pain anyways!
Wrt the Batch call, if i have 4 batch calls, each using * as end time, they could potentially be executed at different times, so we could have 4 different timestamps of "*". So that's why i was wondering. I did not see that effect though, but still wondering if this is by design, or by coincidence...
Re-querying is easiest, but just seems very wasteful and not very scaleable. I'm not sure how e.g. the stock trend is working, that might use the Channels options of the PI Web API and have logic builtin to update the dataset.