Add server stats websocket reporting

This commit is contained in:
2026-11-07 01:35:39 +00:00
parent 81955059de
commit 95849f636a
10 changed files with 516 additions and 2 deletions
+6
View File
@@ -21,6 +21,8 @@ import (
// Options configures the HTTP handler.
type Options struct {
// ServerStatsSampler overrides host sampling for deterministic tests.
ServerStatsSampler ServerStatsSampler
// AllowAuthoring permits publishing immutable definitions. Execution servers
// default to run-only: a CLI --yes flag or raw RPC cannot grant this server
// capability. Enable deliberately on a separate trusted authoring instance.
@@ -277,6 +279,10 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
if handleDirectoryListing(request, write) {
continue
}
if request.Type == protocol.ServerStatsRequest {
go handleServerStats(connCtx, request, runs, options.ServerStatsSampler, started, build, write)
continue
}
if handleNotificationSettings(ctx, request, settingsStore, write) {
continue
}