Top Description Fields Constructors Methods
org.hibernate.stat

public Class ConcurrentQueryStatisticsImpl

extends CategorizedStatistics
implements QueryStatistics
Class Inheritance
All Implemented Interfaces
org.hibernate.stat.QueryStatistics, java.io.Serializable
Imports
java.util.concurrent.atomic.AtomicLong, java.util.concurrent.locks.Lock, .ReadWriteLock, .ReentrantReadWriteLock

Query statistics (HQL and SQL)

Note that for a cached query, the cache miss is equals to the db count

Author
Alex Snaps

Field Summary

Modifier and TypeField and Description
private final AtomicLong
private final AtomicLong
private final AtomicLong
private final AtomicLong
private final AtomicLong
private final AtomicLong
private final AtomicLong
private final Lock
private final AtomicLong
private final Lock

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
executed(long
rows count returned
rows
,
long
time taken
time
)

add statistics report of a DB query

public long
getCacheHitCount()

Implements org.hibernate.stat.QueryStatistics.getCacheHitCount.

Queries retrieved successfully from the cache
public long
public long
public long
getExecutionAvgTime()

Implements org.hibernate.stat.QueryStatistics.getExecutionAvgTime.

average time in ms taken by the excution of this query onto the DB
public long
public long
getExecutionMaxTime()

Implements org.hibernate.stat.QueryStatistics.getExecutionMaxTime.

max time in ms taken by the excution of this query onto the DB
public long
getExecutionMinTime()

Implements org.hibernate.stat.QueryStatistics.getExecutionMinTime.

min time in ms taken by the excution of this query onto the DB
public long

Returns:

The number of rows cumulatively returned by the given query; iterate and scroll queries do not effect this total as their number of returned rows is not known at execution time.
getExecutionRowCount
()

Implements org.hibernate.stat.QueryStatistics.getExecutionRowCount.

Number of lines returned by all the executions of this query (from DB) For now, org.hibernate.Query#iterate() and org.hibernate.Query#scroll()() do not fill this statistic
pack-priv void
pack-priv void
pack-priv void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.hibernate.stat.CategorizedStatistics:
getCategoryName

Field Detail

cacheHitCountback to summary
private final AtomicLong cacheHitCount
cacheMissCountback to summary
private final AtomicLong cacheMissCount
cachePutCountback to summary
private final AtomicLong cachePutCount
executionCountback to summary
private final AtomicLong executionCount
executionMaxTimeback to summary
private final AtomicLong executionMaxTime
executionMinTimeback to summary
private final AtomicLong executionMinTime
executionRowCountback to summary
private final AtomicLong executionRowCount
readLockback to summary
private final Lock readLock
totalExecutionTimeback to summary
private final AtomicLong totalExecutionTime
writeLockback to summary
private final Lock writeLock

Constructor Detail

ConcurrentQueryStatisticsImplback to summary
pack-priv ConcurrentQueryStatisticsImpl(String query)

Method Detail

executedback to summary
pack-priv void executed(long rows, long time)

add statistics report of a DB query

Parameters
rows:long

rows count returned

time:long

time taken

getCacheHitCountback to summary
public long getCacheHitCount()

Implements org.hibernate.stat.QueryStatistics.getCacheHitCount.

Queries retrieved successfully from the cache

getCacheMissCountback to summary
public long getCacheMissCount()

Implements org.hibernate.stat.QueryStatistics.getCacheMissCount.

getCachePutCountback to summary
public long getCachePutCount()

Implements org.hibernate.stat.QueryStatistics.getCachePutCount.

getExecutionAvgTimeback to summary
public long getExecutionAvgTime()

Implements org.hibernate.stat.QueryStatistics.getExecutionAvgTime.

average time in ms taken by the excution of this query onto the DB

getExecutionCountback to summary
public long getExecutionCount()

Implements org.hibernate.stat.QueryStatistics.getExecutionCount.

queries executed to the DB

getExecutionMaxTimeback to summary
public long getExecutionMaxTime()

Implements org.hibernate.stat.QueryStatistics.getExecutionMaxTime.

max time in ms taken by the excution of this query onto the DB

getExecutionMinTimeback to summary
public long getExecutionMinTime()

Implements org.hibernate.stat.QueryStatistics.getExecutionMinTime.

min time in ms taken by the excution of this query onto the DB

getExecutionRowCountback to summary
public long getExecutionRowCount()

Implements org.hibernate.stat.QueryStatistics.getExecutionRowCount.

Number of lines returned by all the executions of this query (from DB) For now, org.hibernate.Query#iterate() and org.hibernate.Query#scroll()() do not fill this statistic

Returns:long

The number of rows cumulatively returned by the given query; iterate and scroll queries do not effect this total as their number of returned rows is not known at execution time.

incrementCacheHitCountback to summary
pack-priv void incrementCacheHitCount()
incrementCacheMissCountback to summary
pack-priv void incrementCacheMissCount()
incrementCachePutCountback to summary
pack-priv void incrementCachePutCount()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.