public class DataSourceQueryCountListener extends Object implements QueryExecutionListener
QueryCount).
In web application lifecycle, one http request is handled by one thread.
Storing database access information into a thread local value provides metrics
information per http request.
Thread local value(QueryCount) holds following information.
- datasource name
- number of database call
- total query execution time
- number of queries by type
QueryCount can be retrieved by QueryCountHolder.get(String).QueryCount,
QueryCountHolder,
CommonsQueryCountLoggingFilter,
CommonsQueryCountLoggingRequestListener,
CommonsQueryCountLoggingHandlerInterceptorDEFAULT| Constructor and Description |
|---|
DataSourceQueryCountListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterQuery(ExecutionInfo execInfo,
List<QueryInfo> queryInfoList) |
void |
beforeQuery(ExecutionInfo execInfo,
List<QueryInfo> queryInfoList) |
public void beforeQuery(ExecutionInfo execInfo, List<QueryInfo> queryInfoList)
beforeQuery in interface QueryExecutionListenerpublic void afterQuery(ExecutionInfo execInfo, List<QueryInfo> queryInfoList)
afterQuery in interface QueryExecutionListenerCopyright © 2014. All rights reserved.