AuditResilience Enumeration

Assembly: CodeEffects.Rule.Audit.dll
Namespace: CodeEffects.Rule.Audit

Summary

Specifies how much of what an asynchronous recorder holds survives the process going away.

Syntax

public enum AuditResilience
{
	// Records wait in memory. What is held when the process ends is lost unless the recorder is flushed or disposed first
	Volatile = 0,

	// As Volatile, and the recorder moves what it holds into the database when the process exits normally or on an unhandled exception
	Drain = 1,

	// Every record is appended to a local journal file before the evaluation returns. The default
	Journal = 2
}

Remarks

Set the resilience through the Resilience property of AuditSettings. It applies only when Mode is Asynchronous, and is ignored in Synchronous mode.

Volatile is the cheapest. Records wait in an in-memory queue, and a background thread builds and writes them. The queue holds up to QueueCapacity records. A process that ends without calling Flush or Dispose loses what is still queued.

Drain queues the same way, and in addition moves what is queued into the database, for up to DrainTimeoutSeconds, when the process exits normally or fails on an unhandled exception. A process that is killed, fails fast, overflows its stack or loses power still loses what was queued.

Journal appends every record to a file in JournalFolder before the evaluation returns, and a background thread moves the records into the database. A record survives anything that happens to the process after that, and, with AuditJournalFlush.ToDisk, a power loss. What a process that is gone left in the folder is moved by the next recorder that uses the same folder, or by AuditJournal.

The numeric values are permanent.

Ask on Stack Overflow - Yes, it's still active
Ask in GitHub Discussions

p102

l097 --

l102

p101

×