Path: redb-tsak/src/redb.Tsak.Contracts/DiagnosticModels.cs
Snapshot: redb-tsak, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-tsak
Page: https://redbase.app/src/dev-2026-12-06/redb-tsak/src/redb.Tsak.Contracts/DiagnosticModels.cs
----
namespace redb.Tsak.Contracts;
///
/// Full system diagnostic dump — analogous to a JVM thread dump,
/// adapted for .NET (no per-thread stacks).
///
public sealed record DiagnosticDump
{
public DateTime Timestamp { get; init; } = DateTime.UtcNow;
public IReadOnlyList InflightExchanges { get; init; } = [];
public required ThreadPoolDiagnostics ThreadPool { get; init; }
public required GcDiagnostics GarbageCollector { get; init; }
public IReadOnlyList Contexts { get; init; } = [];
public IReadOnlyList ActiveAlerts { get; init; } = [];
public IReadOnlyList RecentEvents { get; init; } = [];
public SystemMetricsSnapshot? SystemMetrics { get; init; }
}
///
/// Per-context summary in the diagnostic dump.
///
public sealed record DiagnosticContextSummary
{
public required string ContextName { get; init; }
public bool IsStarted { get; init; }
public int RouteCount { get; init; }
public int EndpointCount { get; init; }
public int InflightCount { get; init; }
}
///
/// Thread pool snapshot for diagnostics.
///
public sealed record ThreadPoolDiagnostics
{
public long PendingWorkItems { get; init; }
public int WorkerThreadsAvailable { get; init; }
public int WorkerThreadsMin { get; init; }
public int WorkerThreadsMax { get; init; }
public int IoThreadsAvailable { get; init; }
public int IoThreadsMin { get; init; }
public int IoThreadsMax { get; init; }
}
///
/// GC statistics snapshot for diagnostics.
///
public sealed record GcDiagnostics
{
public int Gen0Collections { get; init; }
public int Gen1Collections { get; init; }
public int Gen2Collections { get; init; }
public double TotalMemoryMB { get; init; }
}
///
/// Diagnostic dump for a single route.
///
public sealed record RouteDiagnosticDump
{
public required string RouteId { get; init; }
public required string FromUri { get; init; }
public required string Status { get; init; }
public bool AutoStart { get; init; }
public IReadOnlyList InflightExchanges { get; init; } = [];
public RouteMetricsSummary? Metrics { get; init; }
public IReadOnlyList RecentErrors { get; init; } = [];
public IReadOnlyList LifecycleHistory { get; init; } = [];
}