From 819a0c5c7e6ca6fa855930acff2524f48da23b22 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Mon, 15 Apr 2019 18:56:04 -0700 Subject: [PATCH] Update testnet automation script to reflect changes in metrics (#3779) --- ci/testnet-automation.sh | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/ci/testnet-automation.sh b/ci/testnet-automation.sh index 49bf405dce..e913aef9e0 100755 --- a/ci/testnet-automation.sh +++ b/ci/testnet-automation.sh @@ -17,18 +17,22 @@ source ci/upload-ci-artifact.sh LEADER_CPU_MACHINE_TYPE="n1-standard-16 --accelerator count=2,type=nvidia-tesla-v100" [[ -n $CLIENT_COUNT ]] || CLIENT_COUNT=2 [[ -n $TESTNET_TAG ]] || TESTNET_TAG=testnet-automation -[[ -n $TESTNET_ZONE ]] || TESTNET_ZONE=us-west1-b +[[ -n $TESTNET_ZONES ]] || TESTNET_ZONES="us-west1-b" [[ -n $CHANNEL ]] || CHANNEL=beta +[[ -n $ADDITIONAL_FLAGS ]] || ADDITIONAL_FLAGS="" + +TESTNET_CLOUD_ZONES=(); while read -r -d, ; do TESTNET_CLOUD_ZONES+=( "$REPLY" ); done <<< "${TESTNET_ZONES}," launchTestnet() { declare nodeCount=$1 echo --- setup "$nodeCount" node test + + # shellcheck disable=SC2068 net/gce.sh create \ - -b \ -d pd-ssd \ -n "$nodeCount" -c "$CLIENT_COUNT" \ -G "$LEADER_CPU_MACHINE_TYPE" \ - -p "$TESTNET_TAG" -z "$TESTNET_ZONE" + -p "$TESTNET_TAG" ${TESTNET_CLOUD_ZONES[@]/#/-z } "$ADDITIONAL_FLAGS" echo --- configure database net/init-metrics.sh -e @@ -43,37 +47,39 @@ launchTestnet() { echo --- wait "$ITERATION_WAIT" seconds to complete test sleep "$ITERATION_WAIT" + set -x + declare q_mean_tps=' SELECT round(mean("sum_count")) AS "mean_tps" FROM ( SELECT sum("count") AS "sum_count" - FROM "testnet-automation"."autogen"."counter-banking_stage-process_transactions" + FROM "testnet-automation"."autogen"."counter-bank-process_transactions-txs" WHERE time > now() - 300s GROUP BY time(1s) )' declare q_max_tps=' SELECT round(max("sum_count")) AS "max_tps" FROM ( SELECT sum("count") AS "sum_count" - FROM "testnet-automation"."autogen"."counter-banking_stage-process_transactions" + FROM "testnet-automation"."autogen"."counter-bank-process_transactions-txs" WHERE time > now() - 300s GROUP BY time(1s) )' declare q_mean_confirmation=' SELECT round(mean("duration_ms")) as "mean_confirmation" - FROM "testnet-automation"."autogen"."leader-confirmation" + FROM "testnet-automation"."autogen"."validator-confirmation" WHERE time > now() - 300s' declare q_max_confirmation=' SELECT round(max("duration_ms")) as "max_confirmation" - FROM "testnet-automation"."autogen"."leader-confirmation" + FROM "testnet-automation"."autogen"."validator-confirmation" WHERE time > now() - 300s' declare q_99th_confirmation=' SELECT round(percentile("duration_ms", 99)) as "99th_confirmation" - FROM "testnet-automation"."autogen"."leader-confirmation" + FROM "testnet-automation"."autogen"."validator-confirmation" WHERE time > now() - 300s' - curl -G "https://metrics.solana.com:8086/query?u=${INFLUX_USERNAME}&p=${INFLUX_PASSWORD}" \ - --data-urlencode "db=$INFLUX_DATABASE" \ + curl -G "${INFLUX_HOST}/query?u=ro&p=topsecret" \ + --data-urlencode "db=testnet-automation" \ --data-urlencode "q=$q_mean_tps;$q_max_tps;$q_mean_confirmation;$q_max_confirmation;$q_99th_confirmation" | python ci/testnet-automation-json-parser.py >>TPS"$nodeCount".log