Class CachePerformanceSnapshot
Represents a snapshot of cache performance metrics at a specific point in time.
public sealed class CachePerformanceSnapshot
- Inheritance
-
CachePerformanceSnapshot
- Inherited Members
- Extension Methods
Properties
AverageGetTimeMs
Gets the average time to retrieve items from cache in milliseconds.
public double AverageGetTimeMs { get; init; }
Property Value
- double
The average time to retrieve items from cache in milliseconds.
AverageSetTimeMs
Gets the average time to store items in cache in milliseconds.
public double AverageSetTimeMs { get; init; }
Property Value
- double
The average time to store items in cache in milliseconds.
AverageSizeBytes
Gets the average size per cached item in bytes.
public long AverageSizeBytes { get; }
Property Value
- long
The average size per cached item in bytes.
CollectionDuration
Gets the duration over which these metrics were collected.
public TimeSpan CollectionDuration { get; init; }
Property Value
- TimeSpan
The duration over which these metrics were collected.
ConcurrentOperations
Gets the number of concurrent operations.
public int ConcurrentOperations { get; init; }
Property Value
- int
The number of concurrent operations.
CpuUsagePercent
Gets the CPU usage percentage for cache operations.
public double CpuUsagePercent { get; init; }
Property Value
- double
The CPU usage percentage for cache operations.
CustomMetrics
Gets cache-specific metrics.
public IReadOnlyDictionary<string, object> CustomMetrics { get; init; }
Property Value
- IReadOnlyDictionary<string, object>
Cache-specific metrics.
ErrorCounts
Gets error counts by error type.
public IReadOnlyDictionary<string, long> ErrorCounts { get; init; }
Property Value
- IReadOnlyDictionary<string, long>
Error counts by error type.
ErrorRate
Gets the error rate (errors per request).
public double ErrorRate { get; }
Property Value
- double
The error rate (errors per request).
EvictionCount
Gets the number of evictions that have occurred.
public long EvictionCount { get; init; }
Property Value
- long
The number of evictions that have occurred.
HealthWarnings
Gets health warnings if any.
public IReadOnlyList<string> HealthWarnings { get; init; }
Property Value
- IReadOnlyList<string>
Health warnings if any.
HitCount
Gets the total number of cache hits.
public long HitCount { get; init; }
Property Value
- long
The total number of cache hits.
HitRatio
Gets the cache hit ratio.
public double HitRatio { get; }
Property Value
- double
The cache hit ratio as a value between 0 and 1.
IsHealthy
Gets a value indicating whether the cache is healthy based on these metrics.
public bool IsHealthy { get; init; }
Property Value
ItemCount
Gets the number of items currently in the cache.
public long ItemCount { get; init; }
Property Value
- long
The number of items currently in the cache.
MaxGetTimeMs
Gets the maximum get time in milliseconds.
public double MaxGetTimeMs { get; init; }
Property Value
- double
The maximum get time in milliseconds.
MemoryPressure
Gets the memory pressure level (0-100).
public int MemoryPressure { get; init; }
Property Value
- int
The memory pressure level (0-100).
MissCount
Gets the total number of cache misses.
public long MissCount { get; init; }
Property Value
- long
The total number of cache misses.
P95GetTimeMs
Gets the 95th percentile get time in milliseconds.
public double P95GetTimeMs { get; init; }
Property Value
- double
The 95th percentile get time in milliseconds.
P99GetTimeMs
Gets the 99th percentile get time in milliseconds.
public double P99GetTimeMs { get; init; }
Property Value
- double
The 99th percentile get time in milliseconds.
PendingOperations
Gets the number of pending operations in queue.
public int PendingOperations { get; init; }
Property Value
- int
The number of pending operations in queue.
ThroughputOpsPerSecond
Gets the cache throughput in operations per second.
public double ThroughputOpsPerSecond { get; init; }
Property Value
- double
The cache throughput in operations per second.
Timestamp
Gets when this snapshot was taken.
public DateTimeOffset Timestamp { get; init; }
Property Value
- DateTimeOffset
The timestamp when this snapshot was taken.
TotalErrors
Gets the total error count.
public long TotalErrors { get; init; }
Property Value
- long
The total error count.
TotalRequests
Gets the total number of cache requests.
public long TotalRequests { get; }
Property Value
- long
The total number of cache requests (hits plus misses).
TotalSizeBytes
Gets the total size of cached data in bytes.
public long TotalSizeBytes { get; init; }
Property Value
- long
The total size of cached data in bytes.
Methods
ToString()
Creates a summary string of the performance snapshot.
public override string ToString()
Returns
- string
A formatted summary of key metrics.