~raginggoblin/infolog/infolog

« back to all changes in this revision

Viewing changes to InfologServer/lib/hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/stat/Statistics.java

  • Committer: Raging Goblin
  • Date: 2013-11-16 16:51:32 UTC
  • Revision ID: raging_goblin-20131116165132-weujnptzc88uy4ah
Mavenized the project, now using shared project InfologSync

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Hibernate, Relational Persistence for Idiomatic Java
3
 
 *
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.
8
 
 *
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.
12
 
 *
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
16
 
 * for more details.
17
 
 *
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
23
 
 *
24
 
 */
25
 
package org.hibernate.stat;
26
 
 
27
 
 
28
 
/**
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.
33
 
 * 
34
 
 * @author Emmanuel Bernard
35
 
 */
36
 
public interface Statistics {
37
 
        /**
38
 
         * reset all statistics
39
 
         */
40
 
        public void clear();
41
 
 
42
 
    /**
43
 
         * find entity statistics per name
44
 
         * 
45
 
         * @param entityName entity name
46
 
         * @return EntityStatistics object
47
 
         */
48
 
        public EntityStatistics getEntityStatistics(String entityName);
49
 
        /**
50
 
         * Get collection statistics per role
51
 
         * 
52
 
         * @param role collection role
53
 
         * @return CollectionStatistics
54
 
         */
55
 
        public CollectionStatistics getCollectionStatistics(String role);
56
 
 
57
 
    /**
58
 
         * Second level cache statistics per region
59
 
         * 
60
 
         * @param regionName region name
61
 
         * @return SecondLevelCacheStatistics
62
 
         */
63
 
        public SecondLevelCacheStatistics getSecondLevelCacheStatistics(String regionName);
64
 
 
65
 
    /**
66
 
         * Query statistics from query string (HQL or SQL)
67
 
         * 
68
 
         * @param queryString query string
69
 
         * @return QueryStatistics
70
 
         */
71
 
        public QueryStatistics getQueryStatistics(String queryString);
72
 
 
73
 
    /**
74
 
     * Get global number of entity deletes
75
 
         * @return entity deletion count
76
 
         */
77
 
        public long getEntityDeleteCount();
78
 
 
79
 
    /**
80
 
     * Get global number of entity inserts
81
 
         * @return entity insertion count
82
 
         */
83
 
        public long getEntityInsertCount();
84
 
 
85
 
    /**
86
 
     * Get global number of entity loads
87
 
         * @return entity load (from DB)
88
 
         */
89
 
        public long getEntityLoadCount();
90
 
        /**
91
 
     * Get global number of entity fetchs
92
 
         * @return entity fetch (from DB)
93
 
         */
94
 
        public long getEntityFetchCount();
95
 
 
96
 
        /**
97
 
     * Get global number of entity updates
98
 
         * @return entity update
99
 
         */
100
 
        public long getEntityUpdateCount();
101
 
 
102
 
    /**
103
 
     * Get global number of executed queries
104
 
         * @return query execution count
105
 
         */
106
 
        public long getQueryExecutionCount();
107
 
 
108
 
    /**
109
 
     * Get the time in milliseconds of the slowest query.
110
 
     */
111
 
        public long getQueryExecutionMaxTime();
112
 
        /**
113
 
         * Get the query string for the slowest query.
114
 
         */
115
 
        public String getQueryExecutionMaxTimeQueryString();
116
 
 
117
 
    /**
118
 
     * Get the global number of cached queries successfully retrieved from cache
119
 
     */
120
 
        public long getQueryCacheHitCount();
121
 
    /**
122
 
     * Get the global number of cached queries *not* found in cache
123
 
     */
124
 
        public long getQueryCacheMissCount();
125
 
    /**
126
 
     * Get the global number of cacheable queries put in cache
127
 
     */
128
 
        public long getQueryCachePutCount();
129
 
        /**
130
 
     * Get the global number of flush executed by sessions (either implicit or explicit)
131
 
     */
132
 
        public long getFlushCount();
133
 
        /**
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)
137
 
         */
138
 
        public long getConnectCount();
139
 
        /**
140
 
     * Global number of cacheable entities/collections successfully retrieved from the cache
141
 
     */
142
 
        public long getSecondLevelCacheHitCount();
143
 
        /**
144
 
     * Global number of cacheable entities/collections not found in the cache and loaded from the database.
145
 
     */
146
 
        public long getSecondLevelCacheMissCount();
147
 
        /**
148
 
         * Global number of cacheable entities/collections put in the cache
149
 
         */
150
 
        public long getSecondLevelCachePutCount();
151
 
        /**
152
 
         * Global number of sessions closed
153
 
         */
154
 
        public long getSessionCloseCount();
155
 
        /**
156
 
         * Global number of sessions opened
157
 
         */
158
 
        public long getSessionOpenCount();
159
 
        /**
160
 
         * Global number of collections loaded
161
 
         */
162
 
        public long getCollectionLoadCount();
163
 
        /**
164
 
         * Global number of collections fetched
165
 
         */
166
 
        public long getCollectionFetchCount();
167
 
        /**
168
 
         * Global number of collections updated
169
 
         */
170
 
        public long getCollectionUpdateCount();
171
 
        /**
172
 
         * Global number of collections removed
173
 
         */
174
 
    //even on inverse="true"
175
 
        public long getCollectionRemoveCount();
176
 
        /**
177
 
         * Global number of collections recreated
178
 
         */
179
 
        public long getCollectionRecreateCount();
180
 
        /**
181
 
         * @return start time in ms (JVM standards {@link System#currentTimeMillis()})
182
 
         */
183
 
        public long getStartTime();
184
 
        /**
185
 
         * log in info level the main statistics
186
 
         */
187
 
        public void logSummary();
188
 
        /**
189
 
         * Are statistics logged
190
 
         */
191
 
        public boolean isStatisticsEnabled();
192
 
        /**
193
 
         * Enable statistics logs (this is a dynamic parameter)
194
 
         */
195
 
        public void setStatisticsEnabled(boolean b);
196
 
 
197
 
        /**
198
 
         * Get all executed query strings
199
 
         */
200
 
        public String[] getQueries();
201
 
        /**
202
 
         * Get the names of all entities
203
 
         */
204
 
        public String[] getEntityNames();
205
 
        /**
206
 
         * Get the names of all collection roles
207
 
         */
208
 
        public String[] getCollectionRoleNames();
209
 
        /**
210
 
         * Get all second-level cache region names
211
 
         */
212
 
        public String[] getSecondLevelCacheRegionNames();
213
 
        /**
214
 
         * The number of transactions we know to have been successful
215
 
         */
216
 
        public long getSuccessfulTransactionCount();
217
 
        /**
218
 
         * The number of transactions we know to have completed
219
 
         */
220
 
        public long getTransactionCount();
221
 
        /**
222
 
         * The number of prepared statements that were acquired
223
 
         */
224
 
        public long getPrepareStatementCount();
225
 
        /**
226
 
         * The number of prepared statements that were released
227
 
         */
228
 
        public long getCloseStatementCount();
229
 
        /**
230
 
         * The number of <tt>StaleObjectStateException</tt>s 
231
 
         * that occurred
232
 
         */
233
 
        public long getOptimisticFailureCount();
234
 
}
 
 
b'\\ No newline at end of file'