Skip to content

DefaultCacheMonitor Methods

cache monitor used as a default option in GeneratorStreamprovider and MemoryStreamProvider

ReportCacheSize(long)

View source
public void ReportCacheSize(long totalCacheSizeInByte)
Called to report the total cache size.

Parameters

totalCacheSizeInBytelong
The total cache size in bytes.

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

View source
public 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?)

View source
public 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)

View source
public void TrackMemoryAllocated(int memoryInByte)
Called when new memory is allocated by the cache.

Parameters

memoryInByteint
The memory in bytes.

TrackMessagesAdded(long)

View source
public void TrackMessagesAdded(long messageAdded)
Called when messages are added to the cache.

Parameters

messageAddedlong
The number of messages added.

TrackMessagesPurged(long)

View source
public void TrackMessagesPurged(long messagePurged)
Called when messages are purged from the cache.

Parameters

messagePurgedlong
The number of messages purged.