Package org.hibernate.stat.internal
Class QueryStatisticsImpl
- java.lang.Object
-
- org.hibernate.stat.internal.QueryStatisticsImpl
-
- All Implemented Interfaces:
Serializable,QueryStatistics
public class QueryStatisticsImpl extends Object implements QueryStatistics
Query statistics (HQL and SQL)Note that for a cached query, the cache miss is equals to the db count
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QueryStatisticsImpl(String query)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecuted(long rows, long time)add statistics report of a DB querylonggetCacheHitCount()Queries retrieved successfully from the cachelonggetCacheMissCount()The number of cache misses for this querylonggetCachePutCount()The number of cache puts for this querylonggetExecutionAvgTime()average time in ms taken by the execution of this query onto the DBdoublegetExecutionAvgTimeAsDouble()average time in ms as double taken by the execution of this query onto the DBlonggetExecutionCount()queries executed to the DBlonggetExecutionMaxTime()max time in ms taken by the execution of this query onto the DBlonggetExecutionMinTime()min time in ms taken by the execution of this query onto the DBlonggetExecutionRowCount()Number of lines returned by all the executions of this query (from DB) For now,Query.stream()} andQuery.scroll()do not fill this statisticlonggetExecutionTotalTime()total time in ms taken by the execution of this query onto the DBlonggetPlanCacheHitCount()Query plan successfully fetched from the cachelonggetPlanCacheMissCount()Query plan not fetched from the cachelonggetPlanCompilationTotalMicroseconds()Query plan overall compiled totalStringtoString()
-
-
-
Constructor Detail
-
QueryStatisticsImpl
public QueryStatisticsImpl(String query)
-
-
Method Detail
-
getExecutionCount
public long getExecutionCount()
queries executed to the DB- Specified by:
getExecutionCountin interfaceQueryStatistics
-
getCacheHitCount
public long getCacheHitCount()
Queries retrieved successfully from the cache- Specified by:
getCacheHitCountin interfaceQueryStatistics
-
getCachePutCount
public long getCachePutCount()
Description copied from interface:QueryStatisticsThe number of cache puts for this query- Specified by:
getCachePutCountin interfaceQueryStatistics
-
getCacheMissCount
public long getCacheMissCount()
Description copied from interface:QueryStatisticsThe number of cache misses for this query- Specified by:
getCacheMissCountin interfaceQueryStatistics
-
getExecutionRowCount
public long getExecutionRowCount()
Number of lines returned by all the executions of this query (from DB) For now,Query.stream()} andQuery.scroll()do not fill this statistic- Specified by:
getExecutionRowCountin interfaceQueryStatistics- Returns:
- The number of rows cumulatively returned by the given query; stream and scroll queries do not effect this total as their number of returned rows is not known at execution time.
-
getExecutionAvgTime
public long getExecutionAvgTime()
average time in ms taken by the execution of this query onto the DB- Specified by:
getExecutionAvgTimein interfaceQueryStatistics
-
getExecutionAvgTimeAsDouble
public double getExecutionAvgTimeAsDouble()
average time in ms as double taken by the execution of this query onto the DB- Specified by:
getExecutionAvgTimeAsDoublein interfaceQueryStatistics
-
getExecutionMaxTime
public long getExecutionMaxTime()
max time in ms taken by the execution of this query onto the DB- Specified by:
getExecutionMaxTimein interfaceQueryStatistics
-
getExecutionMinTime
public long getExecutionMinTime()
min time in ms taken by the execution of this query onto the DB- Specified by:
getExecutionMinTimein interfaceQueryStatistics
-
getExecutionTotalTime
public long getExecutionTotalTime()
total time in ms taken by the execution of this query onto the DB- Specified by:
getExecutionTotalTimein interfaceQueryStatistics
-
getPlanCacheHitCount
public long getPlanCacheHitCount()
Query plan successfully fetched from the cache- Specified by:
getPlanCacheHitCountin interfaceQueryStatistics
-
getPlanCacheMissCount
public long getPlanCacheMissCount()
Query plan not fetched from the cache- Specified by:
getPlanCacheMissCountin interfaceQueryStatistics
-
getPlanCompilationTotalMicroseconds
public long getPlanCompilationTotalMicroseconds()
Query plan overall compiled total- Specified by:
getPlanCompilationTotalMicrosecondsin interfaceQueryStatistics
-
executed
public void executed(long rows, long time)add statistics report of a DB query- Parameters:
rows- rows count returnedtime- time taken
-
-