We have a project that requires summary calculations (min/max/average) on data that has been retrieved from PI and potentially then adjusted. The way we are doing this is...
- Obtain the target AF asset and attribute.
- Request time-seriese data for the attribute
- Potentially perform manipulations on the data retrieved (eg removing spikes)
- Calculate a selection of average, max, min, count above, etc. on the adjusted data, using the PIValues.Summary() method. There are some calculations that are not supported by Summary() and we obviously have to do those ourselves.
Trouble is, this is hugely slow! We are suspecting that PIValues.Summary() actually sends the values back to the PI server each time. In which case it may be more efficient for us to implement the calculations ourselves.
Does anyone have any advice on the most efficient way to do this. It is not unusual for the users to ask for a report summarising a year's worth of data for 7000 assets, with average, minimum and maximum for 2 data streams at each site. This report takes several hours to run!