private static class DatabaseStatistics.Collector
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
DatabaseStatistics.Collector.Key
A hashable key comprised of both location information and an HQL string.
|
Modifier and Type | Field and Description |
---|---|
private Database |
database
Database for which statistics are collected
|
private java.util.Map<DatabaseStatistics.Collector.Key,DatabaseStatistics.QueryInfo> |
queryInfoMap
Map of query ctor locations and HQL statements to local query statistics
|
private org.hibernate.stat.Statistics |
statistics
Statistics from the Hibernate
SessionFactory for the database |
Constructor and Description |
---|
Collector(Database database,
org.hibernate.stat.Statistics statistics) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
collateStatistics(DatabaseStatistics.DatabaseHelper dbh)
Collate all statistics gathered by P2J queries and by Hibernate and store them in a
database for offline analysis.
|
(package private) void |
queryExecuted(DatabaseStatistics.Location location,
P2JQuery query,
java.lang.String hql)
This method is invoked just after P2J query object has executed its query.
|
private final Database database
private final org.hibernate.stat.Statistics statistics
SessionFactory
for the databaseprivate final java.util.Map<DatabaseStatistics.Collector.Key,DatabaseStatistics.QueryInfo> queryInfoMap
Collector(Database database, org.hibernate.stat.Statistics statistics)
void queryExecuted(DatabaseStatistics.Location location, P2JQuery query, java.lang.String hql)
location
- Location at which the given query was constructed.query
- P2J query object which executed its query.hql
- Dialect-specific HQL query statement which was executed.void collateStatistics(DatabaseStatistics.DatabaseHelper dbh)
dbh
- Database helper object to manage storage of statistics in the stats database.