Documentation
¶
Overview ¶
Package dashboard provides a live HTTP dashboard that streams Pulse metrics to a browser in real time using Server-Sent Events (SSE).
Usage:
srv := dashboard.New()
go srv.ListenAndServe(ctx, ":9090")
// Wire into pulse.Config:
cfg.OnSnapshot = func(s pulse.Snapshot) { srv.Push(s) }
cfg.OnResult = func(r pulse.Result, passed bool) { srv.Complete(r, passed) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a lightweight HTTP server that serves a live metrics dashboard. Metrics are pushed to all connected browsers via SSE. It is safe to call Push and Complete from multiple goroutines.
func (*Server) ListenAndServe ¶
ListenAndServe starts the HTTP server on addr and blocks until ctx is cancelled or an unrecoverable error occurs. The error returned is non-nil only if the server fails to bind or start; context cancellation is not treated as an error.
Click to show internal directories.
Click to hide internal directories.