feat(dashboard): show heartbeat, event-channel and replay-byte-cap options on Settings (mxaccessgw#219)
Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -91,10 +91,14 @@ else
|
||||
<tr><th scope="row">Startup timeout</th><td>@Snapshot.Configuration.Worker.StartupTimeoutSeconds seconds</td></tr>
|
||||
<tr><th scope="row">Shutdown timeout</th><td>@Snapshot.Configuration.Worker.ShutdownTimeoutSeconds seconds</td></tr>
|
||||
<tr><th scope="row">Heartbeat grace</th><td>@Snapshot.Configuration.Worker.HeartbeatGraceSeconds seconds</td></tr>
|
||||
<tr><th scope="row">Heartbeat check interval</th><td>@Snapshot.Configuration.Worker.HeartbeatCheckIntervalSeconds seconds</td></tr>
|
||||
<tr><th scope="row">Heartbeat stuck ceiling</th><td>@Snapshot.Configuration.Worker.HeartbeatStuckCeilingSeconds seconds</td></tr>
|
||||
<tr><th scope="row">Event channel full-mode timeout</th><td>@Snapshot.Configuration.Worker.EventChannelFullModeTimeoutMilliseconds ms</td></tr>
|
||||
<tr><th scope="row">Default command timeout</th><td>@Snapshot.Configuration.Sessions.DefaultCommandTimeoutSeconds seconds</td></tr>
|
||||
<tr><th scope="row">Max sessions</th><td>@Snapshot.Configuration.Sessions.MaxSessions</td></tr>
|
||||
<tr><th scope="row">Event queue capacity</th><td>@Snapshot.Configuration.Events.QueueCapacity</td></tr>
|
||||
<tr><th scope="row">Backpressure policy</th><td>@Snapshot.Configuration.Events.BackpressurePolicy</td></tr>
|
||||
<tr><th scope="row">Replay buffer max bytes</th><td>@Snapshot.Configuration.Events.ReplayBufferMaxBytes</td></tr>
|
||||
<tr><th scope="row">Dashboard enabled</th><td>@Snapshot.Configuration.Dashboard.Enabled</td></tr>
|
||||
<tr><th scope="row">Anonymous localhost</th><td>@Snapshot.Configuration.Dashboard.AllowAnonymousLocalhost</td></tr>
|
||||
<tr><th scope="row">Snapshot interval</th><td>@Snapshot.Configuration.Dashboard.SnapshotIntervalMilliseconds ms</td></tr>
|
||||
|
||||
@@ -95,10 +95,38 @@ public sealed class SettingsPageTagVisibilityRenderTests
|
||||
Assert.Contains("""<th scope="row">Recent session limit</th><td>456</td>""", html, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
private static async Task<string> RenderAsync(DashboardOptions dashboard)
|
||||
/// <summary>
|
||||
/// The heartbeat, event-channel and replay-byte-cap options (mxaccessgw#192, #172) reach the
|
||||
/// page, each value in the row its own label names. Non-default values prove plumbing.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task SettingsPage_RendersHeartbeatEventChannelAndReplayByteCapOptions()
|
||||
{
|
||||
string html = await RenderAsync(new GatewayOptions
|
||||
{
|
||||
Worker = new WorkerOptions
|
||||
{
|
||||
HeartbeatCheckIntervalSeconds = 7,
|
||||
HeartbeatStuckCeilingSeconds = 321,
|
||||
EventChannelFullModeTimeoutMilliseconds = 4567,
|
||||
},
|
||||
Events = new EventOptions { ReplayBufferMaxBytes = 987654321 },
|
||||
});
|
||||
|
||||
Assert.Contains("""<th scope="row">Heartbeat check interval</th><td>7 seconds</td>""", html, StringComparison.Ordinal);
|
||||
Assert.Contains("""<th scope="row">Heartbeat stuck ceiling</th><td>321 seconds</td>""", html, StringComparison.Ordinal);
|
||||
Assert.Contains("""<th scope="row">Event channel full-mode timeout</th><td>4567 ms</td>""", html, StringComparison.Ordinal);
|
||||
Assert.Contains("""<th scope="row">Replay buffer max bytes</th><td>987654321</td>""", html, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
private static Task<string> RenderAsync(DashboardOptions dashboard) =>
|
||||
RenderAsync(new GatewayOptions { Dashboard = dashboard });
|
||||
|
||||
private static async Task<string> RenderAsync(GatewayOptions options)
|
||||
{
|
||||
EffectiveGatewayConfiguration configuration =
|
||||
new GatewayConfigurationProvider(Options.Create(new GatewayOptions { Dashboard = dashboard }))
|
||||
new GatewayConfigurationProvider(Options.Create(options))
|
||||
.GetEffectiveConfiguration();
|
||||
|
||||
ServiceCollection services = new();
|
||||
|
||||
Reference in New Issue
Block a user