forked from gpBlockchain/eth-jmeter-sample
-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (62 loc) · 2.39 KB
/
godwoken-bench.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: godwoken-bench
on:
workflow_dispatch:
inputs:
jmeterJmx:
type: choice
description: Make a choice of jmx
required: true
options:
- testnet-getBlockByNumber.jmx
- testnet-getBalance.jmx
- testnet-nativeTransfer.jmx
- alphanet-nativeTransfer.jmx
- testnet-bench-swap.jmx
wsUrl:
description: 'websocket url'
required: false
default: 'wss://v1.testnet.godwoken.io/ws'
gistId:
description: 'Gist ID'
required: false
default: 'bd29348042f0f1f8998728895dea3e65'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Build with Maven
run: mvn clean package --file pom.xml
- name: Start EthStats workflow
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
if [[ "${{ github.event.inputs.jmeterJmx }}" != "testnet-getBalance.jmx" && "${{ github.event.inputs.jmeterJmx }}" != "testnet-getBlockByNumber.jmx" ]]; then
curl -X POST \
-H "Authorization: token $GH_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/sunchengzhu/eth-performance/actions/workflows/ethStats.yml/dispatches \
-d '{"ref":"main", "inputs": {"jarArg": "'${{ github.event.inputs.wsUrl }}'", "gistId": "'${{ github.event.inputs.gistId }}'"}'
fi
- name: jmeter run
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIST_ID: bd29348042f0f1f8998728895dea3e65
run: |
update_gist() {
if [[ "${{ github.event.inputs.jmeterJmx }}" != "testnet-getBalance.jmx" && "${{ github.event.inputs.jmeterJmx }}" != "testnet-getBlockByNumber.jmx" ]]; then
cmd=$1
JSON_DATA=$(printf '{"description": "Updated gist","files": {"commands.txt": {"content": "%s"}}}' "$cmd")
curl -X PATCH -H "Authorization: token $GH_TOKEN" https://api.github.com/gists/$GIST_ID -d "${JSON_DATA}"
fi
}
update_gist "tps"
mvn jmeter:jmeter@configuration2 -DjmeterTest=${{ github.event.inputs.jmeterJmx }}
update_gist "stopTps"
sleep 5
update_gist "successRate"