2b80a6defa
New ResidualBench tool (eventlog, flatten, audit, audit-contention) and docker/measure-ui-responsiveness.sh. All four residuals pass; results in docs/plans/2026-11-10-wp4-residual-scope-results.md. Findings filed as #122, #123 and #124 (fixed in the following commit).
35 lines
1.4 KiB
C#
35 lines
1.4 KiB
C#
using System.Runtime;
|
|
using ZB.MOM.WW.ScadaBridge.ResidualBench;
|
|
|
|
// Phase-8 WP-4 residual-scope benchmarks (ScadaBridge#49). See the csproj header.
|
|
//
|
|
// dotnet run -c Release --project tests/ZB.MOM.WW.ScadaBridge.ResidualBench -- eventlog [--data-dir DIR] [--rows N]
|
|
// dotnet run -c Release --project tests/ZB.MOM.WW.ScadaBridge.ResidualBench -- flatten
|
|
// dotnet run -c Release --project tests/ZB.MOM.WW.ScadaBridge.ResidualBench -- audit --connection-string "..."
|
|
// dotnet run -c Release --project tests/ZB.MOM.WW.ScadaBridge.ResidualBench -- audit-contention [--writers N] [--seconds S]
|
|
|
|
if (args.Length == 0)
|
|
{
|
|
Console.Error.WriteLine("usage: ResidualBench <eventlog|flatten|audit|audit-contention> [options]");
|
|
return 2;
|
|
}
|
|
|
|
var options = BenchArgs.Parse(args.Skip(1));
|
|
Console.WriteLine($"# ResidualBench {args[0]} — {DateTimeOffset.UtcNow:o}");
|
|
Console.WriteLine($"# runtime {Environment.Version}, server GC {GCSettings.IsServerGC}, {Environment.ProcessorCount} logical cores");
|
|
|
|
return args[0] switch
|
|
{
|
|
"eventlog" => await EventLogBench.RunAsync(options),
|
|
"flatten" => FlattenBench.Run(options),
|
|
"audit" => await AuditBench.RunAsync(options),
|
|
"audit-contention" => await AuditContentionBench.RunAsync(options),
|
|
_ => Unknown(args[0]),
|
|
};
|
|
|
|
static int Unknown(string mode)
|
|
{
|
|
Console.Error.WriteLine($"unknown mode '{mode}'");
|
|
return 2;
|
|
}
|