Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Add slot rate check to automation framework
Browse files Browse the repository at this point in the history
  • Loading branch information
danpaul000 committed Mar 5, 2020
1 parent 8df4d8b commit a70e040
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion system-test/testnet-automation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"

Expand All @@ -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_START_SECONDS - SLOT_COUNT_END_SECONDS)) seconds"

execution_step "Collect statistics about run"
declare q_mean_tps='
SELECT ROUND(MEAN("median_sum")) as "mean_tps" FROM (
Expand Down Expand Up @@ -285,6 +302,7 @@ function launchTestnet() {

RESULT_DETAILS=
STEP=
SLOTS_PER_SECOND=
execution_step "Initialize Environment"

cd "$(dirname "$0")/.."
Expand Down Expand Up @@ -385,6 +403,7 @@ TEST_PARAMS_TO_DISPLAY=(CLOUD_PROVIDER \
PARTITION_ACTIVE_DURATION \
PARTITION_INACTIVE_DURATION \
PARTITION_ITERATION_COUNT \
SLOTS_PER_SECOND \
)

TEST_CONFIGURATION=
Expand Down

0 comments on commit a70e040

Please # to comment.