KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > statistics > Statistics


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  *
21  */

22 package org.enhydra.dods.statistics;
23
24 import java.util.Date JavaDoc;
25
26 /**
27  * This interface provides information about table and its statistics.
28  *
29  * @author Tanja Jovanovic
30  * @author Nenad Vico
31  * @author Zorica Suvajdzin
32  * @version 2.0 15.06.2003.
33  */

34 public interface Statistics {
35
36     /**
37      * When there are no caches (data object and query caches), statistics is
38      * TABLE_STATISTICS (contains only information about tables).
39      */

40     public static final int TABLE_STATISTICS = 0;
41
42     /**
43      * When there is only data object cache (there are no query caches),
44      * statistics is CACHE_STATISTICS (contains information about tables and
45      * data object cache).
46      */

47     public static final int CACHE_STATISTICS = 1;
48
49     /**
50      * When there are both data object and query caches, statistics is
51      * QUERY_CACHE_STATISTICS (contains information about tables, data object
52      * and query caches).
53      */

54     public static final int QUERY_CACHE_STATISTICS = 2;
55
56     /**
57      * Returns type of the statistics (TABLE_STATISTICS, CACHE_STATISTICS, or
58      * QUERY_CACHE_STATISTICS).
59      *
60      * @return Type of statistics (0 if statistics is TABLE_STATISTICS, 1 if
61      * statistics is CACHE_STATISTICS, or 2 if statistics is
62      * QUERY_CACHE_STATISTICS.
63      */

64     public int getStatisticsType();
65
66     /**
67      * Returns number of insert statements performed on the table.
68      *
69      * @return Number of insert statements performed on the table.
70      */

71     public int getInsertNum();
72
73     /**
74      * Sets number of insert statements performed on the table.
75      *
76      * @param newInsertNum New number of insert statements performed on the
77      * table.
78      */

79     public void setInsertNum(int newInsertNum);
80
81     /**
82      * Increases number of insert statements performed on the table.
83      */

84     public void incrementInsertNum();
85
86     /**
87      * Returns number of update statements performed on the table.
88      *
89      * @return Number of update statements performed on the table.
90      */

91     public int getUpdateNum();
92
93     /**
94      * Sets number of update statements performed on the table.
95      *
96      * @param newUpdateNum New number of update statements performed on the
97      * table.
98      */

99     public void setUpdateNum(int newUpdateNum);
100
101     /**
102      * Increases number of update statements performed on the table.
103      */

104     public void incrementUpdateNum();
105
106     /**
107      * Returns number of delete statements performed on the table.
108      *
109      * @return Number of delete statements performed on the table.
110      */

111     public int getDeleteNum();
112
113     /**
114      * Sets number of delete statements performed on the table.
115      *
116      * @param newDeleteNum New number of delete statements performed on the
117      * table.
118      */

119     public void setDeleteNum(int newDeleteNum);
120
121     /**
122      * Increases number of delete statements performed on table.
123      */

124     public void incrementDeleteNum();
125
126     /**
127      * Returns number of DML operations (inserts, updates and deletes) performed
128      * on the table.
129      *
130      * @return Number of DML operations performed on the table.
131      */

132     public int getDMLNum();
133
134     /**
135      * Returns number of lazy loadings performed on the table.
136      *
137      * @return Number of lazy loadings performed on the table.
138      */

139     public int getLazyLoadingNum();
140
141     /**
142      * Sets number of lazy loadings performed on the table.
143      *
144      * @param newLazyLoadingNum New number of lazy loadings performed on the
145      * table.
146      */

147     public void setLazyLoadingNum(int newLazyLoadingNum);
148
149     /**
150      * Increases number of lazy loadings performed on the table for one.
151      */

152     public void incrementLazyLoadingNum();
153
154     /**
155      * Returns time when the statistics was started.
156      *
157      * @return Time when the statistics was started.
158      */

159     public Date JavaDoc getStartTime();
160
161     /**
162      * Sets time when the statistics starts.
163      *
164      * @param startTime Time when the statistics starts.
165      */

166     public void setStartTime(Date JavaDoc startTime);
167
168     /**
169      * Returns time when the statistics was stopped.
170      *
171      * @return Time when the statistics was stopped.
172      */

173     public Date JavaDoc getStopTime();
174
175     /**
176      * Sets time when the statistics stops.
177      *
178      * @param stopTime time when the statistics stops.
179      */

180     public void setStopTime(Date JavaDoc stopTime);
181
182     /**
183      * Sets stop time to current time.
184      */

185     public void stopTime();
186
187     /**
188      * Returns total number of non-oid queries performed on the table.
189      * Query by oid is query which "where" clause contains request for DO with
190      * specified oid. Non-oid query is any other query.
191      *
192      * @return Total number of non-oid queries performed on the table.
193      */

194     public int getQueryNum();
195
196     /**
197      * Sets total number of non-oid queries performed on the table.
198      * Query by oid is query which "where" clause contains request for DO with
199      * specified oid. Non-oid query is any other query.
200      *
201      * @param newQueryNum New total number of non-oid queries performed on
202      * the table.
203      */

204     public void setQueryNum(int newQueryNum);
205    
206     /**
207      * Increases total number of non-oid queries performed on the table.
208      * Query by oid is query which "where" clause contains request for DO with
209      * specified oid. Non-oid query is any other query.
210      */

211     public void incrementQueryNum();
212    
213     /**
214      * Returns total number of queries by oid performed on the table.
215      * Query by oid is query which "where" clause contains request for DO with
216      * specified oid.
217      *
218      * @return Total number of queries by oid performed on the table.
219      */

220     public int getQueryByOIdNum();
221
222     /**
223      * Sets total number of queries by oid performed on the table.
224      * Query by oid is query which "where" clause contains request for DO with
225      * specified oid.
226      *
227      * @param newQueryByOIdNum New total number of queries by oid performed on
228      * the table.
229      */

230     public void setQueryByOIdNum(int newQueryByOIdNum);
231
232     /**
233      * Increases total number of queries by oid performed on the table for one.
234      * Query by oid is query which "where" clause contains request for DO with
235      * specified oid.
236      */

237     public void incrementQueryByOIdNum();
238
239     /**
240      * Returns average time needed for executing non-oid query.
241      * Query by oid is query which "where" clause contains request for DO with
242      * specified oid. Non-oid query is any other query.
243      *
244      * @return Average time needed for executing non-oid query.
245      */

246     public int getQueryAverageTime();
247
248     /**
249      * Updates average time needed for executing non-oid queries.
250      * Query by oid is query which "where" clause contains request for DO with
251      * specified oid. Non-oid query is any other query.
252      *
253      * @param newTime New query time in miliseconds.
254      */

255     public void updateQueryAverageTime(int newTime);
256
257     /**
258      * Returns average time needed for executing query by oid.
259      * Query by oid is query which "where" clause contains request for DO with
260      * specified oid.
261      *
262      * @return Average time needed for executing oid query.
263      */

264     public int getQueryByOIdAverageTime();
265
266     /**
267      * Updates average time for executing OId queries and increments number
268      * of them by paramether <code>no</code>.
269      * Query by oid is query which "where" clause contains request for DO with
270      * specified oid.
271      *
272      * @param newTime New query time in miliseconds for no queries by OId.
273      * @param no Number of queries by OId.
274      */

275     public void updateQueryByOIdAverageTime(int newTime, int no);
276
277     /**
278      * Clears DO, simple query and complex query statistics.
279      */

280     public void clear();
281
282     /**
283      * Returns query statistics for :
284      * DO (data object) cache when cache has value 0
285      * (value rg.enhydra.dods.cache.CacheConstants.DATA_CACHE)
286      * simple query cache when cache has value 1
287      * (value org.enhydra.dods.cache.CacheConstants.SIMPLE_QUERY_CACHE)
288      * complex query cache when cache has value 2
289      * (org.enhydra.dods.cache.CacheConstants.COMPLEX_QUERY_CACHE)
290      *
291      * @param type Value 0 (org.enhydra.dods.cache.CacheConstants.DATA_CACHE)
292      * for DO (data object) cache,
293      * value 1 (org.enhydra.dods.cache.CacheConstants.SIMPLE_QUERY_CACHE) for
294      * simple query cache and value 2
295      * (org.enhydra.dods.cache.CacheConstants.COMPLEX_QUERY_CACHE) for complex
296      * query cache.
297      * @return Query statistics for DO (data object) cache, simple query or
298      * complex query cache.
299      */

300     public CacheStatistics getCacheStatistics(int type);
301 }
302
Popular Tags