Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
05ee601
📊 Calibrate Prometheus alert thresholds using memory profiling data (…
tmshort Nov 6, 2025
9530175
:seedling: Bump github.com/containerd/containerd from 1.7.28 to 1.7.2…
dependabot[bot] Nov 6, 2025
b3f85d5
Revert "Upgrade compatible bingo binaries ( kind/kustomize/opm/envtes…
tmshort Nov 7, 2025
d4e93be
fix: improve boxcutter logging levels (#2314)
camilamacedo86 Nov 10, 2025
0268fae
✨ Add e2e profiling toolchain for heap and CPU analysis (#2298)
tmshort Nov 10, 2025
b634dac
:seedling: Bump golang.org/x/sync from 0.17.0 to 0.18.0 (#2317)
dependabot[bot] Nov 10, 2025
5804c72
Merge branch 'main' into synchronize
camilamacedo86 Nov 11, 2025
9e2e982
UPSTREAM: <carry>: Add OpenShift specific files
dtfranz Oct 26, 2023
c5e8312
UPSTREAM: <carry>: Add new tests for single/own namespaces install modes
camilamacedo86 Oct 6, 2025
6c4ed5e
UPSTREAM: <carry>: Upgrade OCP image from 4.20 to 4.21
camilamacedo86 Oct 13, 2025
fc3b525
UPSTREAM: <carry>: [Default Catalog Tests] - Change logic to get ocp …
camilamacedo86 Oct 13, 2025
a851ab5
UPSTREAM: <carry>: Update OCP catalogs to v4.21
tmshort Oct 13, 2025
37b3649
UPSTREAM: <carry>: support singleown cases in disconnected
kuiwang02 Oct 16, 2025
37b9086
UPSTREAM: <carry>: fix cases 81696 and 74618 for product code changes
kuiwang02 Oct 17, 2025
feb96b9
UPSTREAM: <carry>: Define Default timeouts and apply their usage accr…
camilamacedo86 Oct 22, 2025
e86dbb5
UPSTREAM: <carry>: Update to new feature-gate options in helm
tmshort Oct 22, 2025
5a79602
UPSTREAM: <carry>: Fix flake for single/own ns tests by ensuring uniq…
camilamacedo86 Oct 22, 2025
f8f45f1
UPSTREAM: <carry>: [OTE]: Enhance single/own ns based on review comme…
camilamacedo86 Oct 24, 2025
d9c32fd
UPSTREAM: <carry>: Update OwnSingle template to use spec.config.inlin…
kuiwang02 Nov 3, 2025
db0aab7
UPSTREAM: <carry>: [OTE]: Add webhook cleanup validation on extension…
camilamacedo86 Nov 4, 2025
fb06f6d
UPSTREAM: <carry>: Add [OTP] to migrated cases
kuiwang02 Nov 7, 2025
609d044
UPSTREAM: <carry>: [OTE]: Upgrade dependencies and fix Kubernetes rep…
camilamacedo86 Nov 5, 2025
14e3686
UPSTREAM: <drop>: go mod vendor
camilamacedo86 Nov 11, 2025
2380a2a
UPSTREAM: <drop>: remove upstream GitHub configuration
camilamacedo86 Nov 11, 2025
c49a30e
UPSTREAM: <drop>: configure the commit-checker
camilamacedo86 Nov 11, 2025
66c876e
UPSTREAM: <carry>: Fix Makefile - Test
camilamacedo86 Nov 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ OPERATOR_SDK := $(GOBIN)/operator-sdk-v1.41.1
$(OPERATOR_SDK): $(BINGO_DIR)/operator-sdk.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/operator-sdk-v1.41.1"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=operator-sdk.mod -o=$(GOBIN)/operator-sdk-v1.41.1 "github.com/operator-framework/operator-sdk/cmd/operator-sdk"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -tags=containers_image_openpgp -ldflags=-X=github.com/operator-framework/operator-sdk/internal/version.Version=v1.41.1 -mod=mod -modfile=operator-sdk.mod -o=$(GOBIN)/operator-sdk-v1.41.1 "github.com/operator-framework/operator-sdk/cmd/operator-sdk"

OPM := $(GOBIN)/opm-v1.60.0
$(OPM): $(BINGO_DIR)/opm.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/opm-v1.60.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=opm.mod -o=$(GOBIN)/opm-v1.60.0 "github.com/operator-framework/operator-registry/cmd/opm"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -tags=containers_image_openpgp -mod=mod -modfile=opm.mod -o=$(GOBIN)/opm-v1.60.0 "github.com/operator-framework/operator-registry/cmd/opm"

SETUP_ENVTEST := $(GOBIN)/setup-envtest-v0.0.0-20250620151452-b9a9ca01fd37
$(SETUP_ENVTEST): $(BINGO_DIR)/setup-envtest.mod
Expand Down
6 changes: 4 additions & 2 deletions .bingo/operator-sdk.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.23.4
go 1.24.3

toolchain go1.24.6

replace github.com/containerd/containerd => github.com/containerd/containerd v1.4.11

replace github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d

replace github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 v1.10.0

require github.com/operator-framework/operator-sdk v1.39.1 // cmd/operator-sdk -ldflags=-X=github.com/operator-framework/operator-sdk/internal/version.Version=v1.34.1
require github.com/operator-framework/operator-sdk v1.41.1 // cmd/operator-sdk -tags=containers_image_openpgp -ldflags=-X=github.com/operator-framework/operator-sdk/internal/version.Version=v1.41.1
1,931 changes: 1,911 additions & 20 deletions .bingo/operator-sdk.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions .bingo/opm.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.23.0
go 1.24.4

toolchain go1.23.4
toolchain go1.24.6

replace github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d

require github.com/operator-framework/operator-registry v1.51.0 // cmd/opm
require github.com/operator-framework/operator-registry v1.60.0 // cmd/opm -tags=containers_image_openpgp
1,258 changes: 1,256 additions & 2 deletions .bingo/opm.sum

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions .bingo/setup-envtest.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.24.0

toolchain go1.24.3
go 1.24.6

require sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250620151452-b9a9ca01fd37
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ site

# Temporary files and directories
/test/regression/convert/testdata/tmp/*

# Test profiling artifacts
test-profiles/
30 changes: 26 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ CATALOGS_MANIFEST := $(MANIFEST_HOME)/default-catalogs.yaml

.PHONY: help
help: #HELP Display essential help.
@awk 'BEGIN {FS = ":[^#]*#HELP"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\n"} /^[a-zA-Z_0-9-]+:.*#HELP / { printf " \033[36m%-21s\033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST)
@awk 'BEGIN {FS = ":[^#]*#HELP"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\n"} /^[a-zA-Z_0-9\/%-]+:.*#HELP / { printf " \033[36m%-21s\033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST)

.PHONY: help-extended
help-extended: #HELP Display extended help.
@awk 'BEGIN {FS = ":.*#(EX)?HELP"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*#(EX)?HELP / { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^#SECTION / { printf "\n\033[1m%s\033[0m\n", substr($$0, 10) } ' $(MAKEFILE_LIST)
@awk 'BEGIN {FS = ":.*#(EX)?HELP"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9\/%-]+:.*#(EX)?HELP / { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^#SECTION / { printf "\n\033[1m%s\033[0m\n", substr($$0, 10) } ' $(MAKEFILE_LIST)

#SECTION Development

Expand Down Expand Up @@ -174,7 +174,7 @@ manifests: update-crds $(MANIFESTS) $(HELM) #EXHELP Generate OLMv1 manifests

.PHONY: generate
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@find api cmd hack internal -name "zz_generated.deepcopy.go" -delete # Need to delete the files for them to be generated properly
@find api cmd hack internal -name "zz_generated.deepcopy.go" -not -path "*/vendor/*" -delete # Need to delete the files for them to be generated properly
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) object:headerFile="hack/boilerplate.go.txt" paths="./..."

.PHONY: verify
Expand Down Expand Up @@ -284,13 +284,14 @@ test-experimental-e2e: KIND_CLUSTER_NAME := operator-controller-e2e
test-experimental-e2e: GO_BUILD_EXTRA_FLAGS := -cover
test-experimental-e2e: COVERAGE_NAME := experimental-e2e
test-experimental-e2e: export MANIFEST := $(EXPERIMENTAL_RELEASE_MANIFEST)
test-experimental-e2e: PROMETHEUS_VALUES := helm/prom_experimental.yaml
test-experimental-e2e: run-internal image-registry prometheus e2e e2e-coverage kind-clean #HELP Run experimental e2e test suite on local kind cluster

.PHONY: prometheus
prometheus: PROMETHEUS_NAMESPACE := olmv1-system
prometheus: PROMETHEUS_VERSION := v0.83.0
prometheus: $(KUSTOMIZE) #EXHELP Deploy Prometheus into specified namespace
./hack/test/install-prometheus.sh $(PROMETHEUS_NAMESPACE) $(PROMETHEUS_VERSION) $(VERSION)
./hack/test/install-prometheus.sh $(PROMETHEUS_NAMESPACE) $(PROMETHEUS_VERSION) $(VERSION) $(PROMETHEUS_VALUES)

.PHONY: test-extension-developer-e2e
test-extension-developer-e2e: SOURCE_MANIFEST := $(STANDARD_E2E_MANIFEST)
Expand Down Expand Up @@ -337,6 +338,27 @@ test-upgrade-experimental-e2e: $(TEST_UPGRADE_E2E_TASKS) #HELP Run upgrade e2e t
e2e-coverage:
COVERAGE_NAME=$(COVERAGE_NAME) ./hack/test/e2e-coverage.sh

TEST_PROFILE_BIN := bin/test-profile
.PHONY: build-test-profiler
build-test-profiler: #EXHELP Build the test profiling tool
cd hack/tools/test-profiling && go build -o ../../../$(TEST_PROFILE_BIN) ./cmd/test-profile

.PHONY: test-test-profiler
test-test-profiler: #EXHELP Run unit tests for the test profiling tool
cd hack/tools/test-profiling && go test -v ./...

.PHONY: start-profiling
start-profiling: build-test-profiler #EXHELP Start profiling in background with auto-generated name (timestamp). Use start-profiling/<name> for custom name.
$(TEST_PROFILE_BIN) start

.PHONY: start-profiling/%
start-profiling/%: build-test-profiler #EXHELP Start profiling in background with specified name. Usage: make start-profiling/<name>
$(TEST_PROFILE_BIN) start $*

.PHONY: stop-profiling
stop-profiling: build-test-profiler #EXHELP Stop profiling and generate analysis report
$(TEST_PROFILE_BIN) stop

#SECTION KIND Cluster Operations

.PHONY: kind-load
Expand Down
2 changes: 1 addition & 1 deletion commitchecker.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
expectedMergeBase: 9937ae2dbc57444ae5bd6bdbff4304e0638fe01f
expectedMergeBase: b634dacafcb2a0e3b28885f8fa38c8274ef0525e
upstreamBranch: main
upstreamOrg: operator-framework
upstreamRepo: operator-controller
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/Masterminds/semver/v3 v3.4.0
github.com/blang/semver/v4 v4.0.0
github.com/cert-manager/cert-manager v1.18.2
github.com/containerd/containerd v1.7.28
github.com/containerd/containerd v1.7.29
github.com/fsnotify/fsnotify v1.9.0
github.com/go-logr/logr v1.4.3
github.com/golang-jwt/jwt/v5 v5.3.0
Expand All @@ -29,7 +29,7 @@ require (
go.podman.io/image/v5 v5.38.0
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b
golang.org/x/mod v0.29.0
golang.org/x/sync v0.17.0
golang.org/x/sync v0.18.0
golang.org/x/tools v0.38.0
helm.sh/helm/v3 v3.19.0
k8s.io/api v0.34.1
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/containerd/cgroups/v3 v3.0.5 h1:44na7Ud+VwyE7LIoJ8JTNQOa549a8543BmzaJHo6Bzo=
github.com/containerd/cgroups/v3 v3.0.5/go.mod h1:SA5DLYnXO8pTGYiAHXz94qvLQTKfVM5GEVisn4jpins=
github.com/containerd/containerd v1.7.28 h1:Nsgm1AtcmEh4AHAJ4gGlNSaKgXiNccU270Dnf81FQ3c=
github.com/containerd/containerd v1.7.28/go.mod h1:azUkWcOvHrWvaiUjSQH0fjzuHIwSPg1WL5PshGP4Szs=
github.com/containerd/containerd v1.7.29 h1:90fWABQsaN9mJhGkoVnuzEY+o1XDPbg9BTC9QTAHnuE=
github.com/containerd/containerd v1.7.29/go.mod h1:azUkWcOvHrWvaiUjSQH0fjzuHIwSPg1WL5PshGP4Szs=
github.com/containerd/containerd/api v1.9.0 h1:HZ/licowTRazus+wt9fM6r/9BQO7S0vD5lMcWspGIg0=
github.com/containerd/containerd/api v1.9.0/go.mod h1:GhghKFmTR3hNtyznBoQ0EMWr9ju5AqHjcZPsSpTKutI=
github.com/containerd/continuity v0.4.5 h1:ZRoN1sXq9u7V6QoHMcVWGhOwDFqZ4B9i5H6un1Wh0x4=
Expand Down Expand Up @@ -628,8 +628,8 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
12 changes: 9 additions & 3 deletions hack/test/install-prometheus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ set -euo pipefail

help="install-prometheus.sh is used to set up prometheus monitoring for e2e testing.
Usage:
install-prometheus.sh [PROMETHEUS_NAMESPACE] [PROMETHEUS_VERSION] [GIT_VERSION]
install-prometheus.sh [PROMETHEUS_NAMESPACE] [PROMETHEUS_VERSION] [GIT_VERSION] [PROMETHEUS_VALUES]
"

if [[ "$#" -ne 3 ]]; then
if [[ "$#" -lt 3 || "$#" -gt 4 ]]; then
echo "Illegal number of arguments passed"
echo "${help}"
exit 1
Expand All @@ -18,6 +18,12 @@ fi
PROMETHEUS_NAMESPACE="$1"
PROMETHEUS_VERSION="$2"
GIT_VERSION="$3"
PROMETHEUS_VALUES="${4:-}"

if [ -n "${PROMETHEUS_VALUES}" ]; then
echo "Adding ${PROMETHEUS_VALUES} to templating"
PROMETHEUS_VALUES="--values ${PROMETHEUS_VALUES}"
fi

TMPDIR="$(mktemp -d)"
trap 'echo "Cleaning up $TMPDIR"; rm -rf "$TMPDIR"' EXIT
Expand All @@ -36,7 +42,7 @@ echo "Waiting for Prometheus Operator pod to become ready..."
kubectl wait --for=condition=Ready pod -n "$PROMETHEUS_NAMESPACE" -l app.kubernetes.io/name=prometheus-operator

echo "Applying prometheus Helm chart..."
${HELM} template prometheus helm/prometheus | sed "s/cert-git-version/cert-${VERSION}/g" | kubectl apply -f -
${HELM} template prometheus helm/prometheus ${PROMETHEUS_VALUES} | sed "s/cert-git-version/cert-${VERSION}/g" | kubectl apply -f -

echo "Waiting for metrics scraper to become ready..."
kubectl wait --for=create pods -n "$PROMETHEUS_NAMESPACE" prometheus-prometheus-0 --timeout=60s
Expand Down
86 changes: 86 additions & 0 deletions hack/tools/test-profiling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Test Profiling Tools

Collect and analyze heap/CPU profiles during operator-controller tests.

## Quick Start

```bash
# Start profiling
make start-profiling/baseline

# Run tests
make test-e2e

# Stop and analyze
make stop-profiling

# View report
cat test-profiles/baseline/analysis.md

# Compare runs
./bin/test-profile compare baseline optimized
cat test-profiles/comparisons/baseline-vs-optimized.md
```

## Commands

```bash
# Build
make build-test-profiler

# Run test with profiling
./bin/test-profile run <name> [test-target]

# Start/stop daemon
./bin/test-profile start [name] # Daemonizes automatically
./bin/test-profile stop

# Analyze/compare
./bin/test-profile analyze <name>
./bin/test-profile compare <baseline> <optimized>
./bin/test-profile collect # Single snapshot
```

## Configuration

```bash
# Define components to profile (optional - defaults to operator-controller and catalogd)
# Format: "name:namespace:deployment:port;name2:namespace2:deployment2:port2"
export TEST_PROFILE_COMPONENTS="operator-controller:olmv1-system:operator-controller-controller-manager:6060;catalogd:olmv1-system:catalogd-controller-manager:6060"

# Profile custom applications
export TEST_PROFILE_COMPONENTS="my-app:my-ns:my-deployment:8080;api-server:api-ns:api-deployment:9090"

# Other settings
export TEST_PROFILE_INTERVAL=10 # seconds between collections
export TEST_PROFILE_CPU_DURATION=10 # CPU profiling duration in seconds
export TEST_PROFILE_MODE=both # both|heap|cpu
export TEST_PROFILE_DIR=./test-profiles # output directory
export TEST_PROFILE_TEST_TARGET=test-e2e # make target to run
```

**Component Configuration:**
- Each component needs a `/debug/pprof` endpoint (standard Go pprof)
- Local ports are automatically assigned to avoid conflicts
- Default: operator-controller and catalogd in olmv1-system namespace

## Output

```
test-profiles/
├── <name>/
│ ├── operator-controller/{heap,cpu}*.pprof
│ ├── catalogd/{heap,cpu}*.pprof
│ ├── profiler.log
│ └── analysis.md
└── comparisons/<name>-vs-<name>.md
```

## Interactive Analysis

```bash
cd test-profiles/<name>/operator-controller
go tool pprof -top heap23.pprof
go tool pprof -base=heap0.pprof -top heap23.pprof
go tool pprof -text heap23.pprof | grep -i openapi
```
40 changes: 40 additions & 0 deletions hack/tools/test-profiling/cmd/test-profile/analyze.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package main

import (
"fmt"

"github.com/operator-framework/operator-controller/hack/tools/test-profiling/pkg/analyzer"
"github.com/operator-framework/operator-controller/hack/tools/test-profiling/pkg/config"
"github.com/spf13/cobra"
)

var analyzeCmd = &cobra.Command{
Use: "analyze <name>",
Short: "Analyze collected profiles",
Long: `Generate an analysis report from previously collected profiles.

The report includes:
- Memory growth analysis
- Top memory allocators
- CPU profiling results
- OpenAPI and JSON deserialization analysis

Example:
test-profile analyze baseline`,
Args: cobra.ExactArgs(1),
RunE: runAnalyze,
}

func runAnalyze(cmd *cobra.Command, args []string) error {
cfg := config.DefaultConfig()
cfg.Name = args[0]

if err := cfg.Validate(); err != nil {
return err
}

fmt.Printf("📊 Analyzing profiles in: %s\n", cfg.ProfileDir())

a := analyzer.NewAnalyzer(cfg)
return a.Analyze()
}
36 changes: 36 additions & 0 deletions hack/tools/test-profiling/cmd/test-profile/collect.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package main

import (
"context"
"time"

"github.com/operator-framework/operator-controller/hack/tools/test-profiling/pkg/collector"
"github.com/operator-framework/operator-controller/hack/tools/test-profiling/pkg/config"
"github.com/spf13/cobra"
)

var collectCmd = &cobra.Command{
Use: "collect",
Short: "Collect a single profile snapshot",
Long: `Collect a single snapshot of heap and CPU profiles from all components.

This is useful for quick spot checks without running the full daemon.

Example:
test-profile collect`,
RunE: runCollect,
}

func runCollect(cmd *cobra.Command, args []string) error {
cfg := config.DefaultConfig()
cfg.Name = time.Now().Format("snapshot-20060102-150405")

if err := cfg.Validate(); err != nil {
return err
}

ctx := context.Background()

c := collector.NewCollector(cfg)
return c.CollectOnce(ctx)
}
Loading