Update testnet automation script to reflect changes in metrics (#3779)

This commit is contained in:
Pankaj Garg 2019-04-15 18:56:04 -07:00 committed by GitHub
parent 7afd8644b3
commit 819a0c5c7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 10 deletions

View File

@ -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