DiagnosticsHelper
Ecng.Logging
Extension methods for diagnostics logging on ILogReceiver.
Methoden
LogGrowingSizes
public static bool LogGrowingSizes(ILogReceiver log, CollectionSizeLog sizeLog)
result = DiagnosticsHelper.LogGrowingSizes(log, sizeLog)
Logs only the tracked collections that grew since the last call, at warning level. Returns true if any growth was detected.
LogGrowth
public static void LogGrowth(ILogReceiver log, GrowthTracker tracker, long current, string name)
DiagnosticsHelper.LogGrowth(log, tracker, current, name)
Emits a warning if has crossed the next doubling tier for the counter identified by . Uses a GrowthTracker instance so that one field per class replaces many individual watermark fields.
LogGrowth
public static void LogGrowth(ILogReceiver log, long watermark, long current, string name)
DiagnosticsHelper.LogGrowth(log, watermark, current, name)
Emits a warning if has crossed the next doubling tier. Uses a raw ref long watermark — one field per tracked counter.
LogMemorySnapshot
public static MemorySnapshot LogMemorySnapshot(ILogReceiver log)
result = DiagnosticsHelper.LogMemorySnapshot(log)
Logs a memory snapshot at warning level.
LogMemorySnapshotIfGrew
public static MemorySnapshot? LogMemorySnapshotIfGrew(ILogReceiver log, long lastHeap, long threshold)
result = DiagnosticsHelper.LogMemorySnapshotIfGrew(log, lastHeap, threshold)
Logs a memory snapshot only if managed heap grew by at least bytes since the last reported value stored in .
Rückgabe: The captured snapshot, or null if no log was emitted.
LogSizes
public static void LogSizes(ILogReceiver log, CollectionSizeLog sizeLog)
DiagnosticsHelper.LogSizes(log, sizeLog)
Logs all tracked collection sizes at info level.