From 409daa7aa5f79ac52815aa453f23d3d7bf7027ff Mon Sep 17 00:00:00 2001 From: Zaid Albirawi Date: Mon, 18 Nov 2024 16:52:37 -0500 Subject: [PATCH 1/7] Update full_performance_test.yml --- .github/workflows/full_performance_test.yml | 44 ++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/full_performance_test.yml b/.github/workflows/full_performance_test.yml index 958dee5..bff49db 100644 --- a/.github/workflows/full_performance_test.yml +++ b/.github/workflows/full_performance_test.yml @@ -36,6 +36,10 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + - name: Install wget + if: ${{ inputs.tyk_profiler_enabled == true }} + run: sudo apt-get update && sudo apt-get install -y wget + - name: Configure AKS credentials if: ${{ inputs.cloud == 'Azure' }} uses: azure/login@v2 @@ -142,36 +146,14 @@ jobs: run: | cd deployments terraform init - - if [[ "${{ inputs.tyk_profiler_enabled }}" == "true" ]]; then - service_type="LoadBalancer" - else - service_type="ClusterIP" - fi - terraform apply \ --var="kubernetes_config_context=performance-testing" \ --var="tyk_version=${{ inputs.tyk_version }}" \ --var="tyk_license=${{ secrets.DASH_LICENSE }}" \ --var="tyk_profiler_enabled=${{ inputs.tyk_profiler_enabled }}" \ - --var="tyk_service_type=$service_type" \ - --var="grafana_service_type=$service_type" \ --auto-approve sleep 300 - - name: Access to Tyk Gateway Profiler and Grafana Dashboard - if: ${{ inputs.tyk_profiler_enabled == true }} - run: | - echo "###################################################################" - echo "# Grafana Login" - echo "# http://$(kubectl get svc -n dependencies grafana -ojsonpath='{.status.loadBalancer.ingress[0].ip}')" - echo "# Username: admin" - echo "# Password: topsecretpassword" - echo "#" - echo "# Tyk Gateway" - echo "# http://$(kubectl get svc -n tyk gateway-svc-tyk-tyk-gateway -ojsonpath='{.status.loadBalancer.ingress[0].ip}')":8080/debug/pprof/ - echo "###################################################################" - - name: Run Tests run: | cd tests @@ -184,6 +166,24 @@ jobs: run: | kubectl logs -n dependencies $(kubectl get pods -n dependencies --selector=app=snapshot-job -o jsonpath='{.items[-1].metadata.name}') --tail=1 + - name: Download Profiles + if: ${{ inputs.tyk_profiler_enabled == true }} + run: | + kubectl port-forward svc/gateway-svc-tyk-tyk-gateway -n tyk 8080 + + wget "http://localhost:8080/debug/pprof/heap?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-heap.txt + wget "http://localhost:8080/debug/pprof/allocs?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-allocs.txt + wget "http://localhost:8080/debug/pprof/goroutine?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-goroutine.txt + + - name: Upload Profiles + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.tyk_version }}-profiles + path: | + ${{ inputs.tyk_version }}-heap.txt + ${{ inputs.tyk_version }}-allocs.txt + ${{ inputs.tyk_version }}-goroutine.txt + - name: Destroy Tests run: | cd tests From f56b2db7c48cc9d738ffcac0c46a17d8e988c46b Mon Sep 17 00:00:00 2001 From: Zaid Albirawi Date: Mon, 18 Nov 2024 16:53:42 -0500 Subject: [PATCH 2/7] Update .github/workflows/full_performance_test.yml --- .github/workflows/full_performance_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/full_performance_test.yml b/.github/workflows/full_performance_test.yml index bff49db..2f9bd41 100644 --- a/.github/workflows/full_performance_test.yml +++ b/.github/workflows/full_performance_test.yml @@ -176,6 +176,7 @@ jobs: wget "http://localhost:8080/debug/pprof/goroutine?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-goroutine.txt - name: Upload Profiles + if: ${{ inputs.tyk_profiler_enabled == true }} uses: actions/upload-artifact@v3 with: name: ${{ inputs.tyk_version }}-profiles From 260df491c240b33574f98bc46fb829c4586e49e7 Mon Sep 17 00:00:00 2001 From: Zaid Albirawi Date: Mon, 18 Nov 2024 17:43:49 -0500 Subject: [PATCH 3/7] Update full_performance_test.yml --- .github/workflows/full_performance_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/full_performance_test.yml b/.github/workflows/full_performance_test.yml index 2f9bd41..d91aaa1 100644 --- a/.github/workflows/full_performance_test.yml +++ b/.github/workflows/full_performance_test.yml @@ -169,7 +169,7 @@ jobs: - name: Download Profiles if: ${{ inputs.tyk_profiler_enabled == true }} run: | - kubectl port-forward svc/gateway-svc-tyk-tyk-gateway -n tyk 8080 + kubectl port-forward svc/gateway-svc-tyk-tyk-gateway -n tyk 8080 & wget "http://localhost:8080/debug/pprof/heap?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-heap.txt wget "http://localhost:8080/debug/pprof/allocs?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-allocs.txt From 3bd1f7e2caec78804af19c55001fd815376626ec Mon Sep 17 00:00:00 2001 From: Zaid Albirawi Date: Mon, 18 Nov 2024 18:22:02 -0500 Subject: [PATCH 4/7] Update full_performance_test.yml --- .github/workflows/full_performance_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/full_performance_test.yml b/.github/workflows/full_performance_test.yml index d91aaa1..e6a4326 100644 --- a/.github/workflows/full_performance_test.yml +++ b/.github/workflows/full_performance_test.yml @@ -170,7 +170,7 @@ jobs: if: ${{ inputs.tyk_profiler_enabled == true }} run: | kubectl port-forward svc/gateway-svc-tyk-tyk-gateway -n tyk 8080 & - + sleep 10 wget "http://localhost:8080/debug/pprof/heap?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-heap.txt wget "http://localhost:8080/debug/pprof/allocs?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-allocs.txt wget "http://localhost:8080/debug/pprof/goroutine?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-goroutine.txt From 7ba99972fda9575f099a880f4ac84dabfde38d7b Mon Sep 17 00:00:00 2001 From: Zaid Albirawi Date: Mon, 18 Nov 2024 18:35:58 -0500 Subject: [PATCH 5/7] Update full_performance_test.yml --- .github/workflows/full_performance_test.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/full_performance_test.yml b/.github/workflows/full_performance_test.yml index e6a4326..557d870 100644 --- a/.github/workflows/full_performance_test.yml +++ b/.github/workflows/full_performance_test.yml @@ -170,7 +170,8 @@ jobs: if: ${{ inputs.tyk_profiler_enabled == true }} run: | kubectl port-forward svc/gateway-svc-tyk-tyk-gateway -n tyk 8080 & - sleep 10 + sleep 5 + wget "http://localhost:8080/debug/pprof/heap?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-heap.txt wget "http://localhost:8080/debug/pprof/allocs?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-allocs.txt wget "http://localhost:8080/debug/pprof/goroutine?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-goroutine.txt @@ -180,10 +181,8 @@ jobs: uses: actions/upload-artifact@v3 with: name: ${{ inputs.tyk_version }}-profiles - path: | - ${{ inputs.tyk_version }}-heap.txt - ${{ inputs.tyk_version }}-allocs.txt - ${{ inputs.tyk_version }}-goroutine.txt + path: ./profiles + if-no-files-found: error - name: Destroy Tests run: | From 4110207e25a44757ba19d9156dc7265bdf5051fe Mon Sep 17 00:00:00 2001 From: Zaid Albirawi Date: Mon, 18 Nov 2024 19:04:07 -0500 Subject: [PATCH 6/7] Update full_performance_test.yml --- .github/workflows/full_performance_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/full_performance_test.yml b/.github/workflows/full_performance_test.yml index 557d870..2de6eb9 100644 --- a/.github/workflows/full_performance_test.yml +++ b/.github/workflows/full_performance_test.yml @@ -172,9 +172,9 @@ jobs: kubectl port-forward svc/gateway-svc-tyk-tyk-gateway -n tyk 8080 & sleep 5 - wget "http://localhost:8080/debug/pprof/heap?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-heap.txt - wget "http://localhost:8080/debug/pprof/allocs?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-allocs.txt - wget "http://localhost:8080/debug/pprof/goroutine?debug=1" --directory-prefix=./profiles/${{ inputs.tyk_version }}-goroutine.txt + wget "http://localhost:8080/debug/pprof/heap?debug=1" -O ./profiles/${{ inputs.tyk_version }}-heap.txt + wget "http://localhost:8080/debug/pprof/allocs?debug=1" -O ./profiles/${{ inputs.tyk_version }}-allocs.txt + wget "http://localhost:8080/debug/pprof/goroutine?debug=1" -O ./profiles/${{ inputs.tyk_version }}-goroutine.txt - name: Upload Profiles if: ${{ inputs.tyk_profiler_enabled == true }} From 3a8d7193598c000adcf8f98ded52b67b3552c788 Mon Sep 17 00:00:00 2001 From: Zaid Albirawi Date: Mon, 18 Nov 2024 19:13:33 -0500 Subject: [PATCH 7/7] Update full_performance_test.yml --- .github/workflows/full_performance_test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/full_performance_test.yml b/.github/workflows/full_performance_test.yml index 2de6eb9..d109acd 100644 --- a/.github/workflows/full_performance_test.yml +++ b/.github/workflows/full_performance_test.yml @@ -171,7 +171,8 @@ jobs: run: | kubectl port-forward svc/gateway-svc-tyk-tyk-gateway -n tyk 8080 & sleep 5 - + + mkdir profiles wget "http://localhost:8080/debug/pprof/heap?debug=1" -O ./profiles/${{ inputs.tyk_version }}-heap.txt wget "http://localhost:8080/debug/pprof/allocs?debug=1" -O ./profiles/${{ inputs.tyk_version }}-allocs.txt wget "http://localhost:8080/debug/pprof/goroutine?debug=1" -O ./profiles/${{ inputs.tyk_version }}-goroutine.txt