From 19b6d65e5d59abd6c952fd9992e85968c4d4af36 Mon Sep 17 00:00:00 2001 From: Peter Lee Date: Wed, 17 Jul 2024 17:02:49 -0700 Subject: [PATCH] update pushgateway domain --- .github/actions/performance-tests/art.yaml | 14 ++--- .../ci-nightly-performance-testing.yaml | 52 +++++-------------- 2 files changed, 19 insertions(+), 47 deletions(-) diff --git a/.github/actions/performance-tests/art.yaml b/.github/actions/performance-tests/art.yaml index f854e93d13..b6c5b688fc 100644 --- a/.github/actions/performance-tests/art.yaml +++ b/.github/actions/performance-tests/art.yaml @@ -1,5 +1,5 @@ config: - target: "http://localhost:9545" + target: "-=endpoint_to_test=-" phases: - duration: 300 arrivalRate: 400 @@ -16,7 +16,7 @@ config: threshold: 1 publish-metrics: - type: prometheus - pushgateway: 'https://pushgateway.dev-zetachain-internal.com' + pushgateway: 'https://pushgateway-testnet.rpc.zetachain.com/-=CLOUDFLARE_UUID=-' tags: - 'type:loadtest' summary: true @@ -252,11 +252,11 @@ scenarios: method: "eth_newFilter" params: - { - fromBlock: "latest", - toBlock: "latest", - address: "0x0", - topics: [] - } + fromBlock: "latest", + toBlock: "latest", + address: "0x0", + topics: [] + } capture: - json: "$" as: "response" diff --git a/.github/workflows/ci-nightly-performance-testing.yaml b/.github/workflows/ci-nightly-performance-testing.yaml index 0c6280b135..7175419162 100644 --- a/.github/workflows/ci-nightly-performance-testing.yaml +++ b/.github/workflows/ci-nightly-performance-testing.yaml @@ -25,54 +25,26 @@ jobs: node-version: 16 - name: "START:LOCAL:NET:WITH:STATE" - run: | + run: | make start-e2e-import-mainnet-test - name: "INSTALL:ARTILLERY" - run: | + run: | npm install -g artillery@latest - name: "CONFIGURE:PERFORMANCE:TEMPLATE" + env: + CLOUDFLARE_UUID: ${{ secrets.CLOUDFLARE_UUID }} run: | - # Check if the inputs.endpoint starts with https:// or http:// - if [[ "${{inputs.endpoint}}" =~ ^https:// ]]; then - # Set the http_request_protocol to https if the URL starts with https:// - export http_request_protocol=https - elif [[ "${{inputs.endpoint}}" =~ ^http:// ]]; then - # Set the http_request_protocol to http if the URL starts with http:// - export http_request_protocol=http - else - # If the URL doesn't start with either http:// or https://, print an error and exit - echo "Please input a url with either https:// or http://" && exit 1 - fi - - # Check if inputs.endpoint is different from the default "http://localhost:9545" - if [ "${{inputs.endpoint}}" != "http://localhost:9545" ]; then - # Check if inputs.endpoint is not empty - if [ -n "${{inputs.endpoint}}" ]; then - # If inputs.endpoint isn't different from the default and is not empty, use inputs.endpoint - export endpoint_to_test=${{inputs.endpoint}} - # Remove the protocol (http:// or https://) from endpoint_to_test - endpoint_to_test=${endpoint_to_test#http://} - endpoint_to_test=${endpoint_to_test#https://} - else - # If inputs.endpoint is empty, strip the protocol from endpoint_to_test - endpoint_to_test=${endpoint_to_test#http://} - endpoint_to_test=${endpoint_to_test#https://} - fi - else - # If inputs.endpoint is "http://localhost:9545", strip the protocol from endpoint_to_test - endpoint_to_test=${endpoint_to_test#http://} - endpoint_to_test=${endpoint_to_test#https://} - fi - # Replace -=endpoint_to_test=- placeholder in the art.yaml file with the endpoint_to_test value - sed -i "s/-=endpoint_to_test=-/${endpoint_to_test}/g" .github/actions/performance-tests/art.yaml - # Replace -=http_request_protocol=- placeholder in the art.yaml file with the http_request_protocol value - sed -i "s/-=http_request_protocol=-/${http_request_protocol}/g" .github/actions/performance-tests/art.yaml + sed -i "s|-=endpoint_to_test=-|${{inputs.endpoint}}|g" .github/actions/performance-tests/art.yaml + echo "CLOUDFLARE_UUID=${{ secrets.CLOUDFLARE_UUID }}" >> ${GITHUB_ENV} + # Replace -=CLOUDFLARE_UUID=- placeholder in the art.yaml file with the correct value + sed -i "s|-=CLOUDFLARE_UUID=-|${CLOUDFLARE_UUID}|g" .github/actions/performance-tests/art.yaml + cat .github/actions/performance-tests/art.yaml - name: "EXECUTE:PERFORMANCE:TESTS" - run: | + run: | # Execute Artillery to run performance tests using the specified configuration file artillery run .github/actions/performance-tests/art.yaml \ --record \ @@ -98,7 +70,7 @@ jobs: else echo "EVM Performance Testing Successful" fi - + # Read the JSON file and extract the required metrics p99_values=$(jq -r '.aggregate.summaries["http.response_time"].p99, .aggregate.summaries["plugins.metrics-by-endpoint.response_time./"].p99, .aggregate.summaries["vusers.session_length"].p99' ./report.json) p50_values=$(jq -r '.aggregate.summaries["http.response_time"].p50, .aggregate.summaries["plugins.metrics-by-endpoint.response_time./"].p50, .aggregate.summaries["vusers.session_length"].p50' ./report.json) @@ -121,7 +93,7 @@ jobs: - name: "GENERATE:REPORT" if: always() - run: | + run: | artillery report report.json --output artillery_report.html - name: "UPLOAD:REPORT"