public class CacheMetricsImpl extends Object implements CacheMetrics
Modifier and Type | Class and Description |
---|---|
static class |
CacheMetricsImpl.EntriesStatMetrics
Entries and partitions metrics holder class.
|
Modifier and Type | Field and Description |
---|---|
static String |
CACHE_METRICS
Cache metrics registry name first part.
|
static long[] |
HISTOGRAM_BUCKETS
Histogram buckets for duration get, put, remove, commit, rollback operations in nanoseconds.
|
Constructor and Description |
---|
CacheMetricsImpl(GridCacheContext<?,?> cctx)
Creates cache metrics.
|
CacheMetricsImpl(GridCacheContext<?,?> cctx,
boolean isNear)
Creates cache metrics.
|
Modifier and Type | Method and Description |
---|---|
void |
addGetTimeNanos(long duration)
Increments the get time accumulator.
|
void |
addIndexRebuildKeyProcessed(long val)
Increase number of keys processed during index rebuilding.
|
void |
addInvokeTimeNanos(long duration)
Increments invoke operation time nanos.
|
void |
addPutAndGetTimeNanos(long duration)
Increments put and get time accumulators.
|
void |
addPutTimeNanos(long duration)
Increments the put time accumulator.
|
void |
addRemoveAndGetTimeNanos(long duration)
Increments remove and get time accumulators.
|
void |
addRemoveTimeNanos(long duration)
Increments the remove time accumulator.
|
void |
clear()
Clear metrics.
|
void |
clearRebalanceCounters()
Clear rebalance counters.
|
void |
decrementEvictingPartitions() |
void |
decrementRebalanceClearingPartitions() |
void |
delegate(CacheMetricsImpl delegate) |
long |
estimateRebalancingFinishTime()
This method is deprecated and will be deleted in future major release.
|
long |
evictingPartitionsLeft() |
float |
getAverageGetTime()
The mean time to execute gets.
|
float |
getAveragePutTime()
The mean time to execute puts.
|
float |
getAverageRemoveTime()
The mean time to execute removes.
|
float |
getAverageTxCommitTime()
The mean time to execute tx commit.
|
float |
getAverageTxRollbackTime()
The mean time to execute tx rollbacks.
|
long |
getCacheEvictions()
The total number of evictions from the cache.
|
long |
getCacheGets()
The total number of requests to the cache.
|
float |
getCacheHitPercentage()
This is a measure of cache efficiency.
|
long |
getCacheHits()
The number of get requests that were satisfied by the cache.
|
long |
getCacheMisses()
A miss is a get request that is not satisfied.
|
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.
|
long |
getCacheSize()
Cache size.
|
long |
getCacheTxCommits()
Gets total number of transaction commits.
|
long |
getCacheTxRollbacks()
Gets total number of transaction rollbacks.
|
int |
getDhtEvictQueueCurrentSize()
Gets current size of evict queue used to batch up evictions.
|
CacheMetricsImpl.EntriesStatMetrics |
getEntriesStat()
Calculates entries count/partitions count metrics using one iteration over local partitions for all metrics
|
float |
getEntryProcessorAverageInvocationTime()
The mean time to execute cache invokes.
|
float |
getEntryProcessorHitPercentage()
The percentage of invocations on keys, which exist in cache.
|
long |
getEntryProcessorHits()
The total number of invocations on keys, which exist in cache.
|
long |
getEntryProcessorInvocations()
The total number of cache invocations.
|
float |
getEntryProcessorMaxInvocationTime()
So far, the maximum time to execute cache invokes.
|
float |
getEntryProcessorMinInvocationTime()
So far, the minimum time to execute cache invokes.
|
long |
getEntryProcessorMisses()
The total number of invocations on keys, which don't exist in cache.
|
float |
getEntryProcessorMissPercentage()
The percentage of invocations on keys, which don't exist in cache.
|
long |
getEntryProcessorPuts()
The total number of cache invocations, caused update.
|
long |
getEntryProcessorReadOnlyInvocations()
The total number of cache invocations, caused no updates.
|
long |
getEntryProcessorRemovals()
The total number of cache invocations, caused removal.
|
long |
getEstimatedRebalancingFinishTime() |
long |
getEstimatedRebalancingKeys() |
long |
getHeapEntriesCount()
Gets the number of cache entries in heap memory, including entries held by active transactions, entries in
onheap cache and near entries.
|
long |
getIndexRebuildKeysProcessed()
Return number of keys processed during index rebuilding.
|
int |
getKeySize()
Gets number of keys in the cache, possibly with
null values. |
long |
getKeysToRebalanceLeft() |
String |
getKeyType()
Determines the required type of keys for this
Cache , if any. |
long |
getOffHeapAllocatedSize()
Gets memory size allocated in off-heap.
|
long |
getOffHeapBackupEntriesCount()
Gets number of backup entries stored in off-heap memory.
|
long |
getOffHeapEntriesCount()
Gets number of entries stored in off-heap memory.
|
long |
getOffHeapEvictions()
The total number of evictions from the off-heap memory.
|
long |
getOffHeapGets()
The total number of get requests to the off-heap memory.
|
float |
getOffHeapHitPercentage()
Gets the percentage of hits on off-heap memory.
|
long |
getOffHeapHits()
The number of get requests that were satisfied by the off-heap memory.
|
long |
getOffHeapMisses()
A miss is a get request that is not satisfied by off-heap memory.
|
float |
getOffHeapMissPercentage()
Gets the percentage of misses on off-heap memory.
|
long |
getOffHeapPrimaryEntriesCount()
Gets number of primary entries stored in off-heap memory.
|
long |
getOffHeapPuts()
The total number of put requests to the off-heap memory.
|
long |
getOffHeapRemovals()
The total number of removals from the off-heap memory.
|
long |
getRebalanceClearingPartitionsLeft() |
long |
getRebalancedKeys() |
long |
getRebalancingBytesRate() |
long |
getRebalancingKeysRate() |
int |
getRebalancingPartitionsCount() |
long |
getRebalancingStartTime() |
int |
getSize()
Gets number of non-
null values in the cache. |
long |
getTotalAllocatedPages() |
long |
getTotalEvictedPages() |
int |
getTotalPartitionsCount() |
int |
getTxCommitQueueSize()
Gets committed transaction queue size.
|
int |
getTxCommittedVersionsSize()
Gets number of cached committed transaction IDs.
|
int |
getTxDhtCommitQueueSize()
Gets committed DHT transaction queue size.
|
int |
getTxDhtCommittedVersionsSize()
Gets number of cached committed DHT transaction IDs.
|
int |
getTxDhtPrepareQueueSize()
Gets prepared DHT transaction queue size.
|
int |
getTxDhtRolledbackVersionsSize()
Gets number of cached rolled back DHT transaction IDs.
|
int |
getTxDhtStartVersionCountsSize()
Gets DHT start version counts map size.
|
int |
getTxDhtThreadMapSize()
Gets transaction DHT per-thread map size.
|
int |
getTxDhtXidMapSize()
Gets transaction DHT per-Xid map size.
|
String |
getTxKeyCollisions()
Checks if there were any tx key collisions last time.
|
int |
getTxPrepareQueueSize()
Gets prepared transaction queue size.
|
int |
getTxRolledbackVersionsSize()
Gets number of cached rolled back transaction IDs.
|
int |
getTxStartVersionCountsSize()
Gets start version counts map size.
|
int |
getTxThreadMapSize()
Gets transaction per-thread map size.
|
int |
getTxXidMapSize()
Gets transaction per-Xid map size.
|
String |
getValueType()
Determines the required type of values for this
Cache , if any. |
int |
getWriteBehindBufferSize()
Gets count of entries that were processed by the write-behind store and have not been
flushed to the underlying store yet.
|
int |
getWriteBehindCriticalOverflowCount()
Gets count of write buffer overflow events in progress at the moment.
|
int |
getWriteBehindErrorRetryCount()
Gets count of cache entries that are in a store-retry state.
|
long |
getWriteBehindFlushFrequency()
Gets the cache flush frequency.
|
int |
getWriteBehindFlushSize()
Gets the maximum size of the write-behind buffer.
|
int |
getWriteBehindFlushThreadCount()
Gets the number of flush threads that will perform store update operations.
|
int |
getWriteBehindStoreBatchSize()
Gets the maximum count of similar (put or remove) operations that can be grouped to a single batch.
|
int |
getWriteBehindTotalCriticalOverflowCount()
Gets count of write buffer overflow events since initialization.
|
void |
incrementEvictingPartitions() |
void |
incrementRebalanceClearingPartitions() |
boolean |
isEmpty()
Returns
true if this cache is empty. |
boolean |
isIndexRebuildInProgress()
Return
true if index rebuild is in progress. |
boolean |
isManagementEnabled()
Checks whether management is enabled on this cache.
|
boolean |
isReadThrough()
Determines if a
Cache should operate in read-through mode. |
boolean |
isStatisticsEnabled()
Checks whether statistics collection is enabled in this cache.
|
boolean |
isStoreByValue()
Whether storeByValue
true or storeByReference false . |
boolean |
isValidForReading()
Checks whether cache topology is valid for read operations.
|
boolean |
isValidForWriting()
Checks whether cache topology is valid for write operations.
|
boolean |
isWriteBehindEnabled()
Returns
true if write-behind is enabled. |
boolean |
isWriteThrough()
Determines if a
Cache should operate in "write-through"
mode. |
@Nullable Supplier<List<Map.Entry<GridCacheMapEntry,Integer>>> |
keyCollisionsInfo()
Callback representing current key collisions state.
|
void |
keyCollisionsInfo(Supplier<List<Map.Entry<GridCacheMapEntry,Integer>>> coll)
Set callback for tx key collisions detection.
|
String |
name()
Gets name of this cache.
|
void |
onEvict()
Cache remove callback.
|
void |
onInvokeRemove(boolean isHit)
Cache invocations caused removal callback.
|
void |
onInvokeUpdate(boolean isHit)
Cache invocations caused update callback.
|
void |
onOffHeapEvict()
Off-heap evict callback.
|
void |
onOffHeapRead(boolean hit)
Off-heap read callback.
|
void |
onOffHeapRemove()
Off-heap remove callback.
|
void |
onOffHeapWrite()
Off-heap write callback.
|
void |
onRead(boolean isHit)
Cache read callback.
|
void |
onReadOnlyInvoke(boolean isHit)
Read-only cache invocations.
|
void |
onRebalanceBatchReceived(long batchSize)
Rebalance supply message callback.
|
void |
onRebalanceKeyReceived()
Rebalance entry store callback.
|
void |
onRebalancingKeysCountEstimateReceived(Long keysCnt)
First rebalance supply message callback.
|
void |
onRemove()
Cache remove callback.
|
void |
onTxCommit(long duration)
Transaction commit callback.
|
void |
onTxRollback(long duration)
Transaction rollback callback.
|
void |
onWrite()
Cache write callback.
|
long |
rebalancingStartTime()
This method is deprecated and will be deleted in future major release.
|
void |
resetIndexRebuildKeyProcessed()
Reset metric - number of keys processed during index rebuilding.
|
void |
startRebalance(long delay) |
String |
toString() |
public static final String CACHE_METRICS
CacheConfiguration.getName()
also.
"cache.sys-cache"
, for example.public static final long[] HISTOGRAM_BUCKETS
public CacheMetricsImpl(GridCacheContext<?,?> cctx)
cctx
- Cache context.public CacheMetricsImpl(GridCacheContext<?,?> cctx, boolean isNear)
cctx
- Cache context.isNear
- Is near flag.public void delegate(CacheMetricsImpl delegate)
delegate
- Metrics to delegate to.public String name()
name
in interface CacheMetrics
public long getOffHeapGets()
getOffHeapGets
in interface CacheMetrics
public long getOffHeapPuts()
getOffHeapPuts
in interface CacheMetrics
public long getOffHeapRemovals()
getOffHeapRemovals
in interface CacheMetrics
public long getOffHeapEvictions()
getOffHeapEvictions
in interface CacheMetrics
public long getOffHeapHits()
getOffHeapHits
in interface CacheMetrics
public float getOffHeapHitPercentage()
getOffHeapHitPercentage
in interface CacheMetrics
public long getOffHeapMisses()
getOffHeapMisses
in interface CacheMetrics
public float getOffHeapMissPercentage()
getOffHeapMissPercentage
in interface CacheMetrics
public long getOffHeapEntriesCount()
getOffHeapEntriesCount
in interface CacheMetrics
public long getHeapEntriesCount()
getHeapEntriesCount
in interface CacheMetrics
public long getOffHeapPrimaryEntriesCount()
getOffHeapPrimaryEntriesCount
in interface CacheMetrics
public long getOffHeapBackupEntriesCount()
getOffHeapBackupEntriesCount
in interface CacheMetrics
public long getOffHeapAllocatedSize()
getOffHeapAllocatedSize
in interface CacheMetrics
public int getSize()
null
values in the cache.
Note this method will always return 0
getSize
in interface CacheMetrics
null
values in the cache.public long getCacheSize()
getCacheSize
in interface CacheMetrics
public int getKeySize()
null
values.
Note this method will always return 0
getKeySize
in interface CacheMetrics
public boolean isEmpty()
true
if this cache is empty.isEmpty
in interface CacheMetrics
True
if this cache is empty.public int getDhtEvictQueueCurrentSize()
getDhtEvictQueueCurrentSize
in interface CacheMetrics
public int getTxCommitQueueSize()
getTxCommitQueueSize
in interface CacheMetrics
public int getTxThreadMapSize()
getTxThreadMapSize
in interface CacheMetrics
public int getTxXidMapSize()
getTxXidMapSize
in interface CacheMetrics
public int getTxPrepareQueueSize()
getTxPrepareQueueSize
in interface CacheMetrics
public int getTxStartVersionCountsSize()
getTxStartVersionCountsSize
in interface CacheMetrics
public int getTxCommittedVersionsSize()
getTxCommittedVersionsSize
in interface CacheMetrics
public int getTxRolledbackVersionsSize()
getTxRolledbackVersionsSize
in interface CacheMetrics
public int getTxDhtThreadMapSize()
getTxDhtThreadMapSize
in interface CacheMetrics
public int getTxDhtXidMapSize()
getTxDhtXidMapSize
in interface CacheMetrics
public int getTxDhtCommitQueueSize()
getTxDhtCommitQueueSize
in interface CacheMetrics
public int getTxDhtPrepareQueueSize()
getTxDhtPrepareQueueSize
in interface CacheMetrics
public int getTxDhtStartVersionCountsSize()
getTxDhtStartVersionCountsSize
in interface CacheMetrics
public int getTxDhtCommittedVersionsSize()
getTxDhtCommittedVersionsSize
in interface CacheMetrics
public int getTxDhtRolledbackVersionsSize()
getTxDhtRolledbackVersionsSize
in interface CacheMetrics
public boolean isWriteBehindEnabled()
true
if write-behind is enabled.isWriteBehindEnabled
in interface CacheMetrics
True
if write-behind is enabled.public int getWriteBehindFlushSize()
0
, then flush is performed only on time-elapsing basis. However,
when this value is 0
, the cache critical size is set to
CacheConfiguration.DFLT_WRITE_BEHIND_CRITICAL_SIZE
getWriteBehindFlushSize
in interface CacheMetrics
public int getWriteBehindFlushThreadCount()
getWriteBehindFlushThreadCount
in interface CacheMetrics
public long getWriteBehindFlushFrequency()
0
, then flush is performed only when buffer size exceeds flush size.getWriteBehindFlushFrequency
in interface CacheMetrics
public int getWriteBehindStoreBatchSize()
getWriteBehindStoreBatchSize
in interface CacheMetrics
public int getWriteBehindTotalCriticalOverflowCount()
getWriteBehindTotalCriticalOverflowCount
in interface CacheMetrics
public int getWriteBehindCriticalOverflowCount()
getWriteBehindCriticalOverflowCount
in interface CacheMetrics
public int getWriteBehindErrorRetryCount()
getWriteBehindErrorRetryCount
in interface CacheMetrics
public int getWriteBehindBufferSize()
getWriteBehindBufferSize
in interface CacheMetrics
public float getAverageTxCommitTime()
getAverageTxCommitTime
in interface CacheMetrics
public float getAverageTxRollbackTime()
getAverageTxRollbackTime
in interface CacheMetrics
public long getCacheTxCommits()
getCacheTxCommits
in interface CacheMetrics
public long getCacheTxRollbacks()
getCacheTxRollbacks
in interface CacheMetrics
public void clear()
public long getCacheHits()
getCacheHits
in interface CacheMetrics
public float getCacheHitPercentage()
getCacheHitPercentage
in interface CacheMetrics
public long getCacheMisses()
getCacheMisses
in interface CacheMetrics
public float getCacheMissPercentage()
getCacheMissPercentage
in interface CacheMetrics
public long getCacheGets()
getCacheGets
in interface CacheMetrics
public long getCachePuts()
getCachePuts
in interface CacheMetrics
public long getEntryProcessorPuts()
getEntryProcessorPuts
in interface CacheMetrics
public long getEntryProcessorRemovals()
getEntryProcessorRemovals
in interface CacheMetrics
public long getEntryProcessorReadOnlyInvocations()
getEntryProcessorReadOnlyInvocations
in interface CacheMetrics
public long getEntryProcessorInvocations()
getEntryProcessorInvocations
in interface CacheMetrics
public long getEntryProcessorHits()
getEntryProcessorHits
in interface CacheMetrics
public float getEntryProcessorHitPercentage()
getEntryProcessorHitPercentage
in interface CacheMetrics
public long getEntryProcessorMisses()
getEntryProcessorMisses
in interface CacheMetrics
public float getEntryProcessorMissPercentage()
getEntryProcessorMissPercentage
in interface CacheMetrics
public float getEntryProcessorAverageInvocationTime()
getEntryProcessorAverageInvocationTime
in interface CacheMetrics
public float getEntryProcessorMinInvocationTime()
getEntryProcessorMinInvocationTime
in interface CacheMetrics
public float getEntryProcessorMaxInvocationTime()
getEntryProcessorMaxInvocationTime
in interface CacheMetrics
public long getCacheRemovals()
getCacheRemovals
in interface CacheMetrics
public long getCacheEvictions()
getCacheEvictions
in interface CacheMetrics
public float getAverageGetTime()
getAverageGetTime
in interface CacheMetrics
public float getAveragePutTime()
getAveragePutTime
in interface CacheMetrics
public float getAverageRemoveTime()
getAverageRemoveTime
in interface CacheMetrics
public void onRead(boolean isHit)
isHit
- Hit or miss flag.public void keyCollisionsInfo(Supplier<List<Map.Entry<GridCacheMapEntry,Integer>>> coll)
coll
- Key collisions info holder.@Nullable public @Nullable Supplier<List<Map.Entry<GridCacheMapEntry,Integer>>> keyCollisionsInfo()
public String getTxKeyCollisions()
IgniteSystemProperties.IGNITE_DUMP_TX_COLLISIONS_INTERVAL
or
TransactionsMXBean.setTxKeyCollisionsInterval(int)
.getTxKeyCollisions
in interface CacheMetrics
public void onInvokeUpdate(boolean isHit)
isHit
- Hit or miss flag.public void onInvokeRemove(boolean isHit)
isHit
- Hit or miss flag.public void onReadOnlyInvoke(boolean isHit)
isHit
- Hit or miss flag.public void addInvokeTimeNanos(long duration)
duration
- Duration.public void onWrite()
public void onRemove()
public void onEvict()
public void onTxCommit(long duration)
duration
- the time taken in nanoseconds.public void onTxRollback(long duration)
duration
- the time taken in nanoseconds.public void addGetTimeNanos(long duration)
duration
- the time taken in nanoseconds.public void addPutTimeNanos(long duration)
duration
- the time taken in nanoseconds.public void addRemoveTimeNanos(long duration)
duration
- the time taken in nanoseconds.public void addRemoveAndGetTimeNanos(long duration)
duration
- the time taken in nanoseconds.public void addPutAndGetTimeNanos(long duration)
duration
- the time taken in nanoseconds.public String getKeyType()
Cache
, if any.getKeyType
in interface CacheMetrics
"java.lang.Object"
if the type is undefined.public String getValueType()
Cache
, if any.getValueType
in interface CacheMetrics
"java.lang.Object"
if the type is undefined.public boolean isReadThrough()
Cache
should operate in read-through mode.
The default value is false
isReadThrough
in interface CacheMetrics
True
when a Cache
is in
"read-through" mode.CacheLoader
public boolean isWriteThrough()
Cache
should operate in "write-through"
mode.
will appropriately cause the configured CacheWriter
to be invoked.
The default value is false
isWriteThrough
in interface CacheMetrics
True
when a Cache
is in "write-through" mode.CacheWriter
public boolean isValidForReading()
Note: the method will return false
if any partition was lost despite the fact others can be awailable
for reading.
isValidForReading
in interface CacheMetrics
true
when cache topology is valid for reading.public boolean isValidForWriting()
Note: the method will return false
if any partition was lost despite the fact others can be awailable
for writing according to configured partition loss policy.
isValidForWriting
in interface CacheMetrics
true
when cache topology is valid for writing.public boolean isStoreByValue()
true
or storeByReference false
.
When true
, both keys and values are stored by value.
When false
, both keys and values are stored by reference.
Caches stored by reference are capable of mutation by any threads holding
the reference. The effects are:
When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.
The default value is true
.
isStoreByValue
in interface CacheMetrics
True
if the cache is store by value.public boolean isStatisticsEnabled()
The default value is false
.
isStatisticsEnabled
in interface CacheMetrics
True
if statistics collection is enabled.public boolean isManagementEnabled()
The default value is false
.
isManagementEnabled
in interface CacheMetrics
true
if management is enabled.public CacheMetricsImpl.EntriesStatMetrics getEntriesStat()
public int getTotalPartitionsCount()
getTotalPartitionsCount
in interface CacheMetrics
public int getRebalancingPartitionsCount()
getRebalancingPartitionsCount
in interface CacheMetrics
public long getRebalancedKeys()
getRebalancedKeys
in interface CacheMetrics
public long getEstimatedRebalancingKeys()
getEstimatedRebalancingKeys
in interface CacheMetrics
public long getKeysToRebalanceLeft()
getKeysToRebalanceLeft
in interface CacheMetrics
public long getRebalancingKeysRate()
getRebalancingKeysRate
in interface CacheMetrics
public long getRebalancingBytesRate()
getRebalancingBytesRate
in interface CacheMetrics
public void clearRebalanceCounters()
public void startRebalance(long delay)
public long estimateRebalancingFinishTime()
CacheMetrics.getEstimatedRebalancingFinishTime()
instead.estimateRebalancingFinishTime
in interface CacheMetrics
public long rebalancingStartTime()
CacheMetrics.getRebalancingStartTime()
instead.rebalancingStartTime
in interface CacheMetrics
public long getEstimatedRebalancingFinishTime()
getEstimatedRebalancingFinishTime
in interface CacheMetrics
public long getRebalancingStartTime()
getRebalancingStartTime
in interface CacheMetrics
public long getRebalanceClearingPartitionsLeft()
getRebalanceClearingPartitionsLeft
in interface CacheMetrics
public long evictingPartitionsLeft()
public void incrementRebalanceClearingPartitions()
public void decrementRebalanceClearingPartitions()
public void incrementEvictingPartitions()
public void decrementEvictingPartitions()
public void onRebalancingKeysCountEstimateReceived(Long keysCnt)
keysCnt
- Estimated number of keys.public void onRebalanceKeyReceived()
public void onRebalanceBatchReceived(long batchSize)
batchSize
- Batch size in bytes.public long getTotalAllocatedPages()
public long getTotalEvictedPages()
public void onOffHeapRead(boolean hit)
hit
- Hit or miss flag.public void onOffHeapWrite()
public void onOffHeapRemove()
public void onOffHeapEvict()
public boolean isIndexRebuildInProgress()
true
if index rebuild is in progress.isIndexRebuildInProgress
in interface CacheMetrics
true
if index rebuild is in progress.public long getIndexRebuildKeysProcessed()
CacheMetrics.getCacheSize()
.getIndexRebuildKeysProcessed
in interface CacheMetrics
public void resetIndexRebuildKeyProcessed()
public void addIndexRebuildKeyProcessed(long val)
val
- Number of processed keys.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021