mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-12 15:03:45 +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"
|
stateSyncFound="false"
|
||||||
checkpointFound="false"
|
checkpointFound="false"
|
||||||
|
SECONDS=0
|
||||||
|
start_time=$SECONDS
|
||||||
|
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
|
|
@ -17,12 +19,14 @@ do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $balance > $balanceInit )); then
|
if (( $balance > $balanceInit )); then
|
||||||
|
stateSyncTime=$(( SECONDS - start_time ))
|
||||||
stateSyncFound="true"
|
stateSyncFound="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
checkpointID=$(curl -sL http://localhost:1317/checkpoints/latest | jq .result.id)
|
checkpointID=$(curl -sL http://localhost:1317/checkpoints/latest | jq .result.id)
|
||||||
|
|
||||||
if [ $checkpointID != "null" ]; then
|
if [ $checkpointID != "null" ]; then
|
||||||
|
checkpointTime=$(( SECONDS - start_time ))
|
||||||
checkpointFound="true"
|
checkpointFound="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -32,3 +36,5 @@ do
|
||||||
|
|
||||||
done
|
done
|
||||||
echo "Both state sync and checkpoint went through. All tests have passed!"
|
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