srs/internal/debug/pprof.go
winlin 5ea9f573f2 Update copyright year from 2025 to 2026 across all source files
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 13:50:07 -04:00

22 lines
386 B
Go

// Copyright (c) 2026 Winlin
//
// SPDX-License-Identifier: MIT
package debug
import (
"context"
"net/http"
"srsx/internal/env"
"srsx/internal/logger"
)
func HandleGoPprof(ctx context.Context, environment env.Environment) {
if addr := environment.GoPprof(); addr != "" {
go func() {
logger.Df(ctx, "Start Go pprof at %v", addr)
http.ListenAndServe(addr, nil)
}()
}
}