Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.controller.cache.CacheStatistics Class Reference

List of all members.

Public Member Functions

 CacheStatistics ()
void reset ()
int getCreate ()
int getDelete ()
int getDrop ()
int getHits ()
int getInsert ()
int getRemove ()
int getSelect ()
int getUnknown ()
int getUpdate ()
int getUncacheable ()
void addCreate ()
void addDelete ()
void addDrop ()
void addHits ()
void addInsert ()
void addRemove ()
void addSelect ()
void addUnknown ()
void addUpdate ()
void addUncacheable ()
String[] getCacheStatsData ()
long getCacheHitRatio ()

Detailed Description

This class handles the statistics for request caches.

Author:
Emmanuel Cecchet
Version:
1.0

Definition at line 35 of file CacheStatistics.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.controller.cache.CacheStatistics.CacheStatistics  ) 
 

Creates a new CacheStatistics object.

Definition at line 52 of file CacheStatistics.java.

00053   {
00054     select = new Stats("select");
00055     hits = new Stats("hits");
00056     insert = new Stats("insert");
00057     update = new Stats("update");
00058     uncacheable = new Stats("uncacheable");
00059     delete = new Stats("delete");
00060     unknown = new Stats("unknown");
00061     remove = new Stats("remove");
00062     create = new Stats("create");
00063     drop = new Stats("drop");
00064   }


Member Function Documentation

void org.objectweb.cjdbc.controller.cache.CacheStatistics.addCreate  ) 
 

Increments the create count.

Definition at line 186 of file CacheStatistics.java.

00187   {
00188     create.incrementCount();
00189   }

void org.objectweb.cjdbc.controller.cache.CacheStatistics.addDelete  ) 
 

Increments the delete count.

Definition at line 194 of file CacheStatistics.java.

00195   {
00196     delete.incrementCount();
00197   }

void org.objectweb.cjdbc.controller.cache.CacheStatistics.addDrop  ) 
 

Increments the drop count.

Definition at line 202 of file CacheStatistics.java.

00203   {
00204     drop.incrementCount();
00205   }

void org.objectweb.cjdbc.controller.cache.CacheStatistics.addHits  ) 
 

Increments the hits count.

Definition at line 210 of file CacheStatistics.java.

00211   {
00212     hits.incrementCount();
00213   }

void org.objectweb.cjdbc.controller.cache.CacheStatistics.addInsert  ) 
 

Increments the insert count.

Definition at line 218 of file CacheStatistics.java.

00219   {
00220     insert.incrementCount();
00221   }

void org.objectweb.cjdbc.controller.cache.CacheStatistics.addRemove  ) 
 

Increments the remove count.

Definition at line 226 of file CacheStatistics.java.

00227   {
00228     remove.incrementCount();
00229   }

void org.objectweb.cjdbc.controller.cache.CacheStatistics.addSelect  ) 
 

Increments the select count.

Definition at line 234 of file CacheStatistics.java.

00235   {
00236     select.incrementCount();
00237   }

void org.objectweb.cjdbc.controller.cache.CacheStatistics.addUncacheable  ) 
 

Increments the uncacheable count.

Definition at line 258 of file CacheStatistics.java.

00259   {
00260     uncacheable.incrementCount();
00261   }

void org.objectweb.cjdbc.controller.cache.CacheStatistics.addUnknown  ) 
 

Increments the unkwnown count.

Definition at line 242 of file CacheStatistics.java.

00243   {
00244     unknown.incrementCount();
00245   }

void org.objectweb.cjdbc.controller.cache.CacheStatistics.addUpdate  ) 
 

Increments the update count.

Definition at line 250 of file CacheStatistics.java.

00251   {
00252     update.incrementCount();
00253   }

long org.objectweb.cjdbc.controller.cache.CacheStatistics.getCacheHitRatio  ) 
 

Get percentage of hits

Returns:
hits / select

Definition at line 291 of file CacheStatistics.java.

