Hi all,
Can someone tell me if the exportDataSets function on the easy chart reissues the underlying query against historical tags?
We are working with extremely large datasets at times and I am working on trimming down any extraneous data calls.
The Adhoc Trend template was issuing the underlying query X number of times where X is the number of tags in the chart due to the MIN/MAX/AVG calculations being done.
So I removed those calls and now I want to just script gathering those values on the underlying datasets.
BUT... it does appear to me that the exportDataSets call does in fact reissue the query
Hm. A glance at the code suggests that it shouldn't be issuing new queries.
Could it be causing a binding refresh that then triggers the query?
When you call the exportDataSets(), the entire chart refreshes on the screen.
Try setting com.inductiveautomation.factorypmi.application.components.PMIEasyChart
to trace (in the client/designer) and exporting; that should have some logging info that helps confirm what's going on.
The implementation of exportDatasets
is basically just collecting all of the 'pens' you have, and asking each pen for its data. All of the pens should just be handing back the datasets they already have, so I'm not sure what's causing the chart to refresh.
As soon as I went to set the logging I realized what is going on.
The AdHoc Trend template writes the values back to the tagPens binding on the Easy Chart.
Which then triggers the bindings on the easy chart.
So now I need to figure out another way to display those values without writing back to the dataset.
Just a heads up but someone should update the documentation on the adHoc Trend template to reference how many queries are issued against the historian when you use it.
It isn't noticeable when the tag count is low or the date range isn't very large.
But if you get say 6 tags and a few months of data it is definitely noticeable.
@PGriffith , could you verify something else for me?
I have been running the chart in debug and noticed that if you put pens on different AXIS, the queries get split for some reason and you end up with multiple queries hitting the historian and they are returning different numbers of records even with the density set to Fixed 1900.
Why would it be splitting it into separate queries when it is just the Y AXIS range that is different?
It's probably an implementation thing with the chart. I don't know for sure without doing a deeper analysis of the code, but it's possible there's something to improve there. I'll file a ticket to investigate.
Thanks!
For posterity: Do these different pens have different aggregation modes? The way the chart is written, that's the first chance things have to be separated into different groups. That is - we can't issue a min/max, average, and natural aggregation mode query simultaneously; they have to be issued as separated queries.
No they do not.
We have it coded to always use Closest Value.