feat(operations): add capacity and resilience gates (#18)

This commit is contained in:
KyuubiYoru
2026-07-16 15:57:01 +02:00
parent 08729ae25c
commit 609dad7cf1
21 changed files with 1759 additions and 107 deletions
@@ -0,0 +1,37 @@
using System.Text.Json;
namespace FinalFactory.Rendezvous.Capacity;
internal static class Program
{
private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web)
{
WriteIndented = true,
};
public static async Task<int> Main(string[] args)
{
CapacityOptions options;
try
{
options = CapacityOptions.Parse(args);
}
catch (ArgumentException exception)
{
Console.Error.WriteLine(exception.Message);
return 2;
}
CapacityReport report = await CapacityRunner.RunAsync(options).ConfigureAwait(false);
string json = JsonSerializer.Serialize(report, JsonOptions);
Console.WriteLine(json);
if (options.OutputPath is not null)
{
string fullPath = Path.GetFullPath(options.OutputPath);
Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!);
await File.WriteAllTextAsync(fullPath, json + Environment.NewLine).ConfigureAwait(false);
}
return report.Passed ? 0 : 1;
}
}