@@ -47,7 +47,6 @@ PROJECT_FILE = main.go
4747COLLECTOR_PATH ?= /etc/nginx-agent/opentelemetry-collector-agent.yaml
4848MANIFEST_DIR ?= /var/lib/nginx-agent
4949DIRS = $(BUILD_DIR ) $(TEST_BUILD_DIR ) $(BUILD_DIR ) /$(DOCS_DIR ) $(BUILD_DIR ) /$(DOCS_DIR ) /$(PROTO_DIR )
50- TIME_NOW := $(shell date +% s)
5150$(shell mkdir -p $(DIRS))
5251
5352VERSION ?= $(shell git describe --match "v[0-9]* " --abbrev=0 --tags)
@@ -294,9 +293,9 @@ generate-pgo-profile: build-mock-management-plane-grpc ## Generate PGO profile
294293# run under sudo locally
295294load-test-image : # # Build performance load testing image
296295 @echo " 🚚 Building load test image"
296+ # add --no-cache to the command below to avoid using cache
297297 $(CONTAINER_BUILDENV) $(CONTAINER_CLITOOL) build \
298298 -t $(IMAGE_TAG)_load_test:1.0.0 . \
299- --no-cache \
300299 -f ./test/docker/load/Dockerfile \
301300 --secret id=nginx-crt,src=$(CERTS_DIR)/nginx-repo.crt \
302301 --secret id=nginx-key,src=$(CERTS_DIR)/nginx-repo.key \
@@ -316,30 +315,17 @@ run-load-test-image: ## Run performance load testing image
316315# Copy the files generated by the load tests
317316 @$(CONTAINER_CLITOOL) cp \
318317 agent-load-test:/agent/performance/load \
319- $(TEST_BUILD_DIR)/load
318+ $(TEST_BUILD_DIR)
320319 @echo "Results saved to $(TEST_BUILD_DIR)/load"
321320 @find $(TEST_BUILD_DIR)/load -type f -exec ls -lh {} \;
322321
323- # Copy the benchmark json to the $(TEST_BUILD_DIR)/load directory for easier access
324- @$(CONTAINER_CLITOOL) cp \
325- agent-load-test:/agent/test/load \
326- $(TEST_BUILD_DIR)/load
327- @echo "Benchmark results saved to $(TEST_BUILD_DIR)/load/benchmarks.json"
328-
329- # Copy the results to the $(TEST_BUILD_DIR)/load directory for easier access
330- @$(CONTAINER_CLITOOL) cp \
331- agent-load-test:/agent/test/load/results \
332- $(TEST_BUILD_DIR)/load/
333- @echo "Benchmark results saved to $(TEST_BUILD_DIR)/load/results"
334-
335322# Stop and remove the container
336323 @$(CONTAINER_CLITOOL) stop agent-load-test && $(CONTAINER_CLITOOL) rm -f agent-load-test
337324
338325run-load-test-with-cpu-profiling : # # Run performance load testing with cpu profiling
339326 @echo " 🚚 Running load tests with cpu profiling"
340- @mkdir -p $(TEST_BUILD_DIR )
327+ @mkdir -p $(TEST_BUILD_DIR ) /load-cpu-profiling
341328 @$(CONTAINER_CLITOOL ) rm -f agent-load-test-with-cpu-profiling || true
342- @echo " Current epoch time is $( TIME_NOW) "
343329
344330# Run the load test container
345331 @$(CONTAINER_BUILDENV) $(CONTAINER_CLITOOL) run \
@@ -348,23 +334,11 @@ run-load-test-with-cpu-profiling: ## Run performance load testing with cpu profi
348334 $(IMAGE_TAG)_load_test:1.0.0
349335
350336# Copy the files generated by the load tests
351- DIR=profiles/$(TIME_NOW)
352337 @$(CONTAINER_CLITOOL) cp \
353338 agent-load-test-with-cpu-profiling:/agent/performance/load \
354- $(DIR)
355- @echo "Benchmarks and profile saved to $(DIR) directory"
356-
357- # Copy the benchmark results to the root of build directory for easier access
358- @$(CONTAINER_CLITOOL) cp \
359- agent-load-test-with-cpu-profiling:/agent/test/load/benchmarks.json \
360- $(TEST_BUILD_DIR)/load/benchmarks.json
361- @echo "Benchmark results saved to $(TEST_BUILD_DIR)/load/benchmarks.json"
362-
363- # Copy the results to the $(TEST_BUILD_DIR)/load directory for easier access
364- @$(CONTAINER_CLITOOL) cp \
365- agent-load-test:/agent/test/load/results \
366- $(TEST_BUILD_DIR)/load
367- @echo "Benchmark results saved to $(TEST_BUILD_DIR)/load/results"
339+ $(TEST_BUILD_DIR)/load-cpu-profiling
340+ @echo "Results saved to $(TEST_BUILD_DIR)/load-cpu-profiling"
368341
369342# Stop and remove the container
370- @$(CONTAINER_CLITOOL) stop agent-load-test-with-cpu-profiling && $(CONTAINER_CLITOOL) rm -f agent-load-test-with-cpu-profiling
343+ @$(CONTAINER_CLITOOL) stop agent-load-test-with-cpu-profiling && \
344+ $(CONTAINER_CLITOOL) rm -f agent-load-test-with-cpu-profiling
0 commit comments