@MBean(objectName="Statistics", description="General statistics such as timings, hit/miss ratio, etc.") public final class StatsCollector extends Object implements Stats, JmxStatisticsExposer
Modifier and Type | Class and Description |
---|---|
static class |
StatsCollector.Factory |
Constructor and Description |
---|
StatsCollector() |
Modifier and Type | Method and Description |
---|---|
long |
getAverageReadTime() |
long |
getAverageReadTimeNanos() |
long |
getAverageRemoveTime() |
long |
getAverageRemoveTimeNanos() |
long |
getAverageWriteTime() |
long |
getAverageWriteTimeNanos() |
int |
getCurrentNumberOfEntries()
Returns the number of entries currently in this cache instance.
|
int |
getCurrentNumberOfEntriesInMemory()
The same as
Stats.getCurrentNumberOfEntries() , however passivated entries are not included. |
long |
getDataMemoryUsed()
Provides how much memory the current eviction algorithm estimates is in use for data.
|
long |
getEvictions() |
double |
getHitRatio() |
long |
getHits() |
long |
getMisses() |
int |
getNumberOfEntries() |
long |
getOffHeapMemoryUsed()
The amount of off-heap memory used by this cache
|
double |
getReadWriteRatio() |
long |
getRemoveHits() |
long |
getRemoveMisses() |
int |
getRequiredMinimumNumberOfNodes() |
long |
getRetrievals() |
boolean |
getStatisticsEnabled()
Returns whether an interceptor's statistics are being captured.
|
long |
getStores() |
long |
getTimeSinceReset() |
long |
getTimeSinceStart() |
long |
getTotalNumberOfEntries()
Number of entries stored in cache since the cache started running.
|
void |
recordEviction() |
void |
recordHits(int hits,
long time) |
void |
recordMisses(int misses,
long time) |
void |
recordRemoveHits(int removes,
long time) |
void |
recordRemoveMisses(int removes) |
void |
recordStores(int stores,
long time) |
void |
reset()
Reset statistics
|
void |
resetStatistics()
Resets an interceptor's cache statistics
|
void |
setStatisticsEnabled(boolean enabled)
Enables or disables statistics at runtime.
|
void |
start() |
public void start()
@ManagedAttribute(description="Number of cache attribute hits", displayName="Number of cache hits", measurementType=TRENDSUP) public long getHits()
@ManagedAttribute(description="Number of cache attribute misses", displayName="Number of cache misses", measurementType=TRENDSUP) public long getMisses()
@ManagedAttribute(description="Number of cache removal hits", displayName="Number of cache removal hits", measurementType=TRENDSUP) public long getRemoveHits()
getRemoveHits
in interface Stats
@ManagedAttribute(description="Number of cache removals where keys were not found", displayName="Number of cache removal misses", measurementType=TRENDSUP) public long getRemoveMisses()
getRemoveMisses
in interface Stats
@ManagedAttribute(description="Number of cache attribute put operations", displayName="Number of cache puts", measurementType=TRENDSUP) public long getStores()
public long getRetrievals()
getRetrievals
in interface Stats
@ManagedAttribute(description="Number of cache eviction operations", displayName="Number of cache evictions", measurementType=TRENDSUP) public long getEvictions()
getEvictions
in interface Stats
@ManagedAttribute(description="Percentage hit/(hit+miss) ratio for the cache", displayName="Hit ratio", units=PERCENTAGE) public double getHitRatio()
@ManagedAttribute(description="Read/writes ratio for the cache", displayName="Read/write ratio", units=PERCENTAGE) public double getReadWriteRatio()
@ManagedAttribute(description="Average number of milliseconds for a read operation on the cache", displayName="Average read time", units=MILLISECONDS) public long getAverageReadTime()
getAverageReadTime
in interface Stats
@ManagedAttribute(description="Average number of nanoseconds for a read operation on the cache", displayName="Average read time (ns)", units=NANOSECONDS) public long getAverageReadTimeNanos()
getAverageReadTimeNanos
in interface Stats
@ManagedAttribute(description="Average number of milliseconds for a write operation in the cache", displayName="Average write time", units=MILLISECONDS) public long getAverageWriteTime()
getAverageWriteTime
in interface Stats
@ManagedAttribute(description="Average number of nanoseconds for a write operation in the cache", displayName="Average write time (ns)", units=NANOSECONDS) public long getAverageWriteTimeNanos()
getAverageWriteTimeNanos
in interface Stats
@ManagedAttribute(description="Average number of milliseconds for a remove operation in the cache", displayName="Average remove time", units=MILLISECONDS) public long getAverageRemoveTime()
getAverageRemoveTime
in interface Stats
@ManagedAttribute(description="Average number of nanoseconds for a remove operation in the cache", displayName="Average remove time (ns)", units=NANOSECONDS) public long getAverageRemoveTimeNanos()
getAverageRemoveTimeNanos
in interface Stats
@ManagedAttribute(description="Required minimum number of nodes to hold current cache data", displayName="Required minimum number of nodes") public int getRequiredMinimumNumberOfNodes()
getRequiredMinimumNumberOfNodes
in interface Stats
public void reset()
Stats
public boolean getStatisticsEnabled()
JmxStatisticsExposer
getStatisticsEnabled
in interface JmxStatisticsExposer
@ManagedAttribute(description="Enables or disables the gathering of statistics by this component", writable=true) public void setStatisticsEnabled(boolean enabled)
Stats
setStatisticsEnabled
in interface JmxStatisticsExposer
setStatisticsEnabled
in interface Stats
enabled
- boolean indicating whether statistics should be enable or not@ManagedAttribute(description="Number of entries in the cache including passivated entries", displayName="Number of current cache entries") public int getNumberOfEntries()
@ManagedAttribute(description="Number of entries currently in-memory excluding expired entries", displayName="Number of in-memory cache entries") public int getCurrentNumberOfEntriesInMemory()
Stats
Stats.getCurrentNumberOfEntries()
, however passivated entries are not included.getCurrentNumberOfEntriesInMemory
in interface Stats
@ManagedAttribute(description="Number of seconds since cache started", displayName="Seconds since cache started", units=SECONDS, measurementType=TRENDSUP) public long getTimeSinceStart()
getTimeSinceStart
in interface Stats
@ManagedAttribute(description="Number of seconds since the cache statistics were last reset", displayName="Seconds since cache statistics were reset", units=SECONDS) public long getTimeSinceReset()
getTimeSinceReset
in interface Stats
public int getCurrentNumberOfEntries()
Stats
getCurrentNumberOfEntries
in interface Stats
public long getTotalNumberOfEntries()
Stats
getTotalNumberOfEntries
in interface Stats
@ManagedAttribute(description="Amount of memory in bytes allocated for use in eviction for data in the cache", displayName="Memory used by data in the cache") public long getDataMemoryUsed()
Stats
getDataMemoryUsed
in interface Stats
@ManagedAttribute(description="Amount off-heap memory used by this cache (bytes)", displayName="Off-Heap memory used") public long getOffHeapMemoryUsed()
Stats
getOffHeapMemoryUsed
in interface Stats
@ManagedOperation(description="Resets statistics gathered by this component", displayName="Reset Statistics (Statistics)") public void resetStatistics()
JmxStatisticsExposer
resetStatistics
in interface JmxStatisticsExposer
public void recordMisses(int misses, long time)
public void recordHits(int hits, long time)
public void recordEviction()
public void recordStores(int stores, long time)
public void recordRemoveHits(int removes, long time)
public void recordRemoveMisses(int removes)
Copyright © 2021 JBoss by Red Hat. All rights reserved.