blob: 6fff44e735a9e0b6c47a26aefb5f8df979f717bb [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<link rel="canonical" href="https://ignite.apache.org/jcache/1.0.0/javadoc/javax/cache/management/CacheStatisticsMXBean.html" />
<!-- Generated by javadoc (version 1.7.0_25) on Fri Mar 28 13:34:25 EST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>CacheStatisticsMXBean (JSR107 API and SPI 1.0.0 API)</title>
<meta name="date" content="2014-03-28">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-61232409-1', 'auto');
ga('send', 'pageview');
</script></head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="CacheStatisticsMXBean (JSR107 API and SPI 1.0.0 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CacheStatisticsMXBean.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javax/cache/management/CacheMXBean.html" title="interface in javax.cache.management"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/cache/management/CacheStatisticsMXBean.html" target="_top">Frames</a></li>
<li><a href="CacheStatisticsMXBean.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">javax.cache.management</div>
<h2 title="Interface CacheStatisticsMXBean" class="title">Interface CacheStatisticsMXBean</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre><a href="http://download.oracle.com/javase/6/docs/api/javax/management/MXBean.html?is-external=true" title="class or interface in javax.management">@MXBean</a>
public interface <span class="strong">CacheStatisticsMXBean</span></pre>
<div class="block">Cache statistics.
<p>
Statistics are accumulated from the time a cache is created. They can be reset
to zero using <a href="../../../javax/cache/management/CacheStatisticsMXBean.html#clear()"><code>clear()</code></a>.
<p>
There are no defined consistency semantics for statistics. Refer to the
implementation for precise semantics.
<p>
Each cache's statistics object must be registered with an ObjectName that is
unique and has the following type and attributes:
<p>
Type:
<code>javax.cache:type=CacheStatistics</code>
<p>
Required Attributes:
<ul>
<li>CacheManager the URI of the CacheManager
<li>Cache the name of the Cache
</ul></div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>1.0</dd>
<dt><span class="strong">Author:</span></dt>
<dd>Greg Luck</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/management/CacheStatisticsMXBean.html#clear()">clear</a></strong>()</code>
<div class="block">Clears the statistics counters to 0 for the associated Cache.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getAverageGetTime()">getAverageGetTime</a></strong>()</code>
<div class="block">The mean time to execute gets.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getAveragePutTime()">getAveragePutTime</a></strong>()</code>
<div class="block">The mean time to execute puts.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getAverageRemoveTime()">getAverageRemoveTime</a></strong>()</code>
<div class="block">The mean time to execute removes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getCacheEvictions()">getCacheEvictions</a></strong>()</code>
<div class="block">The total number of evictions from the cache.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getCacheGets()">getCacheGets</a></strong>()</code>
<div class="block">The total number of requests to the cache.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getCacheHitPercentage()">getCacheHitPercentage</a></strong>()</code>
<div class="block">This is a measure of cache efficiency.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getCacheHits()">getCacheHits</a></strong>()</code>
<div class="block">The number of get requests that were satisfied by the cache.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getCacheMisses()">getCacheMisses</a></strong>()</code>
<div class="block">A miss is a get request that is not satisfied.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getCacheMissPercentage()">getCacheMissPercentage</a></strong>()</code>
<div class="block">Returns the percentage of cache accesses that did not find a requested entry
in the cache.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getCachePuts()">getCachePuts</a></strong>()</code>
<div class="block">The total number of puts to the cache.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getCacheRemovals()">getCacheRemovals</a></strong>()</code>
<div class="block">The total number of removals from the cache.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="clear()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clear</h4>
<pre>void&nbsp;clear()</pre>
<div class="block">Clears the statistics counters to 0 for the associated Cache.</div>
</li>
</ul>
<a name="getCacheHits()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCacheHits</h4>
<pre>long&nbsp;getCacheHits()</pre>
<div class="block">The number of get requests that were satisfied by the cache.
<p>
<a href="../../../javax/cache/Cache.html#containsKey(K)"><code>Cache.containsKey(Object)</code></a> is not a get request for
statistics purposes.
<p>
In a caches with multiple tiered storage, a hit may be implemented as a hit
to the cache or to the first tier.
<p>
For an <a href="../../../javax/cache/processor/EntryProcessor.html" title="interface in javax.cache.processor"><code>EntryProcessor</code></a>, a hit occurs when the
key exists and an entry processor can be invoked against it, even if no
methods of <a href="../../../javax/cache/Cache.Entry.html" title="interface in javax.cache"><code>Cache.Entry</code></a> or
<a href="../../../javax/cache/processor/MutableEntry.html" title="interface in javax.cache.processor"><code>MutableEntry</code></a> are called.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the number of hits</dd></dl>
</li>
</ul>
<a name="getCacheHitPercentage()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCacheHitPercentage</h4>
<pre>float&nbsp;getCacheHitPercentage()</pre>
<div class="block">This is a measure of cache efficiency.
<p>
It is calculated as:
<a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getCacheHits()"><code>getCacheHits()</code></a> divided by <a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getCacheGets()"><code>()</code></a> * 100.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the percentage of successful hits, as a decimal e.g 75.</dd></dl>
</li>
</ul>
<a name="getCacheMisses()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCacheMisses</h4>
<pre>long&nbsp;getCacheMisses()</pre>
<div class="block">A miss is a get request that is not satisfied.
<p>
In a simple cache a miss occurs when the cache does not satisfy the request.
<p>
<a href="../../../javax/cache/Cache.html#containsKey(K)"><code>Cache.containsKey(Object)</code></a> is not a get request for
statistics purposes.
<p>
For an <a href="../../../javax/cache/processor/EntryProcessor.html" title="interface in javax.cache.processor"><code>EntryProcessor</code></a>, a miss occurs when the
key does not exist and therefore an entry processor cannot be invoked
against it.
<p>
In a caches with multiple tiered storage, a miss may be implemented as a miss
to the cache or to the first tier.
<p>
In a read-through cache a miss is an absence of the key in the cache that
will trigger a call to a CacheLoader. So it is still a miss even though the
cache will load and return the value.
<p>
Refer to the implementation for precise semantics.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the number of misses</dd></dl>
</li>
</ul>
<a name="getCacheMissPercentage()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCacheMissPercentage</h4>
<pre>float&nbsp;getCacheMissPercentage()</pre>
<div class="block">Returns the percentage of cache accesses that did not find a requested entry
in the cache.
<p>
This is calculated as <a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getCacheMisses()"><code>getCacheMisses()</code></a> divided by
<a href="../../../javax/cache/management/CacheStatisticsMXBean.html#getCacheGets()"><code>getCacheGets()</code></a> * 100.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the percentage of accesses that failed to find anything</dd></dl>
</li>
</ul>
<a name="getCacheGets()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCacheGets</h4>
<pre>long&nbsp;getCacheGets()</pre>
<div class="block">The total number of requests to the cache. This will be equal to the sum of
the hits and misses.
<p>
A "get" is an operation that returns the current or previous value. It does
not include checking for the existence of a key.
<p>
In a caches with multiple tiered storage, a gets may be implemented as a get
to the cache or to the first tier.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the number of gets</dd></dl>
</li>
</ul>
<a name="getCachePuts()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCachePuts</h4>
<pre>long&nbsp;getCachePuts()</pre>
<div class="block">The total number of puts to the cache.
<p>
A put is counted even if it is immediately evicted.
<p>
Replaces, where a put occurs which overrides an existing mapping is counted
as a put.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the number of puts</dd></dl>
</li>
</ul>
<a name="getCacheRemovals()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCacheRemovals</h4>
<pre>long&nbsp;getCacheRemovals()</pre>
<div class="block">The total number of removals from the cache. This does not include evictions,
where the cache itself initiates the removal to make space.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the number of removals</dd></dl>
</li>
</ul>
<a name="getCacheEvictions()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCacheEvictions</h4>
<pre>long&nbsp;getCacheEvictions()</pre>
<div class="block">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.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the number of evictions</dd></dl>
</li>
</ul>
<a name="getAverageGetTime()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAverageGetTime</h4>
<pre>float&nbsp;getAverageGetTime()</pre>
<div class="block">The mean time to execute gets.
<p>
In a read-through cache the time taken to load an entry on miss is not
included in get time.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the time in µs</dd></dl>
</li>
</ul>
<a name="getAveragePutTime()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAveragePutTime</h4>
<pre>float&nbsp;getAveragePutTime()</pre>
<div class="block">The mean time to execute puts.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the time in µs</dd></dl>
</li>
</ul>
<a name="getAverageRemoveTime()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getAverageRemoveTime</h4>
<pre>float&nbsp;getAverageRemoveTime()</pre>
<div class="block">The mean time to execute removes.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the time in µs</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CacheStatisticsMXBean.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javax/cache/management/CacheMXBean.html" title="interface in javax.cache.management"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/cache/management/CacheStatisticsMXBean.html" target="_top">Frames</a></li>
<li><a href="CacheStatisticsMXBean.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2014. All Rights Reserved.</small></p>
</body>
</html>