Package com.d3x.core.db
Class DatabaseTiming
- java.lang.Object
-
- com.d3x.core.db.DatabaseTiming
-
public class DatabaseTiming extends java.lang.ObjectA class to capture timing and record counts for database operations- Author:
- Xavier Witdouck
-
-
Field Summary
Fields Modifier and Type Field Description private longconnectMillisprivate longqueryMillisprivate longresultSetMillis
-
Constructor Summary
Constructors Constructor Description DatabaseTiming()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatabaseTimingreset()Resets this timing entity(package private) <T> TtimeConnect(java.util.concurrent.Callable<T> callable)Times a callable and tags the resulting time as connect time(package private) <T> TtimeQuery(java.util.concurrent.Callable<T> callable)Times a callable and tags the resulting time as query time(package private) <T> TtimeResultSet(java.util.concurrent.Callable<T> callable)Times a callable and tags the resulting time as result set timejava.lang.StringtoString()
-
-
-
Method Detail
-
reset
public DatabaseTiming reset()
Resets this timing entity- Returns:
- this timing entity
-
timeConnect
<T> T timeConnect(java.util.concurrent.Callable<T> callable)
Times a callable and tags the resulting time as connect time- Type Parameters:
T- the type for callable- Parameters:
callable- the callable to run- Returns:
- the result of callable
-
timeQuery
<T> T timeQuery(java.util.concurrent.Callable<T> callable)
Times a callable and tags the resulting time as query time- Type Parameters:
T- the type for callable- Parameters:
callable- the callable to run- Returns:
- the result of callable
-
timeResultSet
<T> T timeResultSet(java.util.concurrent.Callable<T> callable)
Times a callable and tags the resulting time as result set time- Type Parameters:
T- the type for callable- Parameters:
callable- the callable to run- Returns:
- the result of callable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-