mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
new: timer
This commit is contained in:
parent
87c54fa7be
commit
1da5b36da9
1 changed files with 6 additions and 0 deletions
|
|
@ -5,6 +5,8 @@ balanceInit=$(docker exec bor0 bash -c "bor attach /root/.bor/data/bor.ipc -exec
|
|||
|
||||
stateSyncFound="false"
|
||||
checkpointFound="false"
|
||||
SECONDS=0
|
||||
start_time=$SECONDS
|
||||
|
||||
while true
|
||||
do
|
||||
|
|
@ -17,12 +19,14 @@ do
|
|||
fi
|
||||
|
||||
if (( $balance > $balanceInit )); then
|
||||
stateSyncTime=$(( SECONDS - start_time ))
|
||||
stateSyncFound="true"
|
||||
fi
|
||||
|
||||
checkpointID=$(curl -sL http://localhost:1317/checkpoints/latest | jq .result.id)
|
||||
|
||||
if [ $checkpointID != "null" ]; then
|
||||
checkpointTime=$(( SECONDS - start_time ))
|
||||
checkpointFound="true"
|
||||
fi
|
||||
|
||||
|
|
@ -32,3 +36,5 @@ do
|
|||
|
||||
done
|
||||
echo "Both state sync and checkpoint went through. All tests have passed!"
|
||||
echo "Time taken for state sync: $(printf '%02dm:%02ds\n' $(($stateSyncTime%3600/60)) $(($stateSyncTime%60)))"
|
||||
echo "Time taken for checkpoint: $(printf '%02dm:%02ds\n' $(($checkpointTime%3600/60)) $(($checkpointTime%60)))"
|
||||
|
|
|
|||
Loading…
Reference in a new issue