Database Trigger Module

Hello Gurus,

I was wondering if there could be some database trigger setup. What I am looking for is

  1. whenever named queries are processed I want to log the ms it took to execute them.
  2. whenever runPrepQuery / runQuery are executed from the code, I want to log the ms it took to execute them.

can someone please guide me on the right steps?

If they're run from a script then it should be just a matter of recording system.date.now to a variable before the query execution and then system.date.millisBetween after the end of the execution. You can then write the result out to a logger of some sort or on a status line in your application.

I can't think of a way you could do that with a query binding though.

I was looking to make/build a module for the same, any right direction is much appreciated :slight_smile:

I can't help you with that, but it occurred to me that you might be able to have the database log the queries and their execution time.

1 Like

I don't think even an SDK module would be able to do this. The only possibility that comes to mind would be to implement a JDBC driver "wrapper" that would log what you like while passing the work onto a real JDBC driver.

1 Like

I wish this was not hardcoded for 10 per data source so that we can enable/disable it upon requirement.

I believe what I want to achieve is already built-in ignition with few limitations. Thank you so much, Ignition Team.