513fa1aa16
Comment/XML-doc changes only: - add summaries to ~10k test methods, fixtures, fakes and helpers (+ <param> on theories, <returns> on async Task methods, <inheritdoc/> on interface implementations the checker can resolve) - strip ~2.6k project-tracking references (WP*, P*-*, row-NN, Task N, #NN, Component-0NN) from comments, keeping the explanatory text; reword false positives in comments only - real docs on fakes implementing BCL/library interfaces (IDisposable, ILogger, IOptionsMonitor, IAsyncLifetime) - reword the last 5 src/ false positives (CWE-1236, failures-1, year-0001, M365) Only non-comment edits: four one-line nested classes split across lines so members can carry docs. Build 0 errors / 0 warnings.
55 lines
2.1 KiB
C#
55 lines
2.1 KiB
C#
using System.Text.Json;
|
|
using ZB.MOM.WW.ScadaBridge.LoadHarness;
|
|
|
|
// Target-scale load harness.
|
|
//
|
|
// Full-scale protocol run (the target-scale numbers):
|
|
// dotnet run -c Release --project tests/ZB.MOM.WW.ScadaBridge.LoadHarness -- \
|
|
// --sustain-minutes 20 --results loadharness-results.json
|
|
//
|
|
// Full 1-hour version, unchanged in every other respect:
|
|
// ... -- --sustain-minutes 60 --results loadharness-results-1h.json
|
|
//
|
|
// Scaled-down smoke (what the CI [Fact] runs):
|
|
// ... -- --sites 2 --instances-per-site 10 --tags-per-instance 5 \
|
|
// --settle-minutes 0.1 --sustain-minutes 0.2 --sample-seconds 2 \
|
|
// --sf-drain-messages 200 --slow-subscriber-events 2000
|
|
|
|
var config = HarnessConfig.Parse(args);
|
|
|
|
Console.WriteLine("ScadaBridge target-scale load harness");
|
|
Console.WriteLine($" sites {config.Sites}");
|
|
Console.WriteLine($" instances/site {config.InstancesPerSite}");
|
|
Console.WriteLine($" tags/instance {config.TagsPerInstance}");
|
|
Console.WriteLine($" total subscriptions {config.TotalSubscriptions:N0}");
|
|
Console.WriteLine($" stream probes/site {config.StreamProbesPerSite} in-process + {config.WireProbesPerSite} wire (real gRPC)");
|
|
Console.WriteLine($" nominal update rate {config.NominalUpdatesPerSecond:N0}/s");
|
|
Console.WriteLine($" settle / sustain {config.SettleDuration.TotalMinutes:F1} / {config.SustainDuration.TotalMinutes:F1} min");
|
|
Console.WriteLine();
|
|
|
|
using var cancellation = new CancellationTokenSource();
|
|
Console.CancelKeyPress += (_, e) =>
|
|
{
|
|
e.Cancel = true;
|
|
cancellation.Cancel();
|
|
};
|
|
|
|
try
|
|
{
|
|
var result = await HarnessRun.ExecuteAsync(config, Console.WriteLine, cancellation.Token);
|
|
|
|
var json = JsonSerializer.Serialize(result, new JsonSerializerOptions { WriteIndented = true });
|
|
await File.WriteAllTextAsync(config.ResultsPath, json, cancellation.Token);
|
|
|
|
Console.WriteLine();
|
|
Console.WriteLine(ResultsFormatter.Format(result));
|
|
Console.WriteLine();
|
|
Console.WriteLine($"JSON metrics written to {Path.GetFullPath(config.ResultsPath)}");
|
|
return 0;
|
|
}
|
|
catch (OperationCanceledException)
|
|
{
|
|
Console.Error.WriteLine("Run cancelled.");
|
|
return 130;
|
|
}
|