Report with Script Datasource that takes a long time to run

I have a report with a script datasource. The script can take up to 15 minutes to run. It times out the reporting engine. Is there a way to let the report module just let the script finish before panicking and abandoning ship? Or, do I have to write my dataset to a tag somewhere and run the script ahead of running the report somehow. I would rather let it run on demand.

Perhaps analyze the script to find out why it takes so long?

I don't know a way around it. For every hour, get a time weighted average of the last 24 hours (relative to that hour). Get 30 days worth of this. So, 30x24 or 720 hours. Also get a time weighted average of the last 60 days for every hour (relative to that hour). Format will be like [t_stamp, hour24avg, hour60dayAvg]. It just takes a long time to run.

Every hour, a little bit after the hour, compute that hour's averages and save them to a DB table. Then your report query only has to do the hourly time weighting. Should take a few dozen milliseconds.

3 Likes

Thanks, Yes that would work. I finally figured out I can offload my calcs to a script I can execute and put in memory dataset before running report on memory dataset instead.