net.sf.infrared.agent.jdbcstats
Class SqlStatistics

java.lang.Object
  extended bynet.sf.infrared.agent.jdbcstats.SqlStatistics
All Implemented Interfaces:
Cloneable, Serializable

public class SqlStatistics
extends Object
implements Cloneable, Serializable

Stores the statistics of a sql along with its id

See Also:
Serialized Form

Field Summary
static int AVG_EXECUTION_TIME
           
static int EXECUTION_COUNT
           
 
Constructor Summary
SqlStatistics()
          To get rid of castor errors.
SqlStatistics(Long id)
           
 
Method Summary
 void aggreagte(SqlStatistics other)
           
 SqlStatistics copy()
           
 void executed(long time, boolean prepared)
          Record a successful execution of a sql
 void executedWithError(long time, boolean prepared)
          Record a query execution failure
 void fetched(long noOfRowsFetched, long timeTakenForFetch)
           
 long getAverageNoOfRowsPerFetch()
           
 double getAverageTimePerFetch()
           
 double getAvgExecuteTime()
           
 double getAvgPrepareTime()
           
 long getFirstExecuteTime()
           
 long getFirstPrepareTime()
           
 Long getId()
           
 long getLastExecuteTime()
           
 long getLastPrepareTime()
           
 long getMaxExecuteTime()
           
 long getMaxPrepareTime()
           
 long getMaxRowsFetched()
           
 long getMinExecuteTime()
           
 long getMinPrepareTime()
           
 long getMinRowsFetched()
           
 long getNoOfExecutes()
           
 long getNoOfPrepares()
           
 String getSql()
           
 long getTotalExecuteErrors()
           
 long getTotalExecuteTime()
           
 long getTotalFetchCount()
           
 long getTotalFetchTime()
           
 long getTotalNoOfRowsFetched()
           
 long getTotalPrepareTime()
           
 void prepared(long time)
          Record a succesful call to prepare a sql
 void setSql(String sql)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AVG_EXECUTION_TIME

public static final int AVG_EXECUTION_TIME
See Also:
Constant Field Values

EXECUTION_COUNT

public static final int EXECUTION_COUNT
See Also:
Constant Field Values
Constructor Detail

SqlStatistics

public SqlStatistics()
To get rid of castor errors. This version shouldn't be used


SqlStatistics

public SqlStatistics(Long id)
Method Detail

prepared

public void prepared(long time)
Record a succesful call to prepare a sql

Parameters:
time - - time consumed by the prepare call

executed

public void executed(long time,
                     boolean prepared)
Record a successful execution of a sql

Parameters:
time - - time consumed to execute
prepared - - was it a prepared statement or not

fetched

public void fetched(long noOfRowsFetched,
                    long timeTakenForFetch)

executedWithError

public void executedWithError(long time,
                              boolean prepared)
Record a query execution failure

Parameters:
time - - time consumed to execute query
prepared - - whether it was a prepared statement or not

getId

public Long getId()

getNoOfExecutes

public long getNoOfExecutes()

getNoOfPrepares

public long getNoOfPrepares()

getTotalExecuteTime

public long getTotalExecuteTime()

getMaxExecuteTime

public long getMaxExecuteTime()

getMinExecuteTime

public long getMinExecuteTime()

getAvgExecuteTime

public double getAvgExecuteTime()

getAvgPrepareTime

public double getAvgPrepareTime()

getTotalPrepareTime

public long getTotalPrepareTime()

getMaxPrepareTime

public long getMaxPrepareTime()

getMinPrepareTime

public long getMinPrepareTime()

getLastExecuteTime

public long getLastExecuteTime()

getLastPrepareTime

public long getLastPrepareTime()

getTotalNoOfRowsFetched

public long getTotalNoOfRowsFetched()

getMaxRowsFetched

public long getMaxRowsFetched()

getMinRowsFetched

public long getMinRowsFetched()

getAverageNoOfRowsPerFetch

public long getAverageNoOfRowsPerFetch()

getTotalFetchCount

public long getTotalFetchCount()

getTotalFetchTime

public long getTotalFetchTime()

getAverageTimePerFetch

public double getAverageTimePerFetch()

copy

public SqlStatistics copy()

getFirstExecuteTime

public long getFirstExecuteTime()

getFirstPrepareTime

public long getFirstPrepareTime()

getTotalExecuteErrors

public long getTotalExecuteErrors()

getSql

public String getSql()

setSql

public void setSql(String sql)

aggreagte

public void aggreagte(SqlStatistics other)

toString

public String toString()