Skip to content

Commit

Permalink
update pushgateway domain
Browse files Browse the repository at this point in the history
  • Loading branch information
morde08 committed Jul 18, 2024
1 parent a0868bd commit 19b6d65
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 47 deletions.
14 changes: 7 additions & 7 deletions .github/actions/performance-tests/art.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
config:
target: "http://localhost:9545"
target: "-=endpoint_to_test=-"
phases:
- duration: 300
arrivalRate: 400
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down
52 changes: 12 additions & 40 deletions .github/workflows/ci-nightly-performance-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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)
Expand All @@ -121,7 +93,7 @@ jobs:
- name: "GENERATE:REPORT"
if: always()
run: |
run: |
artillery report report.json --output artillery_report.html
- name: "UPLOAD:REPORT"
Expand Down

0 comments on commit 19b6d65

Please sign in to comment.