From 78e9de77d8c443fe8dbe560b5ccb168a6142eb55 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 24 Feb 2026 22:55:26 +0200 Subject: add docs --- internal/flamegraph/webserver.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal/flamegraph/webserver.go') diff --git a/internal/flamegraph/webserver.go b/internal/flamegraph/webserver.go index 7925011..b1a68e9 100644 --- a/internal/flamegraph/webserver.go +++ b/internal/flamegraph/webserver.go @@ -13,6 +13,11 @@ import ( "time" ) +// ServeSVG starts a small HTTP server that serves a single flamegraph SVG. +// +// It prints a URL of the form http://HOSTNAME:PORT/abs/path/to.svg and blocks until +// the user presses Ctrl+C or the process receives SIGTERM, at which point the server +// is shut down gracefully. func ServeSVG(svgFile string) error { absPath, err := filepath.Abs(svgFile) if err != nil { -- cgit v1.2.3