Package org.hibernate.stat.internal
Class QueryStatisticsImpl
java.lang.Object
org.hibernate.stat.internal.QueryStatisticsImpl
- All Implemented Interfaces:
Serializable
,QueryStatistics
Query statistics (HQL and SQL)
Note that for a cached query, the cache miss is equals to the db count
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
executed
(long rows, long time) add statistics report of a DB querylong
Queries retrieved successfully from the cachelong
The number of cache misses for this querylong
The number of cache puts for this querylong
average time in ms taken by the execution of this query onto the DBdouble
average time in ms as double taken by the execution of this query onto the DBlong
queries executed to the DBlong
max time in ms taken by the execution of this query onto the DBlong
min time in ms taken by the execution of this query onto the DBlong
Number of lines returned by all the executions of this query (from DB) For now,Query.stream()
} andQuery.scroll()
do not fill this statisticlong
total time in ms taken by the execution of this query onto the DBlong
Query plan successfully fetched from the cachelong
Query plan not fetched from the cachelong
Query plan overall compiled totaltoString()
-
Constructor Details
-
QueryStatisticsImpl
-
-
Method Details
-
getExecutionCount
public long getExecutionCount()queries executed to the DB- Specified by:
getExecutionCount
in interfaceQueryStatistics
-
getCacheHitCount
public long getCacheHitCount()Queries retrieved successfully from the cache- Specified by:
getCacheHitCount
in interfaceQueryStatistics
-
getCachePutCount
public long getCachePutCount()Description copied from interface:QueryStatistics
The number of cache puts for this query- Specified by:
getCachePutCount
in interfaceQueryStatistics
-
getCacheMissCount
public long getCacheMissCount()Description copied from interface:QueryStatistics
The number of cache misses for this query- Specified by:
getCacheMissCount
in 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:
getExecutionRowCount
in 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:
getExecutionAvgTime
in interfaceQueryStatistics
-
getExecutionAvgTimeAsDouble
public double getExecutionAvgTimeAsDouble()average time in ms as double taken by the execution of this query onto the DB- Specified by:
getExecutionAvgTimeAsDouble
in interfaceQueryStatistics
-
getExecutionMaxTime
public long getExecutionMaxTime()max time in ms taken by the execution of this query onto the DB- Specified by:
getExecutionMaxTime
in interfaceQueryStatistics
-
getExecutionMinTime
public long getExecutionMinTime()min time in ms taken by the execution of this query onto the DB- Specified by:
getExecutionMinTime
in interfaceQueryStatistics
-
getExecutionTotalTime
public long getExecutionTotalTime()total time in ms taken by the execution of this query onto the DB- Specified by:
getExecutionTotalTime
in interfaceQueryStatistics
-
getPlanCacheHitCount
public long getPlanCacheHitCount()Query plan successfully fetched from the cache- Specified by:
getPlanCacheHitCount
in interfaceQueryStatistics
-
getPlanCacheMissCount
public long getPlanCacheMissCount()Query plan not fetched from the cache- Specified by:
getPlanCacheMissCount
in interfaceQueryStatistics
-
getPlanCompilationTotalMicroseconds
public long getPlanCompilationTotalMicroseconds()Query plan overall compiled total- Specified by:
getPlanCompilationTotalMicroseconds
in interfaceQueryStatistics
-
executed
public void executed(long rows, long time) add statistics report of a DB query- Parameters:
rows
- rows count returnedtime
- time taken
-
toString
-