You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 30, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: main.go
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,8 @@ package main
18
18
19
19
import (
20
20
"flag"
21
+
"net/http"
22
+
_ "net/http/pprof"
21
23
"os"
22
24
"time"
23
25
@@ -54,6 +56,7 @@ func main() {
54
56
enableLeaderElectionbool
55
57
syncPeriod time.Duration
56
58
watchNamespacestring
59
+
profilerAddressstring
57
60
)
58
61
59
62
flag.StringVar(
@@ -91,10 +94,24 @@ func main() {
91
94
"Namespace that the controller watches to reconcile cluster-api objects. If unspecified, the controller watches for cluster-api objects across all namespaces.",
92
95
)
93
96
97
+
flag.StringVar(
98
+
&profilerAddress,
99
+
"profiler-address",
100
+
"",
101
+
"Bind address to expose the pprof profiler (e.g. localhost:6060)",
102
+
)
103
+
94
104
flag.Parse()
95
105
96
106
ctrl.SetLogger(klogr.New())
97
107
108
+
ifprofilerAddress!="" {
109
+
klog.Infof("Profiler listening for requests at %s", profilerAddress)
0 commit comments