Change format of data for TPS/Finality metrics in testnet automation (#1446)

* Change format of data for TPS/Finality metrics in testnet automation

* Revert number of nodes for testnet automation

* Split python command to its own script

* Fix python command line arguments
This commit is contained in:
Pankaj Garg 2018-10-09 10:35:01 -07:00 committed by GitHub
parent 9716c3de71
commit a80955eacb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View File

@ -0,0 +1,7 @@
#!/usr/bin/env python
import sys, json
data=json.load(sys.stdin)
print[\
([result['series'][0]['columns'][1].encode(), result['series'][0]['values'][0][1]]) \
for result in data['results']]

View File

@ -29,38 +29,38 @@ launchTestnet() {
sleep "$ITERATION_WAIT"
declare q_mean_tps='
SELECT round(mean("sum_count")) FROM (
SELECT round(mean("sum_count")) AS "mean_tps" FROM (
SELECT sum("count") AS "sum_count"
FROM "testnet-automation"."autogen"."counter-banking_stage-process_transactions"
WHERE time > now() - 300s GROUP BY time(1s)
)'
declare q_max_tps='
SELECT round(max("sum_count")) FROM (
SELECT round(max("sum_count")) AS "max_tps" FROM (
SELECT sum("count") AS "sum_count"
FROM "testnet-automation"."autogen"."counter-banking_stage-process_transactions"
WHERE time > now() - 300s GROUP BY time(1s)
)'
declare q_mean_finality='
SELECT round(mean("duration_ms"))
SELECT round(mean("duration_ms")) as "mean_finality"
FROM "testnet-automation"."autogen"."leader-finality"
WHERE time > now() - 300s'
declare q_max_finality='
SELECT round(max("duration_ms"))
SELECT round(max("duration_ms")) as "max_finality"
FROM "testnet-automation"."autogen"."leader-finality"
WHERE time > now() - 300s'
declare q_99th_finality='
SELECT round(percentile("duration_ms", 99))
SELECT round(percentile("duration_ms", 99)) as "99th_finality"
FROM "testnet-automation"."autogen"."leader-finality"
WHERE time > now() - 300s'
curl -G "https://metrics.solana.com:8086/query?u=${INFLUX_USERNAME}&p=${INFLUX_PASSWORD}" \
--data-urlencode "db=$INFLUX_DATABASE" \
--data-urlencode "q=$q_mean_tps;$q_max_tps;$q_mean_finality;$q_max_finality;$q_99th_finality" \
>>TPS"$nodeCount".log
--data-urlencode "q=$q_mean_tps;$q_max_tps;$q_mean_finality;$q_max_finality;$q_99th_finality" |
python ci/testnet-automation-json-parser.py >>TPS"$nodeCount".log
upload_ci_artifact TPS"$nodeCount".log
}