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
uploaderITestResultUploaderThe uploader for sending test results.
configXpingConfigurationThe configuration settings.
loggerIXpingLoggerOptional 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
FlushAsync(CancellationToken)
Manually triggers a flush of buffered test executions to the uploader.
public Task FlushAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA 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
executionTestExecutionThe test execution data to record.
Exceptions
- ArgumentNullException
Thrown when execution is null.
- ObjectDisposedException
Thrown when the collector has been disposed.