to.etc.dbpool.info
Class InfoCollectorExpenseBased

java.lang.Object
  extended by to.etc.dbpool.info.InfoCollectorBase
      extended by to.etc.dbpool.info.InfoCollectorExpenseBased
All Implemented Interfaces:
IStatisticsListener

public class InfoCollectorExpenseBased
extends InfoCollectorBase
implements IStatisticsListener

This collects per-statement execution time and collects statement counts.

Author:
Frits Jalvingh Created on Nov 3, 2010

Nested Class Summary
static class InfoCollectorExpenseBased.StmtCount
           
 
Field Summary
 
Fields inherited from class to.etc.dbpool.info.InfoCollectorBase
m_executeDuration, m_nConnectionAllocations, m_nErrors, m_nExecutes, m_nPreparedQueries, m_nPreparedUpdates, m_nPrepares, m_nRows, m_nStatementQueries, m_nStatementUpdates, m_nUpdatedRows, m_preparedQueryDuration, m_preparedUpdateDuration, m_prepareDuration, m_statementQueryDuration, m_statementUpdateDuration, m_totalFetchDuration
 
Constructor Summary
InfoCollectorExpenseBased(java.lang.String ident, java.lang.String queryString)
           
 
Method Summary
 void addPerformanceCollector(IPerformanceCollector pc)
           
 void connectionAllocated()
           
 void executeBatchExecuted(StatementProxy sp, long executeDuration, int[] rc)
          FIXME Needs explicit handling.
 void executeExecuted(StatementProxy sp, long updateDuration, java.lang.Boolean result)
          Executed an "execute" command.
 void executePreparedUpdateExecuted(StatementProxy sp, long updateDuration, int rowcount)
           
 void executeUpdateExecuted(StatementProxy sp, long updateDuration, int updatedrowcount)
          An update statement has been executed.
<T extends IPerformanceCollector>
T
findCollector(java.lang.Class<T> clz)
          Called when a statement execute has run.
 void finish()
          Called when the collector is removed from the set.
 java.util.List<InfoCollectorExpenseBased.StmtCount> getCounters()
           
 java.util.Map<java.lang.String,InfoCollectorExpenseBased.StmtCount> getStatementMap()
           
 void queryStatementExecuted(StatementProxy sp, long executeDuration, long fetchDuration, int rowCount, boolean prepared)
          A query statement was executed.
 void reportSimple()
           
 void statementPrepared(StatementProxy sp, long prepareDuration)
          A statement was prepared or created.
 
Methods inherited from class to.etc.dbpool.info.InfoCollectorBase
getDuration, getExecuteDuration, getIdent, getNConnectionAllocations, getNErrors, getNExecutes, getNPreparedQueries, getNPreparedUpdates, getNPrepares, getNRows, getNStatementQueries, getNStatementUpdates, getNUpdatedRows, getPreparedQueryDuration, getPreparedUpdateDuration, getPrepareDuration, getStartTS, getStatementQueryDuration, getStatementUpdateDuration, getTotalDBRequests, getTotalDBTime, getTotalFetchDuration, getTotalQueries, getTotalUpdates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfoCollectorExpenseBased

public InfoCollectorExpenseBased(java.lang.String ident,
                                 java.lang.String queryString)
Method Detail

addPerformanceCollector

public void addPerformanceCollector(IPerformanceCollector pc)

finish

public void finish()
Called when the collector is removed from the set. It should complete all data so that retrieval can be done.

Specified by:
finish in interface IStatisticsListener
See Also:
to.etc.dbpool.info.InfoCollector#finish()

getStatementMap

public java.util.Map<java.lang.String,InfoCollectorExpenseBased.StmtCount> getStatementMap()

getCounters

public java.util.List<InfoCollectorExpenseBased.StmtCount> getCounters()

findCollector

public <T extends IPerformanceCollector> T findCollector(java.lang.Class<T> clz)
Called when a statement execute has run. This is only the part where a result set is returned; it does not include fetch of the result set.


connectionAllocated

public void connectionAllocated()
Specified by:
connectionAllocated in interface IStatisticsListener
See Also:
to.etc.dbpool.info.InfoCollector#connectionAllocated()

statementPrepared

public void statementPrepared(StatementProxy sp,
                              long prepareDuration)
Description copied from interface: IStatisticsListener
A statement was prepared or created.

Specified by:
statementPrepared in interface IStatisticsListener

queryStatementExecuted

public void queryStatementExecuted(StatementProxy sp,
                                   long executeDuration,
                                   long fetchDuration,
                                   int rowCount,
                                   boolean prepared)
Description copied from interface: IStatisticsListener
A query statement was executed.

Specified by:
queryStatementExecuted in interface IStatisticsListener

executePreparedUpdateExecuted

public void executePreparedUpdateExecuted(StatementProxy sp,
                                          long updateDuration,
                                          int rowcount)
Specified by:
executePreparedUpdateExecuted in interface IStatisticsListener

executeUpdateExecuted

public void executeUpdateExecuted(StatementProxy sp,
                                  long updateDuration,
                                  int updatedrowcount)
Description copied from interface: IStatisticsListener
An update statement has been executed.

Specified by:
executeUpdateExecuted in interface IStatisticsListener

executeExecuted

public void executeExecuted(StatementProxy sp,
                            long updateDuration,
                            java.lang.Boolean result)
Description copied from interface: IStatisticsListener
Executed an "execute" command.

Specified by:
executeExecuted in interface IStatisticsListener

executeBatchExecuted

public void executeBatchExecuted(StatementProxy sp,
                                 long executeDuration,
                                 int[] rc)
FIXME Needs explicit handling.

Specified by:
executeBatchExecuted in interface IStatisticsListener
See Also:
IStatisticsListener.executeBatchExecuted(to.etc.dbpool.StatementProxy, long, int[])

reportSimple

public void reportSimple()