Created
August 28, 2022 17:05
-
-
Save TrevorBenson/5c2cf9d22167ac08ac3736443998322e to your computer and use it in GitHub Desktop.
Check total time spent validating chain after node restart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
timestamp() { date '+%s' --date="$1"; } | |
check_validation_time() { | |
file=$1 | |
finalChunk=$(jq -r '. | select(.data.initialChunk == "0") | .data.finalChunk' ${file}) | |
startTime=$(jq -r '. | select(.data.initialChunk == "0") | .at' ${file}) | |
endTime=$(jq -r --arg myfc ${finalChunk} '. | select(.data.initialChunk == $myfc) | .at' ${file}) | |
totalTime=$( echo $(( $(timestamp ${endTime}) - $(timestamp ${startTime}) )) ) | |
HMS=$(date -d@${totalTime} -u +%H:%M:%S) | |
echo "The total time spent on chain validation was: ${HMS}" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment