DODS has the possibility of providing table and cache statistics.
The public method
get_statistics()
of the <table_name>DO.java class returns the statictics object (statistics object must implement org.enhydra.dods.statistics.Statistics interface). This object provides the following methods for the table statistics and one method for retrieving cache statistics:
getStatisticsType()
Returns type of the statistics. It returns 0 if statistics is for table that has no caching, 1 if statistics is for table with only Data caching, and 2 if statistics is for table with Query caching.
getInsertNum()
Returns number of insert statements performed on the table.
setInsertNum(int newInsertNum)
Sets number of insert statements performed on the table to value newInsertNum.
incrementInsertNum()
Increases number of insert statements performed on the table for one.
getUpdateNum()
Returns number of update statements performed on the table.
setUpdateNum(int newUpdateNum)
Sets number of update statements performed on the table to value newUpdateNum.
incrementUpdateNum()
Increases number of update statements performed on the table for one.
getDeleteNum()
Returns number of delete statements performed on the table.
setDeleteNum(int newDeleteNum)
Sets number of delete statements performed on the table to value newDeleteNum.
incrementDeleteNum()
Increases number of delete statements performed on table for one.
getDMLNum()
Returns number of DML operations (inserts, updates and deletes) performed on the table.
getLazyLoadingNum()
Returns number of lazy loadings performed on the table.
setLazyLoadingNum(int newLazyLoadingNum)
Sets number of lazy loadings performed on the table to value newLazyLoadingNum.
incrementLazyLoadingNum()
Increases number of lazy loadings performed on the table for one.
getStartTime()
Returns time when the statistics was started.
setStartTime(Date startTime)
Sets time when the statistics starts to value startTime.
getStopTime()
Returns time when the statistics was stopped.
setStopTime(Date stopTime)
Sets time when the statistics stops to value stopTime.
stopTime()
Sets stop time to current time.
getQueryNum()
Returns total number of non-oid queries performed on the table. Query by oid is query which "where" clause contains request for DO with specified oid. Non-oid query is any other query.
setQueryNum(int newQueryNum)
Sets total number of non-oid queries performed on the table to value newQueryNum.
incrementQueryNum()
Increases total number of non-oid queries performed on the table for one.
getQueryByOIdNum()
Returns total number of queries by oid performed on the table.
setQueryByOIdNum(int newQueryByOIdNum)
Sets total number of queries by oid performed on the table to value newQueryByOIdNum.
incrementQueryByOIdNum()
Increases total number of queries by oid performed on the table for one.
getQueryAverageTime()
Returns average time needed for executing non-oid query.
updateQueryAverageTime(int newTime)
Updates average time needed for executing non-oid queries to value newTime.
getQueryByOIdAverageTime()
Returns average time needed for executing query by oid.
updateQueryByOIdAverageTime(int newTime, int no)
Updates average time for executing OId queries with time newTime and increments number of them by paramether no.
clear()
Clears DO, simple query and complex query statistics.
getCacheStatistics(int type)
Returns cache statistics (objects must implement interface org.enhydra.dods.statistics.CacheStatistics) for :
DataStruct cache when parameter type equals 0
simple query cache when parameter type equals 1
complex query cache when parameter type equals 2
multi-join query cache when parameter type equals 3
Cache statistics objects have the following methods:
getCacheAccessNum()
Returns total number of times the cache was accessed.
setCacheAccessNum(int num)
Sets total number of times the cache was accessed to value num.
incrementCacheAccessNum(int num)
Increases total number of times the cache was accessed for value num.
getCacheHitsNum()
Returns number of cache accesses that were successful.
setCacheHitsNum(int cacheHitsNum)
Sets number of of cache accesses that were successful to value cacheHitsNum.
incrementCacheHitsNum(int num)
Increases number of cache accesses that were successful for value num.
getUsedPercents()
Returns how much cache is currently used. This value is given in percents. If cache is unbounded, method returns 100%.
getCacheHitsPercents()
Returns how many cache accesses were successful. This value is given in percents.
clearStatistics()
Clears statistics.