javax.cache
Interface CacheStatisticsMBean


public interface CacheStatisticsMBean

A management bean for caches.

Statistics are accumulated from the time a cache is created. They can be reset to zero using clearStatistics(). todo distributed stores - what is a miss. vendor specific consistency of stats - up to vendor free to have relaxed consistency. no locking Might be local, might be Implementations should give further guidance...

Since:
1.0
Author:
Greg Luck

Method Summary
 void clearStatistics()
          Clears the statistics counters to 0 for the associated Cache.
 long getAverageGetMillis()
          The mean time to execute gets.
 long getAveragePutMillis()
          The mean time to execute puts.
 long getAverageRemoveMillis()
          The mean time to execute removes.
 long getCacheEvictions()
          The total number of evictions from the cache.
 long getCacheGets()
          The total number of requests to the cache.
 float getCacheHitPercentage()
          getCacheHits() divided by the total number of gets.
 long getCacheHits()
          The number of get requests that were satisfied by the cache.
 long getCacheMisses()
          A miss is a get request which is not satisfied by the cache.
 float getCacheMissPercentage()
          Returns the percentage of cache accesses that did not find a requested entry in the cache.
 long getCachePuts()
          The total number of puts to the cache.
 long getCacheRemovals()
          The total number of removals from the cache.
 String getName()
           
 String getStatus()
          Gets the Status attribute of the Cache expressed as a String.
 Date statsAccumulatingFrom()
          The date from which statistics have been accumulated.
 

Method Detail

getName

String getName()
Returns:
the name of the Cache these statistics are for

getStatus

String getStatus()
Gets the Status attribute of the Cache expressed as a String.

Returns:
The status value from the Status enum class

clearStatistics

void clearStatistics()
Clears the statistics counters to 0 for the associated Cache.


statsAccumulatingFrom

Date statsAccumulatingFrom()
The date from which statistics have been accumulated. Because statistics can be cleared, this is not necessarily since the cache was started.

Returns:
the date statistics started being accumulated

getCacheHits

long getCacheHits()
The number of get requests that were satisfied by the cache.

Returns:
the number of hits

getCacheHitPercentage

float getCacheHitPercentage()
getCacheHits() divided by the total number of gets. This is a measure of cache efficiency.

Returns:
the percentage of successful hits, as a decimal

getCacheMisses

long getCacheMisses()
A miss is a get request which is not satisfied by the cache.

Returns:
the number of misses

getCacheMissPercentage

float getCacheMissPercentage()
Returns the percentage of cache accesses that did not find a requested entry in the cache.

Returns:
the percentage of accesses that failed to find anything

getCacheGets

long getCacheGets()
The total number of requests to the cache. This will be equal to the sum of the hits and misses.

A "get" is an operation that returns the current or previous value. It does not include checking for the existence of a key.

Returns:
the number of gets

getCachePuts

long getCachePuts()
The total number of puts to the cache.

A put is counted even if it is immediately evicted. A replace includes a put and remove.

Returns:
the number of hits

getCacheRemovals

long getCacheRemovals()
The total number of removals from the cache. This does not include evictions, where the cache itself initiates the removal to make space.

A replace is a put that overwrites a mapping and is not considered a remove.

Returns:
the number of hits

getCacheEvictions

long getCacheEvictions()
The total number of evictions from the cache. An eviction is a removal initiated by the cache itself to free up space. An eviction is not treated as a removal and does not appear in the removal counts.

Returns:
the number of evictions from the cache

getAverageGetMillis

long getAverageGetMillis()
The mean time to execute gets.

Returns:
the time in milliseconds

getAveragePutMillis

long getAveragePutMillis()
The mean time to execute puts.

Returns:
the time in milliseconds

getAverageRemoveMillis

long getAverageRemoveMillis()
The mean time to execute removes.

Returns:
the time in milliseconds


Copyright © 2011. All Rights Reserved.