2
* Hibernate, Relational Persistence for Idiomatic Java
4
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
5
* indicated by the @author tags or express copyright attribution
6
* statements applied by the authors. All third-party contributions are
7
* distributed under license by Red Hat Middleware LLC.
9
* This copyrighted material is made available to anyone wishing to use, modify,
10
* copy, or redistribute it subject to the terms and conditions of the GNU
11
* Lesser General Public License, as published by the Free Software Foundation.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
18
* You should have received a copy of the GNU Lesser General Public License
19
* along with this distribution; if not, write to:
20
* Free Software Foundation, Inc.
21
* 51 Franklin Street, Fifth Floor
22
* Boston, MA 02110-1301 USA
25
package org.hibernate.stat;
29
* Statistics for a particular <tt>SessionFactory</tt>.
30
* Beware of milliseconds metrics, they are depdendent of the JVM precision:
31
* you may then encounter a 10 ms approximation dending on you OS platform.
32
* Please refer to the JVM documentation for more information.
34
* @author Emmanuel Bernard
36
public interface Statistics {
38
* reset all statistics
43
* find entity statistics per name
45
* @param entityName entity name
46
* @return EntityStatistics object
48
public EntityStatistics getEntityStatistics(String entityName);
50
* Get collection statistics per role
52
* @param role collection role
53
* @return CollectionStatistics
55
public CollectionStatistics getCollectionStatistics(String role);
58
* Second level cache statistics per region
60
* @param regionName region name
61
* @return SecondLevelCacheStatistics
63
public SecondLevelCacheStatistics getSecondLevelCacheStatistics(String regionName);
66
* Query statistics from query string (HQL or SQL)
68
* @param queryString query string
69
* @return QueryStatistics
71
public QueryStatistics getQueryStatistics(String queryString);
74
* Get global number of entity deletes
75
* @return entity deletion count
77
public long getEntityDeleteCount();
80
* Get global number of entity inserts
81
* @return entity insertion count
83
public long getEntityInsertCount();
86
* Get global number of entity loads
87
* @return entity load (from DB)
89
public long getEntityLoadCount();
91
* Get global number of entity fetchs
92
* @return entity fetch (from DB)
94
public long getEntityFetchCount();
97
* Get global number of entity updates
98
* @return entity update
100
public long getEntityUpdateCount();
103
* Get global number of executed queries
104
* @return query execution count
106
public long getQueryExecutionCount();
109
* Get the time in milliseconds of the slowest query.
111
public long getQueryExecutionMaxTime();
113
* Get the query string for the slowest query.
115
public String getQueryExecutionMaxTimeQueryString();
118
* Get the global number of cached queries successfully retrieved from cache
120
public long getQueryCacheHitCount();
122
* Get the global number of cached queries *not* found in cache
124
public long getQueryCacheMissCount();
126
* Get the global number of cacheable queries put in cache
128
public long getQueryCachePutCount();
130
* Get the global number of flush executed by sessions (either implicit or explicit)
132
public long getFlushCount();
134
* Get the global number of connections asked by the sessions
135
* (the actual number of connections used may be much smaller depending
136
* whether you use a connection pool or not)
138
public long getConnectCount();
140
* Global number of cacheable entities/collections successfully retrieved from the cache
142
public long getSecondLevelCacheHitCount();
144
* Global number of cacheable entities/collections not found in the cache and loaded from the database.
146
public long getSecondLevelCacheMissCount();
148
* Global number of cacheable entities/collections put in the cache
150
public long getSecondLevelCachePutCount();
152
* Global number of sessions closed
154
public long getSessionCloseCount();
156
* Global number of sessions opened
158
public long getSessionOpenCount();
160
* Global number of collections loaded
162
public long getCollectionLoadCount();
164
* Global number of collections fetched
166
public long getCollectionFetchCount();
168
* Global number of collections updated
170
public long getCollectionUpdateCount();
172
* Global number of collections removed
174
//even on inverse="true"
175
public long getCollectionRemoveCount();
177
* Global number of collections recreated
179
public long getCollectionRecreateCount();
181
* @return start time in ms (JVM standards {@link System#currentTimeMillis()})
183
public long getStartTime();
185
* log in info level the main statistics
187
public void logSummary();
189
* Are statistics logged
191
public boolean isStatisticsEnabled();
193
* Enable statistics logs (this is a dynamic parameter)
195
public void setStatisticsEnabled(boolean b);
198
* Get all executed query strings
200
public String[] getQueries();
202
* Get the names of all entities
204
public String[] getEntityNames();
206
* Get the names of all collection roles
208
public String[] getCollectionRoleNames();
210
* Get all second-level cache region names
212
public String[] getSecondLevelCacheRegionNames();
214
* The number of transactions we know to have been successful
216
public long getSuccessfulTransactionCount();
218
* The number of transactions we know to have completed
220
public long getTransactionCount();
222
* The number of prepared statements that were acquired
224
public long getPrepareStatementCount();
226
* The number of prepared statements that were released
228
public long getCloseStatementCount();
230
* The number of <tt>StaleObjectStateException</tt>s
233
public long getOptimisticFailureCount();
b'\\ No newline at end of file'