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
✨ Add test profiling toolchain for heap and CPU analysis
Go-based profiling toolchain for collecting and analyzing memory/CPU profiles
during tests with native Kubernetes integration.
**Features:**
- Automated heap and CPU profile collection from operator-controller and catalogd
- Native Kubernetes port-forwarding via client-go (no kubectl dependency)
- Resilient cluster waiting (15min namespace, 10min deployment timeouts)
- Self-daemonizing background execution with signal handling
- Per-component namespace support for flexible deployment topologies
**Usage:**
```bash
make start-profiling
make test-e2e
make stop-profiling
```
**Configuration:**
```bash
TEST_PROFILE_NAMESPACE=olmv1-system # default namespace
TEST_PROFILE_OPERATOR_CONTROLLER_NAMESPACE=custom-ns # optional override
TEST_PROFILE_CATALOGD_NAMESPACE=catalogd-system # optional override
TEST_PROFILE_MODE=both # both|heap|cpu
TEST_PROFILE_INTERVAL=10 # seconds
```
**Output:** Profile data with analysis reports in `test-profiles/<timestamp>/`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Todd Short <tshort@redhat.com>
build-test-profiler: #EXHELP Build the test profiling tool
341
+
cd hack/tools/test-profiling && go build -o ../../../$(TEST_PROFILE_BIN) ./cmd/test-profile
342
+
343
+
.PHONY: test-test-profiler
344
+
test-test-profiler: #EXHELP Run unit tests for the test profiling tool
345
+
cd hack/tools/test-profiling && go test -v ./...
346
+
347
+
.PHONY: start-profiling
348
+
start-profiling: build-test-profiler #EXHELP Start profiling in background with auto-generated name (timestamp). Use start-profiling/<name> for custom name.
349
+
$(TEST_PROFILE_BIN) start
350
+
351
+
.PHONY: start-profiling/%
352
+
start-profiling/%: build-test-profiler #EXHELP Start profiling in background with specified name. Usage: make start-profiling/<name>
353
+
$(TEST_PROFILE_BIN) start $*
354
+
355
+
.PHONY: stop-profiling
356
+
stop-profiling: build-test-profiler #EXHELP Stop profiling and generate analysis report
0 commit comments