Status Event
Fires to report the latest cache statistics.
Syntax
public event OnStatusHandler OnStatus; public delegate void OnStatusHandler(object sender, FilecacheStatusEventArgs e); public class FilecacheStatusEventArgs : EventArgs { public long CacheSize { get; } public long TotalData { get; } public long UnflushedData { get; } public int UnflushedFiles { get; } public int CurrentOperation { get; } public string CurrentFileId { get; } }
Public Event OnStatus As OnStatusHandler Public Delegate Sub OnStatusHandler(sender As Object, e As FilecacheStatusEventArgs) Public Class FilecacheStatusEventArgs Inherits EventArgs Public ReadOnly Property CacheSize As Long Public ReadOnly Property TotalData As Long Public ReadOnly Property UnflushedData As Long Public ReadOnly Property UnflushedFiles As Integer Public ReadOnly Property CurrentOperation As Integer Public ReadOnly Property CurrentFileId As String End Class
Remarks
This event fires once every StatsRefreshInterval to provide the application with the latest cache statistics, as well as information about any in-progress cache operation.
The CacheSize parameter reflects the current size of the cache, in bytes.
The TotalData parameter reflects the total amount of data present in the cache, in bytes.
The UnflushedData parameter reflects the amount of unflushed data present in the cache, in bytes.
The UnflushedFiles parameter reflects the number of unflushed files present in the cache.
The CurrentOperation parameter reflects the cache's current operations; it will be one of the following values:
CACHE_OP_IDLE | 0 | The cache is idle. |
CACHE_OP_CLEANUP | 2 | Cache cleanup is being performed. |
CACHE_OP_COMPACT | 3 | The cache's storage file is being compacted. |
CACHE_OP_READ | 4 | The cache is reading some file's data. |
CACHE_OP_WRITE | 5 | The cache is writing some file's data. |
When CurrentOperation is CACHE_OP_READ or CACHE_OP_WRITE, the CurrentFileId parameter will reflect the Id of the cached file being processed.
Note that this event can fire in the context of any thread.