|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.storage.cache.Accounting
Keeps track of various cache parameters. Most important, this class is used to determine if a cache should be grown by computing the cache efficiency, which is expressed as the amount of trashing that occurs during a certain period of time. Trashing occurs if a page is replaced from the cache and is reloaded shortly after. For the B+-tree pages, we normally don't want any trashing at all.
Constructor Summary | |
Accounting(double thrashingFactor)
|
Method Summary | |
int |
getHits()
Returns the number of total cache hits during the lifetime of the cache. |
int |
getMisses()
Returns the number of total cache faults. |
int |
getThrashing()
Return the current amount of trashing. |
void |
hitIncrement()
Increment the number of total cache hits by one. |
void |
missesIncrement()
Increment the number of total cache faults by one. |
void |
replacedPage(Cacheable cacheable)
Called by the cache to signal that a page was replaced in order to store the Cacheable object passed. |
void |
reset()
|
boolean |
resizeNeeded()
Returns true if a cache resize would increase the cache efficiency. |
void |
setTotalSize(int totalSize)
Set the current size of the cache. |
void |
stats()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Accounting(double thrashingFactor)
Method Detail |
public void setTotalSize(int totalSize)
totalSize
- public void hitIncrement()
public int getHits()
public void missesIncrement()
public int getMisses()
public void replacedPage(Cacheable cacheable)
cacheable
- public int getThrashing()
public boolean resizeNeeded()
public void reset()
public void stats()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |