Skip to content

ICacheMonitor Methods

Responsible for monitoring cache related metrics.

ReportCacheSize(long)

abstract
public abstract void ReportCacheSize(long totalCacheSizeInBytes)
Called to report the total cache size.

Parameters

totalCacheSizeInByteslong
The total cache size in bytes.

ReportMessageStatistics(DateTime?, DateTime?, DateTime?, long)

abstract
public abstract void ReportMessageStatistics(DateTime? oldestMessageEnqueueTimeUtc, DateTime? oldestMessageDequeueTimeUtc, DateTime? newestMessageEnqueueTimeUtc, long totalMessageCount)
Called to report cache status metrics.

Parameters

oldestMessageEnqueueTimeUtcDateTime?
The time in UTC when the oldest message was enqueued to the queue.
oldestMessageDequeueTimeUtcDateTime?
The time in UTC when the oldest message was read from the queue and put in the cache.
newestMessageEnqueueTimeUtcDateTime?
The time in UTC when the newest message was enqueued to the queue.
totalMessageCountlong
The total message count.

TrackCachePressureMonitorStatusChange(string, bool, double?, double?, double?)

abstract
public abstract void TrackCachePressureMonitorStatusChange(string pressureMonitorType, bool underPressure, double? cachePressureContributionCount, double? currentPressure, double? flowControlThreshold)
Called when the cache pressure monitor encounter a status change.

Parameters

pressureMonitorTypestring
Type of the pressure monitor.
underPressurebool
if set to true, the cache is under pressure.
cachePressureContributionCountdouble?
The cache pressure contribution count.
currentPressuredouble?
The current pressure.
flowControlThresholddouble?
The flow control threshold.

TrackMemoryAllocated(int)

abstract
public abstract void TrackMemoryAllocated(int memoryInBytes)
Called when new memory is allocated by the cache.

Parameters

memoryInBytesint
The memory in bytes.

TrackMemoryReleased(int)

abstract
public abstract void TrackMemoryReleased(int memoryInBytes)
Called when memory returned to block pool.

Parameters

memoryInBytesint
The memory in bytes.

TrackMessagesAdded(long)

abstract
public abstract void TrackMessagesAdded(long messagesAdded)
Called when messages are added to the cache.

Parameters

messagesAddedlong
The number of messages added.

TrackMessagesPurged(long)

abstract
public abstract void TrackMessagesPurged(long messagesPurged)
Called when messages are purged from the cache.

Parameters

messagesPurgedlong
The number of messages purged.