org.modeshape.graph.connector.path.cache
Class DefaultCacheStatistics

java.lang.Object
  extended by org.modeshape.graph.connector.path.cache.DefaultCacheStatistics
All Implemented Interfaces:
CacheStatistics

@ThreadSafe
public final class DefaultCacheStatistics
extends Object
implements CacheStatistics

Default, thread-safe implementation of CacheStatistics that uses AtomicLongs as counters for the statistics.


Constructor Summary
DefaultCacheStatistics()
           
 
Method Summary
 long getExpirations()
           
 long getHits()
           
 long getMisses()
           
 long getWrites()
           
 long incrementExpirations()
           
 long incrementHits()
           
 long incrementMisses()
           
 long incrementWrites()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCacheStatistics

public DefaultCacheStatistics()
Method Detail

getWrites

public long getWrites()
Specified by:
getWrites in interface CacheStatistics
Returns:
the number of times that a node was written to the cache

getHits

public long getHits()
Specified by:
getHits in interface CacheStatistics
Returns:
the number of times that a node was retrieved from the cache

getMisses

public long getMisses()
Specified by:
getMisses in interface CacheStatistics
Returns:
the number of times that an attempt to retrieve a node from the cache failed because the node was not yet in the cache.

getExpirations

public long getExpirations()
Specified by:
getExpirations in interface CacheStatistics
Returns:
the number of times that an attempt to retrieve a node from the cache failed because the node had previously been placed in the cache, but the time to live for the node in the cache had expired

incrementWrites

public long incrementWrites()

incrementHits

public long incrementHits()

incrementMisses

public long incrementMisses()

incrementExpirations

public long incrementExpirations()


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.