public class ThreadLocalStatisticsCollector extends java.lang.Object implements StatisticsCollector
You will want to call resetThread() to clean up the thread local aspects of this object per request thread.
ThreadLocals have their place in the Java world but be careful on how you use them. If you don't clean them up on "request boundaries" then you WILL have misleading statistics.
StatisticsCollector| Constructor and Description |
|---|
ThreadLocalStatisticsCollector() |
| Modifier and Type | Method and Description |
|---|---|
Statistics |
getOverallStatistics()
This returns the overall statistics, that is not per thread but for the life of this object
|
Statistics |
getStatistics()
This returns the statistics for this thread.
|
long |
incrementBatchLoadCountBy(long delta)
Called to increment the number of batch loads
|
long |
incrementBatchLoadExceptionCount()
Called to increment the number of batch loads exceptions
|
long |
incrementCacheHitCount()
Called to increment the number of cache hits
|
long |
incrementLoadCount()
Called to increment the number of loads
|
long |
incrementLoadErrorCount()
Called to increment the number of loads that resulted in an object deemed in error
|
ThreadLocalStatisticsCollector |
resetThread()
Removes the underlying thread local value for this current thread.
|
java.lang.String |
toString() |
public ThreadLocalStatisticsCollector resetThread()
public long incrementLoadCount()
StatisticsCollectorincrementLoadCount in interface StatisticsCollectorpublic long incrementBatchLoadCountBy(long delta)
StatisticsCollectorincrementBatchLoadCountBy in interface StatisticsCollectordelta - how much to add to the countpublic long incrementCacheHitCount()
StatisticsCollectorincrementCacheHitCount in interface StatisticsCollectorpublic long incrementLoadErrorCount()
StatisticsCollectorincrementLoadErrorCount in interface StatisticsCollectorpublic long incrementBatchLoadExceptionCount()
StatisticsCollectorincrementBatchLoadExceptionCount in interface StatisticsCollectorpublic Statistics getStatistics()
getStatistics in interface StatisticsCollectorpublic Statistics getOverallStatistics()
public java.lang.String toString()
toString in class java.lang.Object