On Thu, Jun 28, 2007, Jesse Norell <[EMAIL PROTECTED]> said: > On Thu, 2007-06-28 at 09:55 +0200, Paul J Stevens wrote: >> The logs already contain sufficient information since they contain >> timestamps on >> both the QUERY statement, and the RESPONSE sent back to the client. > > Hey, if every response is already logged, then the cost of doing the > timing is almost nothing - two calls to gettimeofday(), subtract the > difference and put it in the log message you're already creating. > > I thought about using the timestamps of the log messages; that would > work for dbmail direct logging, but may not always be tremendously > accurate with syslog (though likely good enough for debugging anything > "slow"). > > It just seemed pretty trivial an fairly useful .. but if it's a bad > idea, that's fine (I have lots of those :).
Last night I wrote up the code, and depending on how long the query takes, it escalates the debugging level, all the way up to WARNING (level 2) for queries taking longer than 30 seconds. I don't actually know if this is a fair value, but I picked a number. I'll commit this code later today to get some feedback. Aaron _______________________________________________ Dbmail-dev mailing list [email protected] http://twister.fastxs.net/mailman/listinfo/dbmail-dev
