srs/internal/debug/pprof.go
winlin fe86846e3b OpenClaw: Rename proxy environment interface
Rename the proxy environment type and generated fake to clarify that the configuration surface belongs to the proxy server.

Update proxy bootstrap, load balancers, protocol servers, debug, signal handling, tests, and codebase memory to use ProxyEnvironment.
2026-04-26 11:56:28 -04:00

22 lines
391 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.ProxyEnvironment) {
if addr := environment.GoPprof(); addr != "" {
go func() {
logger.Df(ctx, "Start Go pprof at %v", addr)
http.ListenAndServe(addr, nil)
}()
}
}