1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/cmd/internal/profiling.go
Charles-Edouard Brétéché a6c8c401ff
feat: add signal in internal cmd package (#5444)
* feat: add signal in internal cmd package

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* logger

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-23 07:28:19 +00:00

16 lines
423 B
Go

package internal
import (
"net"
"github.com/go-logr/logr"
"github.com/kyverno/kyverno/pkg/profiling"
)
func SetupProfiling(logger logr.Logger) {
logger = logger.WithName("profiling").WithValues("enabled", profilingEnabled, "address", profilingAddress, "port", profilingPort)
if profilingEnabled {
logger.Info("setup profiling...")
profiling.Start(logger, net.JoinHostPort(profilingAddress, profilingPort))
}
}