to.etc.dbpool.info
Class ThreadData

java.lang.Object
  extended by to.etc.dbpool.info.ThreadData
All Implemented Interfaces:
InfoCollector

public class ThreadData
extends java.lang.Object
implements InfoCollector

Instance of a single run of thread-related data. This structure gets created every time data collection for a thread starts. All of the data collected will be maintained in this structure *if* available. Since this structure is only ever accessed by a single thread we need not synchronize access.

Author:
Frits Jalvingh Created on Feb 22, 2007

Nested Class Summary
static class ThreadData.Counters
           
 
Constructor Summary
ThreadData(java.lang.String ident)
           
 
Method Summary
 void addBatch(java.lang.String sql)
           
 void connectionAllocated()
           
 boolean decrement()
           
 void executeBatchEnd(StatementProxy sp, int[] rc)
           
 void executeBatchStart(StatementProxy sp)
           
 void executeEnd(StatementProxy sp, java.lang.Boolean result)
           
 void executeError(StatementProxy sp, java.lang.Exception x)
           
 void executePreparedQueryStart(StatementProxy sp)
           
 void executePreparedUpdateStart(StatementProxy sp)
           
 void executeQueryEnd(StatementProxy sp, ResultSetProxy rs)
           
 void executeQueryStart(StatementProxy sp)
           
 void executeStart(StatementProxy sp)
           
 void executeUpdateEnd(StatementProxy sp, int rowcount)
           
 void executeUpdateStart(StatementProxy sp)
           
 void finish()
           
 long getExecuteDuration()
           
 java.lang.String getIdent()
           
 int getNAllocatedConnections()
           
 int getNConnectionAllocations()
           
 int getNErrors()
           
 int getNestingCount()
           
 int getNExecutes()
           
 int getNPreparedQueries()
           
 int getNPreparedUpdates()
           
 int getNPrepares()
           
 int getNRows()
           
 int getNStatementQueries()
           
 int getNStatementUpdates()
           
 long getNUpdatedRows()
           
 long getPreparedQueryDuration()
           
 long getPreparedUpdateDuration()
           
 long getPrepareDuration()
           
 long getRequestDuration()
           
 java.util.Map<java.lang.String,ThreadData.Counters> getStatementMap()
           
 long getStatementQueryDuration()
           
 long getStatementUpdateDuration()
           
 int getTotalDBRequests()
           
 int getTotalQueries()
           
 int getTotalUpdates()
           
 void increment()
           
 void incrementRowCount(ResultSetProxy rp)
           
 void incrementUpdateCount(int uc)
           
 void prepareStatement(java.lang.String sql)
          Called when a prepare is started.
 void prepareStatementEnd(java.lang.String sql, StatementProxy sp)
          Called when the prepare call has finished.
 void reportSimple()
           
 void resultSetClosed(ResultSetProxy rp)
          The result set was closed, and row fetch count and row fetch duration is available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadData

public ThreadData(java.lang.String ident)
Method Detail

getStatementMap

public java.util.Map<java.lang.String,ThreadData.Counters> getStatementMap()

getIdent

public java.lang.String getIdent()

increment

public void increment()

decrement

public boolean decrement()

connectionAllocated

public void connectionAllocated()
Specified by:
connectionAllocated in interface InfoCollector

prepareStatement

public void prepareStatement(java.lang.String sql)
Description copied from interface: InfoCollector
Called when a prepare is started. This starts the clock for the statement.

Specified by:
prepareStatement in interface InfoCollector

prepareStatementEnd

public void prepareStatementEnd(java.lang.String sql,
                                StatementProxy sp)
Description copied from interface: InfoCollector
Called when the prepare call has finished.

Specified by:
prepareStatementEnd in interface InfoCollector

executePreparedQueryStart

public void executePreparedQueryStart(StatementProxy sp)
Specified by:
executePreparedQueryStart in interface InfoCollector

executeQueryEnd

public void executeQueryEnd(StatementProxy sp,
                            ResultSetProxy rs)
Specified by:
executeQueryEnd in interface InfoCollector

executePreparedUpdateStart

public void executePreparedUpdateStart(StatementProxy sp)
Specified by:
executePreparedUpdateStart in interface InfoCollector

executeUpdateStart

public void executeUpdateStart(StatementProxy sp)
Specified by:
executeUpdateStart in interface InfoCollector

executeUpdateEnd

public void executeUpdateEnd(StatementProxy sp,
                             int rowcount)
Specified by:
executeUpdateEnd in interface InfoCollector

executeError

public void executeError(StatementProxy sp,
                         java.lang.Exception x)
Specified by:
executeError in interface InfoCollector

executeQueryStart

public void executeQueryStart(StatementProxy sp)
Specified by:
executeQueryStart in interface InfoCollector

executeStart

public void executeStart(StatementProxy sp)
Specified by:
executeStart in interface InfoCollector

executeEnd

public void executeEnd(StatementProxy sp,
                       java.lang.Boolean result)
Specified by:
executeEnd in interface InfoCollector

incrementUpdateCount

public void incrementUpdateCount(int uc)
Specified by:
incrementUpdateCount in interface InfoCollector

resultSetClosed

public void resultSetClosed(ResultSetProxy rp)
Description copied from interface: InfoCollector
The result set was closed, and row fetch count and row fetch duration is available.

Specified by:
resultSetClosed in interface InfoCollector

executeBatchEnd

public void executeBatchEnd(StatementProxy sp,
                            int[] rc)
Specified by:
executeBatchEnd in interface InfoCollector

executeBatchStart

public void executeBatchStart(StatementProxy sp)
Specified by:
executeBatchStart in interface InfoCollector

addBatch

public void addBatch(java.lang.String sql)
Specified by:
addBatch in interface InfoCollector

incrementRowCount

public void incrementRowCount(ResultSetProxy rp)

getRequestDuration

public long getRequestDuration()

getNAllocatedConnections

public int getNAllocatedConnections()

getNestingCount

public int getNestingCount()

getNConnectionAllocations

public int getNConnectionAllocations()

getNPrepares

public int getNPrepares()

getPrepareDuration

public long getPrepareDuration()

getNPreparedQueries

public int getNPreparedQueries()

getNPreparedUpdates

public int getNPreparedUpdates()

getNStatementUpdates

public int getNStatementUpdates()

getNUpdatedRows

public long getNUpdatedRows()

getPreparedQueryDuration

public long getPreparedQueryDuration()

getPreparedUpdateDuration

public long getPreparedUpdateDuration()

getStatementQueryDuration

public long getStatementQueryDuration()

getStatementUpdateDuration

public long getStatementUpdateDuration()

getNExecutes

public int getNExecutes()

getExecuteDuration

public long getExecuteDuration()

getNErrors

public int getNErrors()

getNStatementQueries

public int getNStatementQueries()

getTotalQueries

public int getTotalQueries()

getTotalUpdates

public int getTotalUpdates()

getTotalDBRequests

public int getTotalDBRequests()

getNRows

public int getNRows()

finish

public void finish()
Specified by:
finish in interface InfoCollector

reportSimple

public void reportSimple()