summaryrefslogtreecommitdiff
path: root/internal/flamegraph/webserver.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/flamegraph/webserver.go')
-rw-r--r--internal/flamegraph/webserver.go5
1 files changed, 5 insertions, 0 deletions
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 {