00292   {
00293     if (select.getCount() == 0)
00294       return 0;
00295     else
00296       return (long) ((float) hits.getCount() / (float) select.getCount() * 100.0);
00297   }

String [] org.objectweb.cjdbc.controller.cache.CacheStatistics.getCacheStatsData  ) 
 

Retrieve cache statistics as a table

Returns:
an array of String containing the different cache values, like number of select, number of hits ...

Definition at line 269 of file CacheStatistics.java.

00270   {
00271     String[] stats = new String[11];
00272     stats[0] = "" + getSelect();
00273     stats[1] = "" + getHits();
00274     stats[2] = "" + getInsert();
00275     stats[3] = "" + getUpdate();
00276     stats[4] = "" + getUncacheable();
00277     stats[5] = "" + getDelete();
00278     stats[6] = "" + getUnknown();
00279     stats[7] = "" + getRemove();
00280     stats[8] = "" + getCreate();
00281     stats[9] = "" + getDrop();
00282     stats[10] = "" + getCacheHitRatio();
00283     return stats;
00284   }

int org.objectweb.cjdbc.controller.cache.CacheStatistics.getCreate  ) 
 

Returns the create.

Returns:
an int value

Definition at line 88 of file CacheStatistics.java.

00089   {
00090     return create.getCount();
00091   }

int org.objectweb.cjdbc.controller.cache.CacheStatistics.getDelete  ) 
 

Returns the delete.

Returns:
an int value

Definition at line 98 of file CacheStatistics.java.

00099   {
00100     return delete.getCount();
00101   }

int org.objectweb.cjdbc.controller.cache.CacheStatistics.getDrop  ) 
 

Returns the drop.

Returns:
an int value

Definition at line 108 of file CacheStatistics.java.

00109   {
00110     return drop.getCount();
00111   }

int org.objectweb.cjdbc.controller.cache.CacheStatistics.getHits  ) 
 

Returns the hits.

Returns:
an int value

Definition at line 118 of file CacheStatistics.java.

00119   {
00120     return hits.getCount();
00121   }

int org.objectweb.cjdbc.controller.cache.CacheStatistics.getInsert  ) 
 

Returns the insert.

Returns:
an int value

Definition at line 128 of file CacheStatistics.java.

00129   {
00130     return insert.getCount();
00131   }

int org.objectweb.cjdbc.controller.cache.CacheStatistics.getRemove  ) 
 

Returns the remove.

Returns:
an int value

Definition at line 138 of file CacheStatistics.java.

00139   {
00140     return remove.getCount();
00141   }

int org.objectweb.cjdbc.controller.cache.CacheStatistics.getSelect  ) 
 

Returns the select.

Returns:
an int value

Definition at line 148 of file CacheStatistics.java.

00149   {
00150     return select.getCount();
00151   }

int org.objectweb.cjdbc.controller.cache.CacheStatistics.getUncacheable  ) 
 

Returns the uncacheable.

Returns:
an int value

Definition at line 178 of file CacheStatistics.java.

00179   {
00180     return uncacheable.getCount();
00181   }

int org.objectweb.cjdbc.controller.cache.CacheStatistics.getUnknown  ) 
 

Returns the unknown.

Returns:
an int value

Definition at line 158 of file CacheStatistics.java.

00159   {
00160     return unknown.getCount();
00161   }

int org.objectweb.cjdbc.controller.cache.CacheStatistics.getUpdate  ) 
 

Returns the update.

Returns:
an int value

Definition at line 168 of file CacheStatistics.java.

00169   {
00170     return update.getCount();
00171   }

void org.objectweb.cjdbc.controller.cache.CacheStatistics.reset  ) 
 

Resets all stats to zero.

Definition at line 69 of file CacheStatistics.java.

00070   {
00071     select.reset();
00072     hits.reset();
00073     insert.reset();
00074     update.reset();
00075     uncacheable.reset();
00076     delete.reset();
00077     unknown.reset();
00078     remove.reset();
00079     create.reset();
00080     drop.reset();
00081   }


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:03:27 2005 for C-JDBC by  doxygen 1.3.9.1