From acad030e24468c86da44ad3509c19a9b01393519 Mon Sep 17 00:00:00 2001 From: Kamesh Akella Date: Fri, 9 Aug 2024 12:16:46 -0400 Subject: [PATCH] update ispn Signed-off-by: Kamesh Akella --- .../prometheus-metrics-calc/action.yml | 30 +++++++++++---- .github/workflows/rosa-scaling-benchmark.yml | 38 ++++++++++++++++++- 2 files changed, 59 insertions(+), 9 deletions(-) diff --git a/.github/actions/prometheus-metrics-calc/action.yml b/.github/actions/prometheus-metrics-calc/action.yml index c227b2005..3da52359d 100644 --- a/.github/actions/prometheus-metrics-calc/action.yml +++ b/.github/actions/prometheus-metrics-calc/action.yml @@ -74,11 +74,17 @@ runs: run: | readarray -t lines < ${{ inputs.input }} num1=${lines[0]} - num2=${lines[1]} + num2=${lines[2]} + num3=${lines[1]} + num4=${lines[3]} #calculating the difference of cumulative metric (changed during the benchmark execution) - difference=$(awk "BEGIN {print ($num2-$num1); exit}") + difference_cluster_1=$(awk "BEGIN {print ($num2 - $num1); exit}") + difference_cluster_2=$(awk "BEGIN {print ($num4 - $num3); exit}") + + # averaging the differences between the two clusters + average_difference=$(awk "BEGIN {print ($difference_cluster_1 + $difference_cluster_2) / 2; exit}") #calculating the average metric per pod - metric_per_pod=$(awk "BEGIN {print $difference/$POD_NUM; exit}") + metric_per_pod=$(awk "BEGIN {print $average_difference/$POD_NUM; exit}") #Calculating the final number, i.e. based on current environment setup how many of specified criteria (e.g. user active session, etc) #can be handled with 500Mb per pod based on the number calculated above. The result is number rounded down. result=$(awk "BEGIN {print int($CRITERIA_VALUE*500/$metric_per_pod); exit}") @@ -107,15 +113,25 @@ runs: #Reading ispn metrics file with xsite reqs data readarray -t lines < "${{ inputs.ispnCacheName}}_ispn_metrics_file_count" num1=${lines[0]} - num2=${lines[1]} + num2=${lines[2]} + num3=${lines[1]} + num4=${lines[3]} #calculating the number of xsite requests during the test execution - xsite_reqs=$(awk "BEGIN {print ($num2-$num1); exit}") + xsite_reqs_1=$(awk "BEGIN {print ($num2 - $num1); exit}") + xsite_reqs_2=$(awk "BEGIN {print ($num4 - $num3); exit}") + + xsite_reqs=$(awk "BEGIN {print ($xsite_reqs_1 + $xsite_reqs_2) / 2; exit}") #Reading ispn metrics file with xsite reqs totad duration readarray -t lines1 < "${{ inputs.ispnCacheName}}_ispn_metrics_file_sum" num1=${lines1[0]} - num2=${lines1[1]} + num2=${lines1[2]} + num3=${lines1[1]} + num4=${lines1[3]} #calculating the number of xsite requests during the test execution - xsite_reqs_total_duration=$(awk "BEGIN {print ($num2-$num1); exit}") + xsite_reqs_total_duration_1=$(awk "BEGIN {print ($num2 - $num1); exit}") + xsite_reqs_total_duration_2=$(awk "BEGIN {print ($num4 - $num3); exit}") + + xsite_reqs_total_duration=$(awk "BEGIN {print ($xsite_reqs_total_duration_1 + $xsite_reqs_total_duration_2) / 2; exit}") #calculating the average duration per request in ms if [[ $xsite_reqs -gt 0 ]]; then averageXsiteReplicationTimePerReq=$(awk "BEGIN {print int($xsite_reqs_total_duration*1000/$xsite_reqs); exit}") diff --git a/.github/workflows/rosa-scaling-benchmark.yml b/.github/workflows/rosa-scaling-benchmark.yml index 33c1eb43e..27dbae5b2 100644 --- a/.github/workflows/rosa-scaling-benchmark.yml +++ b/.github/workflows/rosa-scaling-benchmark.yml @@ -187,7 +187,19 @@ jobs: with: createReportFile: true - - name: Run Memory Usage Total Query Before Benchmark + - name: Run Memory Usage Total Query Before Benchmark on Cluster 1 + uses: ./.github/actions/prometheus-run-queries + with: + project: ${{ env.PROJECT }} + runMemoryUsageTotal: true + output: memory_create_sessions + + - name: Login to OpenShift cluster 2 + uses: ./.github/actions/oc-keycloak-login + with: + clusterName: ${{ inputs.clusterPrefix }}-b + + - name: Run Memory Usage Total Query Before Benchmark on Cluster 2 uses: ./.github/actions/prometheus-run-queries with: project: ${{ env.PROJECT }} @@ -211,7 +223,24 @@ jobs: continue-on-error: true working-directory: ansible - - name: Run Memory Usage Total Query After Benchmark + - name: Login to OpenShift cluster 1 + uses: ./.github/actions/oc-keycloak-login + with: + clusterName: ${{ inputs.clusterPrefix }}-a + + - name: Run Memory Usage Total Query After Benchmark on Cluster 1 + uses: ./.github/actions/prometheus-run-queries + with: + project: ${{ env.PROJECT }} + runMemoryUsageTotal: true + output: memory_create_sessions + + - name: Login to OpenShift cluster 2 + uses: ./.github/actions/oc-keycloak-login + with: + clusterName: ${{ inputs.clusterPrefix }}-b + + - name: Run Memory Usage Total Query After Benchmark on Cluster 2 uses: ./.github/actions/prometheus-run-queries with: project: ${{ env.PROJECT }} @@ -235,6 +264,11 @@ jobs: isvCPU: false isMemory: true + - name: Login to OpenShift cluster 1 + uses: ./.github/actions/oc-keycloak-login + with: + clusterName: ${{ inputs.clusterPrefix }}-a + - name: Run CPU sec Util Query Before Benchmark on Cluster 1 uses: ./.github/actions/prometheus-run-queries with: