Jeremy Wanamaker

Custom datasource collection interval and on-demand collection

Recommended Posts

We use JDBC to run queries against SQL Server and MySQL databases. Some of the queries we'd like to run are resource intensive and cannot be run during business hours. We'd like to be able to set a custom collection time for these datasources. On demand collection would be helpful as well.

Share this post


Link to post
Share on other sites

Jeremy,

One way to do this is to write a powershell script that checks the time now, and if its between 1 a.m. and 2 .a.m runs the query, if not does nothing but report the values returned from the last time it ran. 

Incorporate this into a datasource and its only going to run the query at that time. You set the ds to run every hour, but it wont run the query until the right time.

David

  • Upvote 2

Share this post


Link to post
Share on other sites

Thanks David. That's a good approach. I was using the a JDBC query directly within the datasource but it should be straightforward to move it into a PowerShell script. I will give that at try.

Share this post


Link to post
Share on other sites

@Dave Lee Q, Do you have a sample script on how to return the last value? Is there some built-in api to get the prev value? should I store it in a file and just use that value?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now