Skip to content

Commit

Permalink
Cleaning up prep.sh after ffperf (hyperledger#24)
Browse files Browse the repository at this point in the history
* Cleaning up prep.sh after ffperf

Signed-off-by: hfuss <[email protected]>

* genercizing grafana dashboard

Signed-off-by: hfuss <[email protected]>
  • Loading branch information
onelapahead authored Mar 18, 2022
1 parent 185edc2 commit c44f5c5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 72 deletions.
2 changes: 0 additions & 2 deletions GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
git clone [email protected]:hyperledger/firefly.git ~/ffperf-testing/firefly
git clone [email protected]:hyperledger/firefly-perf-cli.git ~/ffperf-testing/firefly-perf-cli
cp scripts/getLogs.sh ~/ffperf-testing/getLogs.sh
chmod +x ~/ffperf-testing/getLogs.sh
cp scripts/prep.sh ~/ffperf-testing/prep.sh
chmod +x ~/ffperf-testing/prep.sh
```

## Preparing Environment
Expand Down
105 changes: 40 additions & 65 deletions grafanaDashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "rate(ff_apiserver_rest_requests_total{instance=\"$test_node\"}[$__rate_interval])",
Expand Down Expand Up @@ -152,8 +151,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "sum(rate(ff_apiserver_rest_request_duration_seconds_bucket{instance=\"$test_node\"}[$__rate_interval])) by (le)",
Expand Down Expand Up @@ -235,8 +233,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_broadcast_submitted_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -290,8 +287,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_broadcast_confirmed_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -345,8 +341,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_broadcast_rejected_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -386,8 +381,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "sum(rate(ff_broadcast_histogram_bucket{instance=\"$test_node\"}[$__rate_interval])) by (le)",
Expand Down Expand Up @@ -456,8 +450,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_apiserver_rest_requests_total{route=~\"/api/v1/namespaces/{ns}/messages/broadcast\",code=~\"200|202\",instance=\"$test_node\"}",
Expand Down Expand Up @@ -516,8 +509,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_apiserver_rest_requests_total{route=\"/api/v1/namespaces/{ns}/messages/broadcast\",code=\"500\",instance=\"$test_node\"}",
Expand Down Expand Up @@ -598,8 +590,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_broadcast_submitted_total{instance=\"$test_node\"}-ff_broadcast_confirmed_total{instance=\"$test_node\"}+ff_broadcast_rejected_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -680,8 +671,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": false,
"expr": "ff_apiserver_rest_requests_total{route=\"/api/v1/namespaces/{ns}/messages/broadcast\",code=\"500\",instance=\"$test_node\"}",
Expand Down Expand Up @@ -749,8 +739,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_private_msg_submitted_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -804,8 +793,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_private_msg_confirmed_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -859,8 +847,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_private_msg_rejected_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -900,8 +887,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "sum(rate(ff_private_msg_histogram_bucket{instance=\"$test_node\"}[$__rate_interval])) by (le)",
Expand Down Expand Up @@ -970,8 +956,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_apiserver_rest_requests_total{route=~\"/api/v1/namespaces/{ns}/messages/private\",code=~\"202\",instance=\"$test_node\"}",
Expand Down Expand Up @@ -1031,8 +1016,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_apiserver_rest_requests_total{route=\"/api/v1/namespaces/{ns}/messages/private\",code=\"500\",instance=\"$test_node\"}",
Expand Down Expand Up @@ -1113,8 +1097,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_private_msg_submitted_total{instance=\"$test_node\"}-ff_private_msg_confirmed_total{instance=\"$test_node\"}+ff_private_msg_rejected_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -1199,8 +1182,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_apiserver_rest_requests_total{route=\"/api/v1/namespaces/{ns}/messages/private\",code=\"500\",instance=\"$test_node\"}",
Expand Down Expand Up @@ -1268,8 +1250,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_mint_submitted_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -1323,8 +1304,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_mint_confirmed_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -1378,8 +1358,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_mint_rejected_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -1419,8 +1398,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "sum(rate(ff_mint_histogram_bucket{instance=\"$test_node\"}[$__rate_interval])) by (le)",
Expand Down Expand Up @@ -1489,8 +1467,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_apiserver_rest_requests_total{route=~\"/api/v1/namespaces/{ns}/tokens/mint\",code=~\"200|202\",instance=\"$test_node\"}",
Expand Down Expand Up @@ -1565,8 +1542,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_apiserver_rest_requests_total{route=~\"/api/v1/namespaces/{ns}/tokens/mint\",code=\"500\",instance=\"$test_node\"}",
Expand Down Expand Up @@ -1647,8 +1623,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_mint_submitted_total{instance=\"$test_node\"}-ff_mint_confirmed_total{instance=\"$test_node\"}+ff_mint_rejected_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -1749,8 +1724,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_apiserver_rest_requests_total{route=\"/api/v1/namespaces/{ns}/tokens/mint\",code=\"500\",instance=\"$test_node\"}",
Expand Down Expand Up @@ -1818,8 +1792,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "ff_batchpin_total{instance=\"$test_node\"}",
Expand Down Expand Up @@ -1902,8 +1875,7 @@
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "FwnjnVA7z"
"type": "prometheus"
},
"exemplar": true,
"expr": "(ff_broadcast_submitted_total+ff_private_msg_submitted_total)/ff_batchpin_total",
Expand All @@ -1928,20 +1900,23 @@
"text": "firefly_core_0:5108",
"value": "firefly_core_0:5108"
},
"definition": "label_values(ff_apiserver_rest_requests_total, instance)",
"description": "Instance being tested and monitored",
"hide": 0,
"includeAll": false,
"label": "Test Node",
"multi": false,
"name": "test_node",
"options": [
{
"selected": true,
"text": "firefly_core_0:5108",
"value": "firefly_core_0:5108"
}
],
"query": "firefly_core_0:5108",
"options": [],
"query": {
"query": "label_values(ff_apiserver_rest_requests_total, instance)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "textbox"
"sort": 0,
"type": "query"
}
]
},
Expand Down
10 changes: 5 additions & 5 deletions scripts/prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ JOBS="msg_broadcast msg_private"
FLAGS=""

# Kill existing ffperf processes
printf "${PURPLE}Killing ff-perf processes...\n${NC}"
printf "${PURPLE}Killing ffperf processes...\n${NC}"
pkill -f 'ffperf'
rm $BASE_PATH/ffperf.log

# Install local ffperf-cli
printf "${PURPLE}Installing local ff-perf-cli...\n${NC}"
printf "${PURPLE}Installing local ffperf CLI...\n${NC}"
cd $BASE_PATH/firefly-perf-cli
go install ./ffperf
make

# Build firefly image
printf "${PURPLE}Building FireFly Image...\n${NC}"
Expand Down Expand Up @@ -59,7 +59,7 @@ cd $BASE_PATH
printf ${PURPLE}"Deploying custom test contract...\n${NC}"

if [ "$BLOCKCHAIN_PROVIDER" == "geth" ]; then
output=$(ff deploy $NEW_STACK_NAME /firefly/test/data/simplestorage/simple_storage.json | grep address)
output=$(ff deploy $NEW_STACK_NAME ./firefly/test/data/simplestorage/simple_storage.json | grep address)
prefix='contract address: '
CONTRACT_ADDRESS=${output#"$prefix"}
FLAGS="$FLAGS -a $CONTRACT_ADDRESS"
Expand All @@ -76,7 +76,7 @@ fi
echo "FLAGS=$FLAGS"

printf "${PURPLE}Modify the command below and run...\n${NC}"
printf "${GREEN}nohup ffperf $JOBS -l 500h -r \"$ORG_IDENTITY\" -x \"$ORG_ADDRESS\" -w 100 -s ~/.firefly/stacks/$NEW_STACK_NAME/stack.json $FLAGS &> ff-perf.log &${NC}\n"
printf "${GREEN}nohup ffperf run-tests $JOBS -l 500h -r \"$ORG_IDENTITY\" -x \"$ORG_ADDRESS\" -w 100 -s ~/.firefly/stacks/$NEW_STACK_NAME/stack.json $FLAGS &> ffperf.log &${NC}\n"

# Create markdown for Perf Test
printf "\n${RED}*** Before Starting Test ***${NC}\n"
Expand Down

0 comments on commit c44f5c5

Please sign in to comment.