Table of Contents

Class TestExecutionCollector

Namespace
Xping.Sdk.Core.Collection
Assembly
Xping.Sdk.Core.dll

Thread-safe collector for test execution data with automatic batching and flushing.

public sealed class TestExecutionCollector : ITestExecutionCollector, IAsyncDisposable
Inheritance
TestExecutionCollector
Implements
Inherited Members

Constructors

TestExecutionCollector(ITestResultUploader, XpingConfiguration, IXpingLogger?)

Initializes a new instance of the TestExecutionCollector class.

public TestExecutionCollector(ITestResultUploader uploader, XpingConfiguration config, IXpingLogger? logger = null)

Parameters

uploader ITestResultUploader

The uploader for sending test results.

config XpingConfiguration

The configuration settings.

logger IXpingLogger

Optional logger for diagnostics. If null, uses NullLogger.

Exceptions

ArgumentNullException

Thrown when uploader or config is null.

Methods

DisposeAsync()

Disposes the collector and performs a final flush.

public ValueTask DisposeAsync()

Returns

ValueTask

FlushAsync(CancellationToken)

Manually triggers a flush of buffered test executions to the uploader.

public Task FlushAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A cancellation token to cancel the operation.

Returns

Task

A task representing the asynchronous flush operation.

GetStatsAsync()

Retrieves statistics about the collector's current state.

public Task<CollectorStats> GetStatsAsync()

Returns

Task<CollectorStats>

A task containing the collector statistics.

RecordTest(TestExecution)

Records a test execution for later upload.

public void RecordTest(TestExecution execution)

Parameters

execution TestExecution

The test execution data to record.

Exceptions

ArgumentNullException

Thrown when execution is null.

ObjectDisposedException

Thrown when the collector has been disposed.