Class TestObservabilityOptions

Namespace
XBullet.EasyTesting.Observability
Assembly
XBullet.EasyTesting.Observability.dll

Configures observability capture for one integration-test scenario.

public sealed class TestObservabilityOptions
Inheritance
TestObservabilityOptions
Inherited Members

Properties

ActivitySourceNames

Gets exact activity source names to capture, or an empty list to capture all.

public IReadOnlyList<string> ActivitySourceNames { get; }

Property Value

IReadOnlyList<string>

A live read-only view of distinct, non-empty names in registration order. Matching is ordinal and case-sensitive; an empty list captures all activity sources.

FakeTimeStart

Gets the initial fake UTC time, or null to use FakeTimeProvider's default.

public DateTimeOffset? FakeTimeStart { get; }

Property Value

DateTimeOffset?

The absolute starting instant supplied to UseFakeTime(DateTimeOffset?), or null to use the fake provider's default start.

MaximumActivityEntries

Gets or sets the maximum number of completed activities retained in memory.

public int MaximumActivityEntries { get; set; }

Property Value

int

A positive entry count. The default is 1,000; the oldest activities are discarded first.

MaximumLogEntries

Gets or sets the maximum number of log entries retained in memory.

public int MaximumLogEntries { get; set; }

Property Value

int

A positive entry count. The default is 1,000; the oldest entries are discarded first.

MaximumMetricMeasurements

Gets or sets the maximum number of metric measurements retained in memory.

public int MaximumMetricMeasurements { get; set; }

Property Value

int

A positive measurement count. The default is 1,000; the oldest values are discarded first.

MeterNames

Gets exact meter names to capture, or an empty list to capture all.

public IReadOnlyList<string> MeterNames { get; }

Property Value

IReadOnlyList<string>

A live read-only view of distinct, non-empty names in registration order. Matching is ordinal and case-sensitive; an empty list captures all meters.

UsesFakeTime

Gets whether the application's TimeProvider is replaced with deterministic time.

public bool UsesFakeTime { get; }

Property Value

bool

true after UseFakeTime(DateTimeOffset?) is called; otherwise, false.

Methods

CaptureActivitySource(string)

Restricts activity capture to the supplied exact source name.

public TestObservabilityOptions CaptureActivitySource(string sourceName)

Parameters

sourceName string

The non-empty source name to add. Matching is ordinal and case-sensitive; an exact duplicate is ignored.

Returns

TestObservabilityOptions

This options instance, for chaining.

CaptureMeter(string)

Restricts metric capture to the supplied exact meter name.

public TestObservabilityOptions CaptureMeter(string meterName)

Parameters

meterName string

The non-empty meter name to add. Matching is ordinal and case-sensitive; an exact duplicate is ignored.

Returns

TestObservabilityOptions

This options instance, for chaining.

UseFakeTime(DateTimeOffset?)

Replaces the application's TimeProvider with deterministic time.

public TestObservabilityOptions UseFakeTime(DateTimeOffset? start = null)

Parameters

start DateTimeOffset?

The absolute initial fake time, or null to use Microsoft.Extensions.Time.Testing.FakeTimeProvider's default. Calling this method again replaces the prior value.

Returns

TestObservabilityOptions

This options instance, for chaining.