diff --git a/system-test/testnet-automation.sh b/system-test/testnet-automation.sh index a2e2ff93f3..0c80a8c050 100755 --- a/system-test/testnet-automation.sh +++ b/system-test/testnet-automation.sh @@ -71,6 +71,12 @@ function wait_for_bootstrap_validator_stake_drop { done } +function get_slot { + source net/common.sh + loadConfigFile + ssh "${sshOptions[@]}" "${validatorIpList[0]}" '$HOME/.cargo/bin/solana slot' +} + function cleanup_testnet { RC=$? if [[ $RC != 0 ]]; then @@ -197,6 +203,10 @@ function launchTestnet() { --gpu-mode $startGpuMode --client-delay-start $CLIENT_DELAY_START fi + START_SLOT=$(get_slot) + SLOT_COUNT_START_SECONDS=$SECONDS + execution_step "Slot: $START_SLOT, Seconds: $SLOT_COUNT_START_SECONDS" + execution_step "Waiting for bootstrap validator's stake percentage to fall below $BOOTSTRAP_VALIDATOR_MAX_STAKE_THRESHOLD %" wait_for_bootstrap_validator_stake_drop "$BOOTSTRAP_VALIDATOR_MAX_STAKE_THRESHOLD" @@ -223,7 +233,14 @@ function launchTestnet() { # We should never get here echo Test duration and partition config not defined fi - + + END_SLOT=$(get_slot) + SLOT_COUNT_END_SECONDS=$SECONDS + execution_step "Slot: $END_SLOT, Seconds: $SLOT_COUNT_END_SECONDS" + + SLOTS_PER_SECOND="$(bc <<< "scale=3; ($END_SLOT - $START_SLOT)/($SLOT_COUNT_END_SECONDS - $SLOT_COUNT_START_SECONDS)")" + execution_step "Average slot rate: $SLOTS_PER_SECOND slots/second over $((SLOT_COUNT_END_SECONDS - SLOT_COUNT_START_SECONDS)) seconds" + execution_step "Collect statistics about run" declare q_mean_tps=' SELECT ROUND(MEAN("median_sum")) as "mean_tps" FROM ( @@ -278,6 +295,8 @@ function launchTestnet() { --data-urlencode "q=$q_mean_tps;$q_max_tps;$q_mean_confirmation;$q_max_confirmation;$q_99th_confirmation;$q_max_tower_distance_observed;$q_last_tower_distance_observed" | python system-test/testnet-automation-json-parser.py >>"$RESULT_FILE" + echo "slots_per_second: $SLOTS_PER_SECOND" >>"$RESULT_FILE" + execution_step "Writing test results to ${RESULT_FILE}" RESULT_DETAILS=$(<"$RESULT_FILE") upload-ci-artifact "$RESULT_FILE"