[ 
http://issues.apache.org/jira/browse/IBATIS-151?page=comments#action_12313416 ] 

Ron Grabowski commented on IBATIS-151:
--------------------------------------

One could argue that adding information to the errorContext also slows things 
down ;-)

If more timing information were available, one could configure the logger to 
send statistical related log messages to another app (similiar to sending log 
messages to Chainsaw) to view real-time data like this:

 http://www.irongrid.com/catalog/images/irongrid/ironeye-sql.gif
 http://www.irongrid.com/catalog/images/irongrid/ironeye-cache.gif

I believe the company IronGrid went out of business 2 years ago:

 http://sourceforge.net/forum/forum.php?thread_id=1281831&forum_id=310946

Thinking out loud...what if another logger were added to certain classes that 
dealt with timing information. I think :

 private static final Log log = 
LogFactory.getLog("com.ibatis.sqlmap.engine.execution.SqlExecutor");
 private static final Log statisticLog = LogFactory.getLog("STATISTICS." + 
"com.ibatis.sqlmap.engine.execution.SqlExecutor");

I'm sure log4j offers functionality like this:

 http://logging.apache.org/log4net/release/faq.html#perf-not-logging2

Configuring the STATISTICS logger that way would (in theory) cause no slowdown 
when its not being used.

Another benefit of having seperate STATISTICS (maybe a CACHE family of loggers 
to show cache hits ???) loggers is that they could be configed indepentantly of 
normal debug logging which means existing code would not need to be changed. 
I'm not an expert on the IBatis Java code, but it looks like timing code would 
only need to be added to the SqlExecutor class.

While part of me agrees that such timing information doesn't fall within the 
scope of IBatis, a slightly larger part thinks it would be nice to see what sql 
queries are most often executed and the amount of time the system spends on 
them. Yes, this could be done using database specific tools but not all 
databases easily support that kind of analysis for developers.

I think most people would be more than satisified if they were able to 
re-produce the screen shots from IronGrid from any IBatis compatible JDBC 
driver. 

> Detailed logs for statement execution
> -------------------------------------
>
>          Key: IBATIS-151
>          URL: http://issues.apache.org/jira/browse/IBATIS-151
>      Project: iBatis for Java
>         Type: New Feature
>   Components: SQL Maps
>     Versions: 2.0.9b
>     Reporter: Vernon Wong
>     Priority: Minor

>
> There are currently no logs during the SQLMap execution that captures the 
> execution time of the statement and the object generation time by SQLMap.
> These performance logs can help to provide useful information on the 
> statements usage and performance, without the influence of object creation 
> time. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to