feat(mtconnect): warn at Test Connect and deploy when SampleCount >= the Agent bufferSize (#825)

Parse the /probe Header bufferSize; MTConnectDriverProbe reads sampleCount
(default 1000) and answers Ok with a WARNING message (amber chip in the
Test Connect button); InitializeAsync logs the same Warning and exposes
agentBufferSize on the diagnostics bag. Live-checked against the shared
cppagent fixture (bufferSize 16384).
This commit is contained in:
Joseph Doherty
2026-11-11 01:23:33 -05:00
parent 40969e5c4b
commit f8f6781a24
9 changed files with 258 additions and 5 deletions
@@ -12,7 +12,16 @@
@if (_result is not null)
{
@if (_result.Ok)
@if (_result.Ok && WarningOf(_result.Message) is { } warning)
{
@* Reachable but misconfigured (e.g. MTConnect SampleCount >= the Agent's bufferSize, #825): a probe
that answers Ok with a "WARNING:" message is shown amber with the warning, never a plain green OK. *@
<span class="chip chip-warn" title="@warning">
OK with warning &middot; @_result.LatencyMs?.ToString("F0") ms
</span>
<div class="small text-warning mt-1">@warning</div>
}
else if (_result.Ok)
{
<span class="chip chip-ok" title="@($"Probe succeeded in {_result.LatencyMs:F0} ms")">
OK &middot; @_result.LatencyMs?.ToString("F0") ms
@@ -28,6 +37,16 @@
</div>
@code {
/// <summary>The marker a probe puts in an <c>Ok</c> message to flag a warning (see <c>MTConnectDriverProbe</c>).</summary>
internal const string WarningMarker = "WARNING:";
/// <summary>The warning text after <see cref="WarningMarker"/>, or null when the message carries none.</summary>
internal static string? WarningOf(string? message)
{
var at = message?.IndexOf(WarningMarker, StringComparison.Ordinal) ?? -1;
return at < 0 ? null : message![(at + WarningMarker.Length)..].Trim();
}
/// <summary>Driver type key — must match an installed <c>IDriverProbe.DriverType</c>.</summary>
[Parameter, EditorRequired] public string DriverType { get; set; } = "";