perf(mtconnect): headers-only connectivity probe (R06:T-7)
The connectivity probe parsed the full /probe device model every 5 s and discarded it. It now calls a new IMTConnectAgentClient.PingAsync: one GET /probe read with ResponseHeadersRead and a status check; the body is dropped unread. Same failure surface as ProbeAsync (the default implementation delegates to it). The probe-tick tests now count pings and pin that no tick issues a full /probe; the shutdown test's absence assertion gained a positive control. Refs #743 Claude-Session: https://claude.ai/code/session_01Ub9hGmYLQvn9XETzw7CMsT
This commit is contained in:
@@ -272,6 +272,22 @@ internal sealed class CannedAgentClient : IMTConnectAgentClient, IDisposable
|
||||
return answer;
|
||||
}
|
||||
|
||||
/// <summary>Number of connectivity pings (headers-only <c>/probe</c>) issued against this client.</summary>
|
||||
public int PingCallCount => Volatile.Read(ref _pingCallCount);
|
||||
|
||||
private int _pingCallCount;
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <remarks>Same failure surface as <see cref="ProbeAsync"/> (<see cref="ProbeFailure"/>), counted separately.</remarks>
|
||||
public Task PingAsync(CancellationToken ct)
|
||||
{
|
||||
ObjectDisposedException.ThrowIf(IsDisposed, this);
|
||||
ct.ThrowIfCancellationRequested();
|
||||
Interlocked.Increment(ref _pingCallCount);
|
||||
|
||||
return ProbeFailure is null ? Task.CompletedTask : throw ProbeFailure;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<MTConnectStreamsResult> CurrentAsync(CancellationToken ct)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user