Class CacheMetricsImpl
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.CacheMetricsImpl
-
- All Implemented Interfaces:
CacheMetrics
public class CacheMetricsImpl extends Object implements CacheMetrics
Adapter for cache metrics.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCacheMetricsImpl.EntriesStatMetricsEntries and partitions metrics holder class.
-
Field Summary
Fields Modifier and Type Field Description static StringCACHE_METRICSCache metrics registry name first part.static long[]HISTOGRAM_BUCKETSHistogram buckets for duration get, put, remove, commit, rollback operations in nanoseconds.
-
Constructor Summary
Constructors Constructor Description CacheMetricsImpl(GridCacheContext<?,?> cctx)Creates cache metrics.CacheMetricsImpl(GridCacheContext<?,?> cctx, boolean isNear)Creates cache metrics.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddGetAllTimeNanos(long duration)Increments the getAll time accumulator.voidaddGetTimeNanos(long duration)Increments the get time accumulator.voidaddIndexBuildPartitionsLeftCount(int val)voidaddIndexRebuildKeyProcessed(long val)Increase number of keys processed during index rebuilding.voidaddInvokeTimeNanos(long duration)Increments invoke operation time nanos.voidaddPutAllConflictTimeNanos(long duration)Increments the putAllConflict time accumulator.voidaddPutAllTimeNanos(long duration)Increments the putAll time accumulator.voidaddPutAndGetTimeNanos(long duration)Increments put and get time accumulators.voidaddPutTimeNanos(long duration)Increments the put time accumulator.voidaddRemoveAllConflictTimeNanos(long duration)Increments the removeAllConflict time accumulator.voidaddRemoveAllTimeNanos(long duration)Increments the removeAll time accumulator.voidaddRemoveAndGetTimeNanos(long duration)Increments remove and get time accumulators.voidaddRemoveTimeNanos(long duration)Increments the remove time accumulator.voidclear()Clear metrics.voidclearRebalanceCounters()Clear rebalance counters.voiddecrementEvictingPartitions()voiddecrementIndexBuildPartitionsLeftCount()voiddecrementRebalanceClearingPartitions()voiddelegate(CacheMetricsImpl delegate)longestimateRebalancingFinishTime()This method is deprecated and will be deleted in future major release.longevictingPartitionsLeft()floatgetAverageGetTime()The mean time to execute gets.floatgetAveragePutTime()The mean time to execute puts.floatgetAverageRemoveTime()The mean time to execute removes.floatgetAverageTxCommitTime()The mean time to execute tx commit.floatgetAverageTxRollbackTime()The mean time to execute tx rollbacks.longgetCacheEvictions()The total number of evictions from the cache.longgetCacheGets()The total number of requests to the cache.floatgetCacheHitPercentage()This is a measure of cache efficiency.longgetCacheHits()The number of get requests that were satisfied by the cache.longgetCacheMisses()A miss is a get request that is not satisfied.floatgetCacheMissPercentage()Returns the percentage of cache accesses that did not find a requested entry in the cache.longgetCachePuts()The total number of puts to the cache.longgetCacheRemovals()The total number of removals from the cache.longgetCacheSize()Cache size.longgetCacheTxCommits()Gets total number of transaction commits.longgetCacheTxRollbacks()Gets total number of transaction rollbacks.intgetDhtEvictQueueCurrentSize()Gets current size of evict queue used to batch up evictions.CacheMetricsImpl.EntriesStatMetricsgetEntriesStat()Calculates entries count/partitions count metrics using one iteration over local partitions for all metricsfloatgetEntryProcessorAverageInvocationTime()The mean time to execute cache invokes.floatgetEntryProcessorHitPercentage()The percentage of invocations on keys, which exist in cache.longgetEntryProcessorHits()The total number of invocations on keys, which exist in cache.longgetEntryProcessorInvocations()The total number of cache invocations.floatgetEntryProcessorMaxInvocationTime()So far, the maximum time to execute cache invokes.floatgetEntryProcessorMinInvocationTime()So far, the minimum time to execute cache invokes.longgetEntryProcessorMisses()The total number of invocations on keys, which don't exist in cache.floatgetEntryProcessorMissPercentage()The percentage of invocations on keys, which don't exist in cache.longgetEntryProcessorPuts()The total number of cache invocations, caused update.longgetEntryProcessorReadOnlyInvocations()The total number of cache invocations, caused no updates.longgetEntryProcessorRemovals()The total number of cache invocations, caused removal.longgetEstimatedRebalancingFinishTime()longgetEstimatedRebalancingKeys()longgetHeapEntriesCount()Gets the number of cache entries in heap memory, including entries held by active transactions, entries in onheap cache and near entries.intgetIndexBuildPartitionsLeftCount()longgetIndexRebuildKeysProcessed()Return number of keys processed during index rebuilding.intgetKeySize()Gets number of keys in the cache, possibly withnullvalues.longgetKeysToRebalanceLeft()StringgetKeyType()Determines the required type of keys for thisCache, if any.longgetOffHeapAllocatedSize()Gets memory size allocated in off-heap.longgetOffHeapBackupEntriesCount()Gets number of backup entries stored in off-heap memory.longgetOffHeapEntriesCount()Gets number of entries stored in off-heap memory.longgetOffHeapEvictions()The total number of evictions from the off-heap memory.longgetOffHeapGets()The total number of get requests to the off-heap memory.floatgetOffHeapHitPercentage()Gets the percentage of hits on off-heap memory.longgetOffHeapHits()The number of get requests that were satisfied by the off-heap memory.longgetOffHeapMisses()A miss is a get request that is not satisfied by off-heap memory.floatgetOffHeapMissPercentage()Gets the percentage of misses on off-heap memory.longgetOffHeapPrimaryEntriesCount()Gets number of primary entries stored in off-heap memory.longgetOffHeapPuts()The total number of put requests to the off-heap memory.longgetOffHeapRemovals()The total number of removals from the off-heap memory.longgetRebalanceClearingPartitionsLeft()longgetRebalancedKeys()longgetRebalancingBytesRate()longgetRebalancingKeysRate()intgetRebalancingPartitionsCount()longgetRebalancingStartTime()intgetSize()Gets number of non-nullvalues in the cache.longgetTotalAllocatedPages()longgetTotalEvictedPages()intgetTotalPartitionsCount()intgetTxCommitQueueSize()Gets committed transaction queue size.intgetTxCommittedVersionsSize()Gets number of cached committed transaction IDs.intgetTxDhtCommitQueueSize()Gets committed DHT transaction queue size.intgetTxDhtCommittedVersionsSize()Gets number of cached committed DHT transaction IDs.intgetTxDhtPrepareQueueSize()Gets prepared DHT transaction queue size.intgetTxDhtRolledbackVersionsSize()Gets number of cached rolled back DHT transaction IDs.intgetTxDhtStartVersionCountsSize()Gets DHT start version counts map size.intgetTxDhtThreadMapSize()Gets transaction DHT per-thread map size.intgetTxDhtXidMapSize()Gets transaction DHT per-Xid map size.StringgetTxKeyCollisions()Checks if there were any tx key collisions last time.intgetTxPrepareQueueSize()Gets prepared transaction queue size.intgetTxRolledbackVersionsSize()Gets number of cached rolled back transaction IDs.intgetTxStartVersionCountsSize()Gets start version counts map size.intgetTxThreadMapSize()Gets transaction per-thread map size.intgetTxXidMapSize()Gets transaction per-Xid map size.StringgetValueType()Determines the required type of values for thisCache, if any.intgetWriteBehindBufferSize()Gets count of entries that were processed by the write-behind store and have not been flushed to the underlying store yet.intgetWriteBehindCriticalOverflowCount()Gets count of write buffer overflow events in progress at the moment.intgetWriteBehindErrorRetryCount()Gets count of cache entries that are in a store-retry state.longgetWriteBehindFlushFrequency()Gets the cache flush frequency.intgetWriteBehindFlushSize()Gets the maximum size of the write-behind buffer.intgetWriteBehindFlushThreadCount()Gets the number of flush threads that will perform store update operations.intgetWriteBehindStoreBatchSize()Gets the maximum count of similar (put or remove) operations that can be grouped to a single batch.intgetWriteBehindTotalCriticalOverflowCount()Gets count of write buffer overflow events since initialization.voidincrementEvictingPartitions()voidincrementRebalanceClearingPartitions()voidincrementResolverAcceptedCount()voidincrementResolverMergedCount()voidincrementResolverRejectedCount()booleanisEmpty()Returnstrueif this cache is empty.booleanisIndexRebuildInProgress()Returntrueif index rebuild is in progress.booleanisManagementEnabled()Checks whether management is enabled on this cache.booleanisReadThrough()Determines if aCacheshould operate in read-through mode.booleanisStatisticsEnabled()Checks whether statistics collection is enabled in this cache.booleanisStoreByValue()Whether storeByValuetrueor storeByReferencefalse.booleanisValidForReading()Checks whether cache topology is valid for read operations.booleanisValidForWriting()Checks whether cache topology is valid for write operations.booleanisWriteBehindEnabled()Returnstrueif write-behind is enabled.booleanisWriteThrough()Determines if aCacheshould operate in "write-through" mode.@Nullable Supplier<List<Map.Entry<GridCacheMapEntry,Integer>>>keyCollisionsInfo()Callback representing current key collisions state.voidkeyCollisionsInfo(Supplier<List<Map.Entry<GridCacheMapEntry,Integer>>> coll)Set callback for tx key collisions detection.Stringname()Gets name of this cache.voidonEvict()Cache remove callback.voidonInvokeRemove(boolean isHit)Cache invocations caused removal callback.voidonInvokeUpdate(boolean isHit)Cache invocations caused update callback.voidonOffHeapEvict()Off-heap evict callback.voidonOffHeapRead(boolean hit)Off-heap read callback.voidonOffHeapRemove()Off-heap remove callback.voidonOffHeapWrite()Off-heap write callback.voidonRead(boolean isHit)Cache read callback.voidonReadOnlyInvoke(boolean isHit)Read-only cache invocations.voidonRebalanceBatchReceived(long batchSize)Rebalance supply message callback.voidonRebalanceKeyReceived(long keys)Rebalance entry store callback.voidonRebalancingKeysCountEstimateReceived(Long keysCnt)First rebalance supply message callback.voidonRemove()Cache remove callback.voidonTxCommit(long duration)Transaction commit callback.voidonTxRollback(long duration)Transaction rollback callback.voidonWrite()Cache write callback.longrebalancingStartTime()This method is deprecated and will be deleted in future major release.voidregisterResolverMetrics()Registers metrics for conflict resolver.voidresetIndexBuildPartitionsLeftCount()voidresetIndexRebuildKeyProcessed()Reset metric - number of keys processed during index rebuilding.voidstartRebalance(long delay)StringtoString()
-
-
-
Field Detail
-
CACHE_METRICS
public static final String CACHE_METRICS
Cache metrics registry name first part. Full name will containCacheConfiguration.getName()also."cache.sys-cache", for example.- See Also:
- Constant Field Values
-
HISTOGRAM_BUCKETS
public static final long[] HISTOGRAM_BUCKETS
Histogram buckets for duration get, put, remove, commit, rollback operations in nanoseconds.
-
-
Constructor Detail
-
CacheMetricsImpl
public CacheMetricsImpl(GridCacheContext<?,?> cctx)
Creates cache metrics.- Parameters:
cctx- Cache context.
-
CacheMetricsImpl
public CacheMetricsImpl(GridCacheContext<?,?> cctx, boolean isNear)
Creates cache metrics.- Parameters:
cctx- Cache context.isNear- Is near flag.
-
-
Method Detail
-
delegate
public void delegate(CacheMetricsImpl delegate)
- Parameters:
delegate- Metrics to delegate to.
-
name
public String name()
Gets name of this cache.- Specified by:
namein interfaceCacheMetrics- Returns:
- Cache name.
-
getOffHeapGets
public long getOffHeapGets()
The total number of get requests to the off-heap memory.- Specified by:
getOffHeapGetsin interfaceCacheMetrics- Returns:
- The number of gets.
-
getOffHeapPuts
public long getOffHeapPuts()
The total number of put requests to the off-heap memory.- Specified by:
getOffHeapPutsin interfaceCacheMetrics- Returns:
- The number of puts.
-
getOffHeapRemovals
public long getOffHeapRemovals()
The total number of removals from the off-heap memory. This does not include evictions.- Specified by:
getOffHeapRemovalsin interfaceCacheMetrics- Returns:
- The number of removals.
-
getOffHeapEvictions
public long getOffHeapEvictions()
The total number of evictions from the off-heap memory.- Specified by:
getOffHeapEvictionsin interfaceCacheMetrics- Returns:
- The number of evictions.
-
getOffHeapHits
public long getOffHeapHits()
The number of get requests that were satisfied by the off-heap memory.- Specified by:
getOffHeapHitsin interfaceCacheMetrics- Returns:
- The off-heap hits number.
-
getOffHeapHitPercentage
public float getOffHeapHitPercentage()
Gets the percentage of hits on off-heap memory.- Specified by:
getOffHeapHitPercentagein interfaceCacheMetrics- Returns:
- The percentage of hits on off-heap memory.
-
getOffHeapMisses
public long getOffHeapMisses()
A miss is a get request that is not satisfied by off-heap memory.- Specified by:
getOffHeapMissesin interfaceCacheMetrics- Returns:
- The off-heap misses number.
-
getOffHeapMissPercentage
public float getOffHeapMissPercentage()
Gets the percentage of misses on off-heap memory.- Specified by:
getOffHeapMissPercentagein interfaceCacheMetrics- Returns:
- The percentage of misses on off-heap memory.
-
getOffHeapEntriesCount
public long getOffHeapEntriesCount()
Gets number of entries stored in off-heap memory.- Specified by:
getOffHeapEntriesCountin interfaceCacheMetrics- Returns:
- Number of entries stored in off-heap memory.
-
getHeapEntriesCount
public long getHeapEntriesCount()
Gets the number of cache entries in heap memory, including entries held by active transactions, entries in onheap cache and near entries.- Specified by:
getHeapEntriesCountin interfaceCacheMetrics- Returns:
- Number of entries in heap memory.
-
getOffHeapPrimaryEntriesCount
public long getOffHeapPrimaryEntriesCount()
Gets number of primary entries stored in off-heap memory.- Specified by:
getOffHeapPrimaryEntriesCountin interfaceCacheMetrics- Returns:
- Number of primary entries stored in off-heap memory.
-
getOffHeapBackupEntriesCount
public long getOffHeapBackupEntriesCount()
Gets number of backup entries stored in off-heap memory.- Specified by:
getOffHeapBackupEntriesCountin interfaceCacheMetrics- Returns:
- Number of backup entries stored in off-heap memory.
-
getOffHeapAllocatedSize
public long getOffHeapAllocatedSize()
Gets memory size allocated in off-heap.- Specified by:
getOffHeapAllocatedSizein interfaceCacheMetrics- Returns:
- Memory size allocated in off-heap.
-
getSize
public int getSize()
Gets number of non-nullvalues in the cache. Note this method will always return0- Specified by:
getSizein interfaceCacheMetrics- Returns:
- Number of non-
nullvalues in the cache.
-
getCacheSize
public long getCacheSize()
Cache size.- Specified by:
getCacheSizein interfaceCacheMetrics- Returns:
- Cache size.
-
getKeySize
public int getKeySize()
Gets number of keys in the cache, possibly withnullvalues. Note this method will always return0- Specified by:
getKeySizein interfaceCacheMetrics- Returns:
- Number of keys in the cache.
-
isEmpty
public boolean isEmpty()
Returnstrueif this cache is empty.- Specified by:
isEmptyin interfaceCacheMetrics- Returns:
Trueif this cache is empty.
-
getDhtEvictQueueCurrentSize
public int getDhtEvictQueueCurrentSize()
Gets current size of evict queue used to batch up evictions.- Specified by:
getDhtEvictQueueCurrentSizein interfaceCacheMetrics- Returns:
- Current size of evict queue.
-
getTxCommitQueueSize
public int getTxCommitQueueSize()
Gets committed transaction queue size.- Specified by:
getTxCommitQueueSizein interfaceCacheMetrics- Returns:
- Committed transaction queue size.
-
getTxThreadMapSize
public int getTxThreadMapSize()
Gets transaction per-thread map size.- Specified by:
getTxThreadMapSizein interfaceCacheMetrics- Returns:
- Thread map size.
-
getTxXidMapSize
public int getTxXidMapSize()
Gets transaction per-Xid map size.- Specified by:
getTxXidMapSizein interfaceCacheMetrics- Returns:
- Transaction per-Xid map size.
-
getTxPrepareQueueSize
public int getTxPrepareQueueSize()
Gets prepared transaction queue size.- Specified by:
getTxPrepareQueueSizein interfaceCacheMetrics- Returns:
- Prepared transaction queue size.
-
getTxStartVersionCountsSize
public int getTxStartVersionCountsSize()
Gets start version counts map size.- Specified by:
getTxStartVersionCountsSizein interfaceCacheMetrics- Returns:
- Start version counts map size.
-
getTxCommittedVersionsSize
public int getTxCommittedVersionsSize()
Gets number of cached committed transaction IDs.- Specified by:
getTxCommittedVersionsSizein interfaceCacheMetrics- Returns:
- Number of cached committed transaction IDs.
-
getTxRolledbackVersionsSize
public int getTxRolledbackVersionsSize()
Gets number of cached rolled back transaction IDs.- Specified by:
getTxRolledbackVersionsSizein interfaceCacheMetrics- Returns:
- Number of cached rolled back transaction IDs.
-
getTxDhtThreadMapSize
public int getTxDhtThreadMapSize()
Gets transaction DHT per-thread map size.- Specified by:
getTxDhtThreadMapSizein interfaceCacheMetrics- Returns:
- DHT thread map size.
-
getTxDhtXidMapSize
public int getTxDhtXidMapSize()
Gets transaction DHT per-Xid map size.- Specified by:
getTxDhtXidMapSizein interfaceCacheMetrics- Returns:
- Transaction DHT per-Xid map size.
-
getTxDhtCommitQueueSize
public int getTxDhtCommitQueueSize()
Gets committed DHT transaction queue size.- Specified by:
getTxDhtCommitQueueSizein interfaceCacheMetrics- Returns:
- Committed DHT transaction queue size.
-
getTxDhtPrepareQueueSize
public int getTxDhtPrepareQueueSize()
Gets prepared DHT transaction queue size.- Specified by:
getTxDhtPrepareQueueSizein interfaceCacheMetrics- Returns:
- Prepared DHT transaction queue size.
-
getTxDhtStartVersionCountsSize
public int getTxDhtStartVersionCountsSize()
Gets DHT start version counts map size.- Specified by:
getTxDhtStartVersionCountsSizein interfaceCacheMetrics- Returns:
- DHT start version counts map size.
-
getTxDhtCommittedVersionsSize
public int getTxDhtCommittedVersionsSize()
Gets number of cached committed DHT transaction IDs.- Specified by:
getTxDhtCommittedVersionsSizein interfaceCacheMetrics- Returns:
- Number of cached committed DHT transaction IDs.
-
getTxDhtRolledbackVersionsSize
public int getTxDhtRolledbackVersionsSize()
Gets number of cached rolled back DHT transaction IDs.- Specified by:
getTxDhtRolledbackVersionsSizein interfaceCacheMetrics- Returns:
- Number of cached rolled back DHT transaction IDs.
-
isWriteBehindEnabled
public boolean isWriteBehindEnabled()
Returnstrueif write-behind is enabled.- Specified by:
isWriteBehindEnabledin interfaceCacheMetrics- Returns:
Trueif write-behind is enabled.
-
getWriteBehindFlushSize
public int getWriteBehindFlushSize()
Gets the maximum size of the write-behind buffer. When the count of unique keys in write buffer exceeds this value, the buffer is scheduled for write to the underlying store. If this value is0, then flush is performed only on time-elapsing basis. However, when this value is0, the cache critical size is set toCacheConfiguration.DFLT_WRITE_BEHIND_CRITICAL_SIZE- Specified by:
getWriteBehindFlushSizein interfaceCacheMetrics- Returns:
- Buffer size that triggers flush procedure.
-
getWriteBehindFlushThreadCount
public int getWriteBehindFlushThreadCount()
Gets the number of flush threads that will perform store update operations.- Specified by:
getWriteBehindFlushThreadCountin interfaceCacheMetrics- Returns:
- Count of worker threads.
-
getWriteBehindFlushFrequency
public long getWriteBehindFlushFrequency()
Gets the cache flush frequency. All pending operations on the underlying store will be performed within time interval not less then this value. If this value is0, then flush is performed only when buffer size exceeds flush size.- Specified by:
getWriteBehindFlushFrequencyin interfaceCacheMetrics- Returns:
- Flush frequency in milliseconds.
-
getWriteBehindStoreBatchSize
public int getWriteBehindStoreBatchSize()
Gets the maximum count of similar (put or remove) operations that can be grouped to a single batch.- Specified by:
getWriteBehindStoreBatchSizein interfaceCacheMetrics- Returns:
- Maximum size of batch.
-
getWriteBehindTotalCriticalOverflowCount
public int getWriteBehindTotalCriticalOverflowCount()
Gets count of write buffer overflow events since initialization. Each overflow event causes the ongoing flush operation to be performed synchronously.- Specified by:
getWriteBehindTotalCriticalOverflowCountin interfaceCacheMetrics- Returns:
- Count of cache overflow events since start.
-
getWriteBehindCriticalOverflowCount
public int getWriteBehindCriticalOverflowCount()
Gets count of write buffer overflow events in progress at the moment. Each overflow event causes the ongoing flush operation to be performed synchronously.- Specified by:
getWriteBehindCriticalOverflowCountin interfaceCacheMetrics- Returns:
- Count of cache overflow events since start.
-
getWriteBehindErrorRetryCount
public int getWriteBehindErrorRetryCount()
Gets count of cache entries that are in a store-retry state. An entry is assigned a store-retry state when underlying store failed due some reason and cache has enough space to retain this entry till the next try.- Specified by:
getWriteBehindErrorRetryCountin interfaceCacheMetrics- Returns:
- Count of entries in store-retry state.
-
getWriteBehindBufferSize
public int getWriteBehindBufferSize()
Gets count of entries that were processed by the write-behind store and have not been flushed to the underlying store yet.- Specified by:
getWriteBehindBufferSizein interfaceCacheMetrics- Returns:
- Total count of entries in cache store internal buffer.
-
getAverageTxCommitTime
public float getAverageTxCommitTime()
The mean time to execute tx commit.- Specified by:
getAverageTxCommitTimein interfaceCacheMetrics- Returns:
- The time in µs.
-
getAverageTxRollbackTime
public float getAverageTxRollbackTime()
The mean time to execute tx rollbacks.- Specified by:
getAverageTxRollbackTimein interfaceCacheMetrics- Returns:
- Number of transaction rollbacks.
-
getCacheTxCommits
public long getCacheTxCommits()
Gets total number of transaction commits.- Specified by:
getCacheTxCommitsin interfaceCacheMetrics- Returns:
- Number of transaction commits.
-
getCacheTxRollbacks
public long getCacheTxRollbacks()
Gets total number of transaction rollbacks.- Specified by:
getCacheTxRollbacksin interfaceCacheMetrics- Returns:
- Number of transaction rollbacks.
-
clear
public void clear()
Clear metrics.
-
getCacheHits
public long getCacheHits()
The number of get requests that were satisfied by the cache.- Specified by:
getCacheHitsin interfaceCacheMetrics- Returns:
- The number of hits.
-
getCacheHitPercentage
public float getCacheHitPercentage()
This is a measure of cache efficiency.- Specified by:
getCacheHitPercentagein interfaceCacheMetrics- Returns:
- The percentage of successful hits, as a decimal e.g 75.
-
getCacheMisses
public long getCacheMisses()
A miss is a get request that is not satisfied.- Specified by:
getCacheMissesin interfaceCacheMetrics- Returns:
- The number of misses.
-
getCacheMissPercentage
public float getCacheMissPercentage()
Returns the percentage of cache accesses that did not find a requested entry in the cache.- Specified by:
getCacheMissPercentagein interfaceCacheMetrics- Returns:
- The percentage of accesses that failed to find anything.
-
getCacheGets
public long getCacheGets()
The total number of requests to the cache. This will be equal to the sum of the hits and misses.- Specified by:
getCacheGetsin interfaceCacheMetrics- Returns:
- The number of gets.
-
getCachePuts
public long getCachePuts()
The total number of puts to the cache.- Specified by:
getCachePutsin interfaceCacheMetrics- Returns:
- The number of puts.
-
getEntryProcessorPuts
public long getEntryProcessorPuts()
The total number of cache invocations, caused update.- Specified by:
getEntryProcessorPutsin interfaceCacheMetrics- Returns:
- The number of invocation updates.
-
getEntryProcessorRemovals
public long getEntryProcessorRemovals()
The total number of cache invocations, caused removal.- Specified by:
getEntryProcessorRemovalsin interfaceCacheMetrics- Returns:
- The number of invocation removals.
-
getEntryProcessorReadOnlyInvocations
public long getEntryProcessorReadOnlyInvocations()
The total number of cache invocations, caused no updates.- Specified by:
getEntryProcessorReadOnlyInvocationsin interfaceCacheMetrics- Returns:
- The number of read-only invocations.
-
getEntryProcessorInvocations
public long getEntryProcessorInvocations()
The total number of cache invocations.- Specified by:
getEntryProcessorInvocationsin interfaceCacheMetrics- Returns:
- The number of cache invocations.
-
getEntryProcessorHits
public long getEntryProcessorHits()
The total number of invocations on keys, which exist in cache.- Specified by:
getEntryProcessorHitsin interfaceCacheMetrics- Returns:
- The number of cache invocation hits.
-
getEntryProcessorHitPercentage
public float getEntryProcessorHitPercentage()
The percentage of invocations on keys, which exist in cache.- Specified by:
getEntryProcessorHitPercentagein interfaceCacheMetrics- Returns:
- The percentage of successful invocation hits.
-
getEntryProcessorMisses
public long getEntryProcessorMisses()
The total number of invocations on keys, which don't exist in cache.- Specified by:
getEntryProcessorMissesin interfaceCacheMetrics- Returns:
- The number of cache invocation misses.
-
getEntryProcessorMissPercentage
public float getEntryProcessorMissPercentage()
The percentage of invocations on keys, which don't exist in cache.- Specified by:
getEntryProcessorMissPercentagein interfaceCacheMetrics- Returns:
- The percentage of invocation misses.
-
getEntryProcessorAverageInvocationTime
public float getEntryProcessorAverageInvocationTime()
The mean time to execute cache invokes.- Specified by:
getEntryProcessorAverageInvocationTimein interfaceCacheMetrics- Returns:
- The time in µs.
-
getEntryProcessorMinInvocationTime
public float getEntryProcessorMinInvocationTime()
So far, the minimum time to execute cache invokes.- Specified by:
getEntryProcessorMinInvocationTimein interfaceCacheMetrics- Returns:
- The time in µs.
-
getEntryProcessorMaxInvocationTime
public float getEntryProcessorMaxInvocationTime()
So far, the maximum time to execute cache invokes.- Specified by:
getEntryProcessorMaxInvocationTimein interfaceCacheMetrics- Returns:
- The time in µs.
-
getCacheRemovals
public 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.- Specified by:
getCacheRemovalsin interfaceCacheMetrics- Returns:
- The number of removals.
-
getCacheEvictions
public 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.- Specified by:
getCacheEvictionsin interfaceCacheMetrics- Returns:
- The number of evictions.
-
getAverageGetTime
public float getAverageGetTime()
The mean time to execute gets.- Specified by:
getAverageGetTimein interfaceCacheMetrics- Returns:
- The time in µs.
-
getAveragePutTime
public float getAveragePutTime()
The mean time to execute puts.- Specified by:
getAveragePutTimein interfaceCacheMetrics- Returns:
- The time in µs.
-
getAverageRemoveTime
public float getAverageRemoveTime()
The mean time to execute removes.- Specified by:
getAverageRemoveTimein interfaceCacheMetrics- Returns:
- The time in µs.
-
onRead
public void onRead(boolean isHit)
Cache read callback.- Parameters:
isHit- Hit or miss flag.
-
keyCollisionsInfo
public void keyCollisionsInfo(Supplier<List<Map.Entry<GridCacheMapEntry,Integer>>> coll)
Set callback for tx key collisions detection.- Parameters:
coll- Key collisions info holder.
-
keyCollisionsInfo
@Nullable public @Nullable Supplier<List<Map.Entry<GridCacheMapEntry,Integer>>> keyCollisionsInfo()
Callback representing current key collisions state.- Returns:
- Key collisions info holder.
-
getTxKeyCollisions
public String getTxKeyCollisions()
Checks if there were any tx key collisions last time. Interval for check specified throught:IgniteSystemProperties.IGNITE_DUMP_TX_COLLISIONS_INTERVALorTransactionsMXBean.setTxKeyCollisionsInterval(int).- Specified by:
getTxKeyCollisionsin interfaceCacheMetrics- Returns:
- Key collisions and appropriate queue size string representation.
-
onInvokeUpdate
public void onInvokeUpdate(boolean isHit)
Cache invocations caused update callback.- Parameters:
isHit- Hit or miss flag.
-
onInvokeRemove
public void onInvokeRemove(boolean isHit)
Cache invocations caused removal callback.- Parameters:
isHit- Hit or miss flag.
-
onReadOnlyInvoke
public void onReadOnlyInvoke(boolean isHit)
Read-only cache invocations.- Parameters:
isHit- Hit or miss flag.
-
addInvokeTimeNanos
public void addInvokeTimeNanos(long duration)
Increments invoke operation time nanos.- Parameters:
duration- Duration.
-
onWrite
public void onWrite()
Cache write callback.
-
onRemove
public void onRemove()
Cache remove callback.
-
onEvict
public void onEvict()
Cache remove callback.
-
onTxCommit
public void onTxCommit(long duration)
Transaction commit callback.- Parameters:
duration- the time taken in nanoseconds.
-
onTxRollback
public void onTxRollback(long duration)
Transaction rollback callback.- Parameters:
duration- the time taken in nanoseconds.
-
addGetTimeNanos
public void addGetTimeNanos(long duration)
Increments the get time accumulator.- Parameters:
duration- the time taken in nanoseconds.
-
addGetAllTimeNanos
public void addGetAllTimeNanos(long duration)
Increments the getAll time accumulator.- Parameters:
duration- the time taken in nanoseconds.
-
addPutTimeNanos
public void addPutTimeNanos(long duration)
Increments the put time accumulator.- Parameters:
duration- the time taken in nanoseconds.
-
addPutAllTimeNanos
public void addPutAllTimeNanos(long duration)
Increments the putAll time accumulator.- Parameters:
duration- the time taken in nanoseconds.
-
addPutAllConflictTimeNanos
public void addPutAllConflictTimeNanos(long duration)
Increments the putAllConflict time accumulator.- Parameters:
duration- the time taken in nanoseconds.
-
addRemoveTimeNanos
public void addRemoveTimeNanos(long duration)
Increments the remove time accumulator.- Parameters:
duration- the time taken in nanoseconds.
-
addRemoveAllTimeNanos
public void addRemoveAllTimeNanos(long duration)
Increments the removeAll time accumulator.- Parameters:
duration- the time taken in nanoseconds.
-
addRemoveAllConflictTimeNanos
public void addRemoveAllConflictTimeNanos(long duration)
Increments the removeAllConflict time accumulator.- Parameters:
duration- the time taken in nanoseconds.
-
addRemoveAndGetTimeNanos
public void addRemoveAndGetTimeNanos(long duration)
Increments remove and get time accumulators.- Parameters:
duration- the time taken in nanoseconds.
-
addPutAndGetTimeNanos
public void addPutAndGetTimeNanos(long duration)
Increments put and get time accumulators.- Parameters:
duration- the time taken in nanoseconds.
-
getKeyType
public String getKeyType()
Determines the required type of keys for thisCache, if any.- Specified by:
getKeyTypein interfaceCacheMetrics- Returns:
- The fully qualified class name of the key type,
or
"java.lang.Object"if the type is undefined.
-
getValueType
public String getValueType()
Determines the required type of values for thisCache, if any.- Specified by:
getValueTypein interfaceCacheMetrics- Returns:
- The fully qualified class name of the value type,
or
"java.lang.Object"if the type is undefined.
-
isReadThrough
public boolean isReadThrough()
Determines if aCacheshould operate in read-through mode.The default value is
false- Specified by:
isReadThroughin interfaceCacheMetrics- Returns:
Truewhen aCacheis in "read-through" mode.- See Also:
CacheLoader
-
isWriteThrough
public boolean isWriteThrough()
Determines if aCacheshould operate in "write-through" mode.will appropriately cause the configured
CacheWriterto be invoked.The default value is
false- Specified by:
isWriteThroughin interfaceCacheMetrics- Returns:
Truewhen aCacheis in "write-through" mode.- See Also:
CacheWriter
-
isValidForReading
public boolean isValidForReading()
Checks whether cache topology is valid for read operations.Note: the method will return
falseif any partition was lost despite the fact others can be awailable for reading.- Specified by:
isValidForReadingin interfaceCacheMetrics- Returns:
truewhen cache topology is valid for reading.
-
isValidForWriting
public boolean isValidForWriting()
Checks whether cache topology is valid for write operations.Note: the method will return
falseif any partition was lost despite the fact others can be awailable for writing according to configured partition loss policy.- Specified by:
isValidForWritingin interfaceCacheMetrics- Returns:
truewhen cache topology is valid for writing.
-
isStoreByValue
public boolean isStoreByValue()
Whether storeByValuetrueor storeByReferencefalse. Whentrue, 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:- if the key is mutated, then the key may not be retrievable or removable
- if the value is mutated, then all threads in the JVM can potentially observe those mutations, subject to the normal Java Memory Model rules.
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.- Specified by:
isStoreByValuein interfaceCacheMetrics- Returns:
Trueif the cache is store by value.
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
Checks whether statistics collection is enabled in this cache.The default value is
false.- Specified by:
isStatisticsEnabledin interfaceCacheMetrics- Returns:
Trueif statistics collection is enabled.
-
isManagementEnabled
public boolean isManagementEnabled()
Checks whether management is enabled on this cache.The default value is
false.- Specified by:
isManagementEnabledin interfaceCacheMetrics- Returns:
trueif management is enabled.
-
getEntriesStat
public CacheMetricsImpl.EntriesStatMetrics getEntriesStat()
Calculates entries count/partitions count metrics using one iteration over local partitions for all metrics
-
getTotalPartitionsCount
public int getTotalPartitionsCount()
- Specified by:
getTotalPartitionsCountin interfaceCacheMetrics- Returns:
- Total number of partitions on current node.
-
getRebalancingPartitionsCount
public int getRebalancingPartitionsCount()
- Specified by:
getRebalancingPartitionsCountin interfaceCacheMetrics- Returns:
- Number of currently rebalancing partitions on current node.
-
getRebalancedKeys
public long getRebalancedKeys()
- Specified by:
getRebalancedKeysin interfaceCacheMetrics- Returns:
- Number of already rebalanced keys.
-
getEstimatedRebalancingKeys
public long getEstimatedRebalancingKeys()
- Specified by:
getEstimatedRebalancingKeysin interfaceCacheMetrics- Returns:
- Number estimated to rebalance keys.
-
getKeysToRebalanceLeft
public long getKeysToRebalanceLeft()
- Specified by:
getKeysToRebalanceLeftin interfaceCacheMetrics- Returns:
- Estimated number of keys to be rebalanced on current node.
-
getRebalancingKeysRate
public long getRebalancingKeysRate()
- Specified by:
getRebalancingKeysRatein interfaceCacheMetrics- Returns:
- Estimated rebalancing speed in keys.
-
getRebalancingBytesRate
public long getRebalancingBytesRate()
- Specified by:
getRebalancingBytesRatein interfaceCacheMetrics- Returns:
- Estimated rebalancing speed in bytes.
-
clearRebalanceCounters
public void clearRebalanceCounters()
Clear rebalance counters.
-
startRebalance
public void startRebalance(long delay)
-
estimateRebalancingFinishTime
public long estimateRebalancingFinishTime()
This method is deprecated and will be deleted in future major release. UseCacheMetrics.getEstimatedRebalancingFinishTime()instead.- Specified by:
estimateRebalancingFinishTimein interfaceCacheMetrics- Returns:
- Estimated rebalancing finished time.
-
rebalancingStartTime
public long rebalancingStartTime()
This method is deprecated and will be deleted in future major release. UseCacheMetrics.getRebalancingStartTime()instead.- Specified by:
rebalancingStartTimein interfaceCacheMetrics- Returns:
- Rebalancing start time.
-
getEstimatedRebalancingFinishTime
public long getEstimatedRebalancingFinishTime()
- Specified by:
getEstimatedRebalancingFinishTimein interfaceCacheMetrics- Returns:
- Estimated rebalancing finish time.
-
getRebalancingStartTime
public long getRebalancingStartTime()
- Specified by:
getRebalancingStartTimein interfaceCacheMetrics- Returns:
- Rebalancing start time.
-
getRebalanceClearingPartitionsLeft
public long getRebalanceClearingPartitionsLeft()
- Specified by:
getRebalanceClearingPartitionsLeftin interfaceCacheMetrics- Returns:
- The number of partitions need to be cleared before actual rebalance start.
-
evictingPartitionsLeft
public long evictingPartitionsLeft()
-
incrementRebalanceClearingPartitions
public void incrementRebalanceClearingPartitions()
-
decrementRebalanceClearingPartitions
public void decrementRebalanceClearingPartitions()
-
incrementEvictingPartitions
public void incrementEvictingPartitions()
-
decrementEvictingPartitions
public void decrementEvictingPartitions()
-
onRebalancingKeysCountEstimateReceived
public void onRebalancingKeysCountEstimateReceived(Long keysCnt)
First rebalance supply message callback.- Parameters:
keysCnt- Estimated number of keys.
-
onRebalanceKeyReceived
public void onRebalanceKeyReceived(long keys)
Rebalance entry store callback.- Parameters:
keys- Key count.
-
onRebalanceBatchReceived
public void onRebalanceBatchReceived(long batchSize)
Rebalance supply message callback.- Parameters:
batchSize- Batch size in bytes.
-
getTotalAllocatedPages
public long getTotalAllocatedPages()
- Returns:
- Total number of allocated pages.
-
getTotalEvictedPages
public long getTotalEvictedPages()
- Returns:
- Total number of evicted pages.
-
onOffHeapRead
public void onOffHeapRead(boolean hit)
Off-heap read callback.- Parameters:
hit- Hit or miss flag.
-
onOffHeapWrite
public void onOffHeapWrite()
Off-heap write callback.
-
onOffHeapRemove
public void onOffHeapRemove()
Off-heap remove callback.
-
onOffHeapEvict
public void onOffHeapEvict()
Off-heap evict callback.
-
isIndexRebuildInProgress
public boolean isIndexRebuildInProgress()
Returntrueif index rebuild is in progress.- Specified by:
isIndexRebuildInProgressin interfaceCacheMetrics- Returns:
trueif index rebuild is in progress.
-
getIndexRebuildKeysProcessed
public long getIndexRebuildKeysProcessed()
Return number of keys processed during index rebuilding. To get remaining number of keys for rebuilding, subtract current value fromCacheMetrics.getCacheSize().- Specified by:
getIndexRebuildKeysProcessedin interfaceCacheMetrics- Returns:
- Number of keys processed during index rebuilding.
-
resetIndexRebuildKeyProcessed
public void resetIndexRebuildKeyProcessed()
Reset metric - number of keys processed during index rebuilding.
-
addIndexRebuildKeyProcessed
public void addIndexRebuildKeyProcessed(long val)
Increase number of keys processed during index rebuilding.- Parameters:
val- Number of processed keys.
-
decrementIndexBuildPartitionsLeftCount
public void decrementIndexBuildPartitionsLeftCount()
-
addIndexBuildPartitionsLeftCount
public void addIndexBuildPartitionsLeftCount(int val)
-
resetIndexBuildPartitionsLeftCount
public void resetIndexBuildPartitionsLeftCount()
-
getIndexBuildPartitionsLeftCount
public int getIndexBuildPartitionsLeftCount()
- Specified by:
getIndexBuildPartitionsLeftCountin interfaceCacheMetrics- Returns:
- The number of partitions that remain to be processed to complete indexing. Note that this metric includes backup partitions, which also participate in index building on each node.
-
incrementResolverAcceptedCount
public void incrementResolverAcceptedCount()
-
incrementResolverRejectedCount
public void incrementResolverRejectedCount()
-
incrementResolverMergedCount
public void incrementResolverMergedCount()
-
registerResolverMetrics
public void registerResolverMetrics()
Registers metrics for conflict resolver.
-
-