org.objectweb.cjdbc.controller.cache
Class CacheStatistics

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.cache.CacheStatistics

public class CacheStatistics
extends java.lang.Object

This class handles the statistics for request caches.

Version:
1.0
Author:
Emmanuel Cecchet

Field Summary
private  Stats create
           
private  Stats delete
           
private  Stats drop
           
private  Stats hits
           
private  Stats insert
           
private  Stats remove
           
private  Stats select
           
private  Stats uncacheable
           
private  Stats unknown
           
private  Stats update
           
 
Constructor Summary
CacheStatistics()
          Creates a new CacheStatistics object.
 
Method Summary
 void addCreate()
          Increments the create count.
 void addDelete()
          Increments the delete count.
 void addDrop()
          Increments the drop count.
 void addHits()
          Increments the hits count.
 void addInsert()
          Increments the insert count.
 void addRemove()
          Increments the remove count.
 void addSelect()
          Increments the select count.
 void addUncacheable()
          Increments the uncacheable count.
 void addUnknown()
          Increments the unkwnown count.
 void addUpdate()
          Increments the update count.
 long getCacheHitRatio()
          Get percentage of hits
 java.lang.String[] getCacheStatsData()
          Retrieve cache statistics as a table
 int getCreate()
          Returns the create.
 int getDelete()
          Returns the delete.
 int getDrop()
          Returns the drop.
 int getHits()
          Returns the hits.
 int getInsert()
          Returns the insert.
 int getRemove()
          Returns the remove.
 int getSelect()
          Returns the select.
 int getUncacheable()
          Returns the uncacheable.
 int getUnknown()
          Returns the unknown.
 int getUpdate()
          Returns the update.
 void reset()
          Resets all stats to zero.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

select

private Stats select

hits

private Stats hits

insert

private Stats insert

update

private Stats update

uncacheable

private Stats uncacheable

delete

private Stats delete

unknown

private Stats unknown

remove

private Stats remove

create

private Stats create

drop

private Stats drop
Constructor Detail

CacheStatistics

public CacheStatistics()
Creates a new CacheStatistics object.

Method Detail

reset

public void reset()
Resets all stats to zero.


getCreate

public int getCreate()
Returns the create.

Returns:
an int value

getDelete

public int getDelete()
Returns the delete.

Returns:
an int value

getDrop

public int getDrop()
Returns the drop.

Returns:
an int value

getHits

public int getHits()
Returns the hits.

Returns:
an int value

getInsert

public int getInsert()
Returns the insert.

Returns:
an int value

getRemove

public int getRemove()
Returns the remove.

Returns:
an int value

getSelect

public int getSelect()
Returns the select.

Returns:
an int value

getUnknown

public int getUnknown()
Returns the unknown.

Returns:
an int value

getUpdate

public int getUpdate()
Returns the update.

Returns:
an int value

getUncacheable

public int getUncacheable()
Returns the uncacheable.

Returns:
an int value

addCreate

public void addCreate()
Increments the create count.


addDelete

public void addDelete()
Increments the delete count.


addDrop

public void addDrop()
Increments the drop count.


addHits

public void addHits()
Increments the hits count.


addInsert

public void addInsert()
Increments the insert count.


addRemove

public void addRemove()
Increments the remove count.


addSelect

public void addSelect()
Increments the select count.


addUnknown

public void addUnknown()
Increments the unkwnown count.


addUpdate

public void addUpdate()
Increments the update count.


addUncacheable

public void addUncacheable()
Increments the uncacheable count.


getCacheStatsData

public java.lang.String[] getCacheStatsData()
Retrieve cache statistics as a table

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

getCacheHitRatio

public long getCacheHitRatio()
Get percentage of hits

Returns:
hits / select


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.