From fe0ab6d176e0d3785c752ff8262e0b7e121c2113 Mon Sep 17 00:00:00 2001 From: Honeypot Date: Thu, 24 Mar 2022 14:11:24 +0200 Subject: [PATCH] add pprof --- cmd/rusid/sidecar.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/rusid/sidecar.go b/cmd/rusid/sidecar.go index 703cb47..39aaadc 100644 --- a/cmd/rusid/sidecar.go +++ b/cmd/rusid/sidecar.go @@ -3,7 +3,9 @@ package main import ( "context" "flag" + "k8s.io/klog/v2" "net/http" + _ "net/http/pprof" "os" "os/signal" "runtime/debug" @@ -20,8 +22,6 @@ import ( "rusi/pkg/runtime" "sync" "time" - - "k8s.io/klog/v2" ) func main() { @@ -32,6 +32,10 @@ func main() { klog.InitFlags(nil) defer klog.Flush() + go func() { + http.ListenAndServe("localhost:6060", nil) + }() + cfgBuilder := runtime.NewRuntimeConfigBuilder() cfgBuilder.AttachCmdFlags(flag.StringVar, flag.BoolVar, flag.IntVar) flag.Parse()